1 // RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -ast-print %s -o - | FileCheck %s
8 // CHECK: #pragma acc parallel default(none)
9 // CHECK-NEXT: while (true)
10 #pragma acc parallel default(none)
12 // CHECK: #pragma acc serial default(present)
13 // CHECK-NEXT: while (true)
14 #pragma acc serial default(present)
16 // CHECK: #pragma acc kernels if(i == array[1])
17 // CHECK-NEXT: while (true)
18 #pragma acc kernels if(i == array[1])
20 // CHECK: #pragma acc parallel self(i == 3)
21 // CHECK-NEXT: while (true)
22 #pragma acc parallel self(i == 3)
25 // CHECK: #pragma acc parallel num_gangs(i, (int)array[2])
26 // CHECK-NEXT: while (true)
27 #pragma acc parallel num_gangs(i, (int)array[2])
30 // CHECK: #pragma acc parallel num_workers(i)
31 // CHECK-NEXT: while (true)
32 #pragma acc parallel num_workers(i)
35 // CHECK: #pragma acc parallel vector_length((int)array[1])
36 // CHECK-NEXT: while (true)
37 #pragma acc parallel vector_length((int)array[1])
40 // CHECK: #pragma acc parallel private(i, array[1], array, array[1:2])
41 #pragma acc parallel private(i, array[1], array, array[1:2])
44 // CHECK: #pragma acc parallel firstprivate(i, array[1], array, array[1:2])
45 #pragma acc parallel firstprivate(i, array[1], array, array[1:2])
48 // CHECK: #pragma acc parallel no_create(i, array[1], array, array[1:2])
49 #pragma acc parallel no_create(i, array[1], array, array[1:2])
52 // CHECK: #pragma acc parallel present(i, array[1], array, array[1:2])
53 #pragma acc parallel present(i, array[1], array, array[1:2])
55 // CHECK: #pragma acc parallel no_create(i, array[1], array, array[1:2]) present(i, array[1], array, array[1:2])
56 #pragma acc parallel no_create(i, array[1], array, array[1:2]) present(i, array[1], array, array[1:2])
59 // CHECK: #pragma acc parallel copyin(i, array[1], array, array[1:2]) pcopyin(readonly: i, array[1], array, array[1:2]) present_or_copyin(i, array[1], array, array[1:2])
60 #pragma acc parallel copyin(i, array[1], array, array[1:2]) pcopyin(readonly:i, array[1], array, array[1:2]) present_or_copyin(i, array[1], array, array[1:2])
63 // CHECK: #pragma acc parallel copyout(i, array[1], array, array[1:2]) pcopyout(zero: i, array[1], array, array[1:2]) present_or_copyout(i, array[1], array, array[1:2])
64 #pragma acc parallel copyout(i, array[1], array, array[1:2]) pcopyout(zero: i, array[1], array, array[1:2]) present_or_copyout(i, array[1], array, array[1:2])
67 // CHECK: #pragma acc parallel create(i, array[1], array, array[1:2]) pcreate(zero: i, array[1], array, array[1:2]) present_or_create(i, array[1], array, array[1:2])
68 #pragma acc parallel create(i, array[1], array, array[1:2]) pcreate(zero: i, array[1], array, array[1:2]) present_or_create(i, array[1], array, array[1:2])
71 // CHECK: #pragma acc serial attach(iPtr, arrayPtr[0])
72 #pragma acc serial attach(iPtr, arrayPtr[0])
75 // CHECK: #pragma acc kernels deviceptr(iPtr, arrayPtr[0])
76 #pragma acc kernels deviceptr(iPtr, arrayPtr[0])
79 // CHECK: #pragma acc kernels async(*iPtr)
80 #pragma acc kernels async(*iPtr)
83 // CHECK: #pragma acc kernels async
84 #pragma acc kernels async
87 // CHECK: #pragma acc parallel wait
88 #pragma acc parallel wait
91 // CHECK: #pragma acc parallel wait()
92 #pragma acc parallel wait()
95 // CHECK: #pragma acc parallel wait(*iPtr, i)
96 #pragma acc parallel wait(*iPtr, i)
99 // CHECK: #pragma acc parallel wait(queues: *iPtr, i)
100 #pragma acc parallel wait(queues:*iPtr, i)
103 // CHECK: #pragma acc parallel wait(devnum: i : *iPtr, i)
104 #pragma acc parallel wait(devnum:i:*iPtr, i)
107 // CHECK: #pragma acc parallel wait(devnum: i : queues: *iPtr, i)
108 #pragma acc parallel wait(devnum:i:queues:*iPtr, i)
112 struct SomeStruct
{} SomeStructImpl
;
114 //CHECK: #pragma acc parallel dtype(SomeB)
115 #pragma acc parallel dtype(SomeB)
118 //CHECK: #pragma acc parallel device_type(SomeStruct)
119 #pragma acc parallel device_type(SomeStruct)
122 //CHECK: #pragma acc parallel device_type(int)
123 #pragma acc parallel device_type(int)
126 //CHECK: #pragma acc parallel dtype(bool)
127 #pragma acc parallel dtype(bool)
130 //CHECK: #pragma acc parallel device_type(SomeStructImpl)
131 #pragma acc parallel device_type (SomeStructImpl)
134 //CHECK: #pragma acc parallel reduction(+: iPtr)
135 #pragma acc parallel reduction(+: iPtr)
137 //CHECK: #pragma acc parallel reduction(*: i)
138 #pragma acc parallel reduction(*: i)
140 //CHECK: #pragma acc parallel reduction(max: SomeB)
141 #pragma acc parallel reduction(max: SomeB)
143 //CHECK: #pragma acc parallel reduction(min: iPtr)
144 #pragma acc parallel reduction(min: iPtr)
146 //CHECK: #pragma acc parallel reduction(&: i)
147 #pragma acc parallel reduction(&: i)
149 //CHECK: #pragma acc parallel reduction(|: SomeB)
150 #pragma acc parallel reduction(|: SomeB)
152 //CHECK: #pragma acc parallel reduction(^: iPtr)
153 #pragma acc parallel reduction(^: iPtr)
155 //CHECK: #pragma acc parallel reduction(&&: i)
156 #pragma acc parallel reduction(&&: i)
158 //CHECK: #pragma acc parallel reduction(||: SomeB)
159 #pragma acc parallel reduction(||: SomeB)