1 // RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -ast-print %s -o - | FileCheck %s
5 // CHECK: #pragma acc parallel loop
6 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
8 #pragma acc parallel loop
9 for(int i
= 0;i
<5;++i
);
10 // CHECK: #pragma acc serial loop
11 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
13 #pragma acc serial loop
14 for(int i
= 0;i
<5;++i
);
15 // CHECK: #pragma acc kernels loop
16 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
18 #pragma acc kernels loop
19 for(int i
= 0;i
<5;++i
);
20 // CHECK: #pragma acc parallel loop auto
21 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
23 #pragma acc parallel loop auto
24 for(int i
= 0;i
<5;++i
);
25 // CHECK: #pragma acc serial loop seq
26 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
28 #pragma acc serial loop seq
29 for(int i
= 0;i
<5;++i
);
30 // CHECK: #pragma acc kernels loop independent
31 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
33 #pragma acc kernels loop independent
34 for(int i
= 0;i
<5;++i
);
37 struct SomeStruct
{} SomeStructImpl
;
39 //CHECK: #pragma acc parallel loop dtype(SomeB)
40 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
42 #pragma acc parallel loop dtype(SomeB)
43 for(int i
= 0;i
<5;++i
);
45 //CHECK: #pragma acc serial loop device_type(SomeStruct)
46 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
48 #pragma acc serial loop device_type(SomeStruct)
49 for(int i
= 0;i
<5;++i
);
51 //CHECK: #pragma acc kernels loop device_type(int)
52 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
54 #pragma acc kernels loop device_type(int)
55 for(int i
= 0;i
<5;++i
);
57 //CHECK: #pragma acc parallel loop dtype(bool)
58 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
60 #pragma acc parallel loop dtype(bool)
61 for(int i
= 0;i
<5;++i
);
63 //CHECK: #pragma acc serial loop device_type(SomeStructImpl)
64 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
66 #pragma acc serial loop device_type (SomeStructImpl)
67 for(int i
= 0;i
<5;++i
);
69 // CHECK: #pragma acc kernels loop dtype(AnotherIdent)
70 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
72 #pragma acc kernels loop dtype(AnotherIdent)
73 for(int i
= 0;i
<5;++i
);
78 // CHECK: #pragma acc parallel loop self(i == 3)
79 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
81 #pragma acc parallel loop self(i == 3)
82 for(int i
= 0;i
<5;++i
);
84 // CHECK: #pragma acc kernels loop if(i == array[1])
85 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
87 #pragma acc kernels loop if(i == array[1])
88 for(int i
= 0;i
<5;++i
);
90 // CHECK: #pragma acc parallel loop default(none)
91 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
93 #pragma acc parallel loop default(none)
94 for(int i
= 0;i
<5;++i
);
95 // CHECK: #pragma acc serial loop default(present)
96 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
98 #pragma acc serial loop default(present)
99 for(int i
= 0;i
<5;++i
);
101 // CHECK: #pragma acc parallel loop private(i, array[1], array, array[1:2])
102 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
104 #pragma acc parallel loop private(i, array[1], array, array[1:2])
105 for(int i
= 0;i
<5;++i
);
107 // CHECK: #pragma acc serial loop firstprivate(i, array[1], array, array[1:2])
108 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
110 #pragma acc serial loop firstprivate(i, array[1], array, array[1:2])
111 for(int i
= 0;i
<5;++i
);
113 // CHECK: #pragma acc kernels loop async(*iPtr)
114 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
116 #pragma acc kernels loop async(*iPtr)
117 for(int i
= 0;i
<5;++i
);
119 // CHECK: #pragma acc kernels loop async
120 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
122 #pragma acc kernels loop async
123 for(int i
= 0;i
<5;++i
);