1 ! RUN: %flang_fc1 -fopenmp -fopenmp-version=50 -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
2 ! Ensure that requires atomic_default_mem_order is used to update atomic
3 ! operations with no explicit memory order set. ACQ_REL clause tested here.
6 !$omp requires atomic_default_mem_order(acq_rel)
9 ! ----------------------------------------------------------------------------
11 ! ----------------------------------------------------------------------------
13 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicRead
14 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Acquire
18 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicRead
19 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Acquire
20 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
21 !$omp atomic relaxed read
24 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicRead
25 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Acquire
26 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
27 !$omp atomic read relaxed
30 ! ----------------------------------------------------------------------------
32 ! ----------------------------------------------------------------------------
34 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicWrite
35 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Release
39 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicWrite
40 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Release
41 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
42 !$omp atomic relaxed write
45 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicWrite
46 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Release
47 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
48 !$omp atomic write relaxed
51 ! ----------------------------------------------------------------------------
53 ! ----------------------------------------------------------------------------
55 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicUpdate
56 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Release
60 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicUpdate
61 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Release
62 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
63 !$omp atomic relaxed update
66 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicUpdate
67 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Release
68 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
69 !$omp atomic update relaxed
72 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomic
73 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Release
77 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomic
78 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> Release
79 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
83 ! ----------------------------------------------------------------------------
85 ! ----------------------------------------------------------------------------
87 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicCapture
88 ! CHECK: OmpMemoryOrderClause -> OmpClause -> AcqRel
94 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicCapture
95 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> AcqRel
96 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
97 !$omp atomic relaxed capture
102 ! CHECK-LABEL: OpenMPAtomicConstruct -> OmpAtomicCapture
103 ! CHECK-NOT: OmpMemoryOrderClause -> OmpClause -> AcqRel
104 ! CHECK: OmpMemoryOrderClause -> OmpClause -> Relaxed
105 !$omp atomic capture relaxed