Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions flang/test/Parser/OpenMP/requires.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=50 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=50 %s | FileCheck --check-prefix="PARSE-TREE" %s
!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=60 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=60 %s | FileCheck --check-prefix="PARSE-TREE" %s

!$omp requires atomic_default_mem_order(seq_cst)

Expand Down Expand Up @@ -44,4 +44,13 @@
!PARSE-TREE: | | | bool = 'false'
!PARSE-TREE: | Flags = None

!$omp requires device_safesync

!UNPARSE: !$OMP REQUIRES DEVICE_SAFESYNC

!PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPRequiresConstruct -> OmpDirectiveSpecification
!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = requires
!PARSE-TREE: | OmpClauseList -> OmpClause -> DeviceSafesync
!PARSE-TREE: | Flags = None

end
7 changes: 4 additions & 3 deletions llvm/include/llvm/Frontend/OpenMP/OMP.td
Original file line number Diff line number Diff line change
Expand Up @@ -1022,16 +1022,17 @@ def OMP_Requires : Directive<[Spelling<"requires">]> {
let allowedOnceClauses = [
VersionedClause<OMPC_UnifiedAddress>,
VersionedClause<OMPC_UnifiedSharedMemory>,
VersionedClause<OMPC_AtomicDefaultMemOrder>,
VersionedClause<OMPC_DeviceSafesync, 60>,
VersionedClause<OMPC_DynamicAllocators>, VersionedClause<OMPC_SelfMaps>,
// OpenMP 5.2 Spec: If an implementation is not supporting a requirement
// (reverse offload in this case) then it should give compile-time error
// termination.
// Seeting supported version for reverse_offload to a distant future version
// Setting supported version for reverse_offload to a distant future version
// 9.9 so that its partial support can be tested in the meantime.
//
// TODO: Correct this supprted version number whenever complete
// implementation of reverse_offload is available.
VersionedClause<OMPC_AtomicDefaultMemOrder>,
VersionedClause<OMPC_DynamicAllocators>, VersionedClause<OMPC_SelfMaps>,
VersionedClause<OMPC_ReverseOffload, 99>,
];
let association = AS_None;
Expand Down
Loading