[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ast-print-openacc-combined-construct.cpp
blob6885806584f3d113f28511117e403a5587bcfb6e
1 // RUN: %clang_cc1 -fopenacc -Wno-openacc-deprecated-clause-alias -ast-print %s -o - | FileCheck %s
3 void foo() {
4 int *iPtr;
5 // CHECK: #pragma acc parallel loop
6 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
7 // CHECK-NEXT: ;
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)
12 // CHECK-NEXT: ;
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)
17 // CHECK-NEXT: ;
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)
22 // CHECK-NEXT: ;
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)
27 // CHECK-NEXT: ;
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)
32 // CHECK-NEXT: ;
33 #pragma acc kernels loop independent
34 for(int i = 0;i<5;++i);
36 bool SomeB;
37 struct SomeStruct{} SomeStructImpl;
39 //CHECK: #pragma acc parallel loop dtype(SomeB)
40 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
41 // CHECK-NEXT: ;
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)
47 // CHECK-NEXT: ;
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)
53 // CHECK-NEXT: ;
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)
59 // CHECK-NEXT: ;
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)
65 // CHECK-NEXT: ;
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)
71 // CHECK-NEXT: ;
72 #pragma acc kernels loop dtype(AnotherIdent)
73 for(int i = 0;i<5;++i);
75 int i;
76 float array[5];
78 // CHECK: #pragma acc parallel loop self(i == 3)
79 // CHECK-NEXT: for (int i = 0; i < 5; ++i)
80 // CHECK-NEXT: ;
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)
86 // CHECK-NEXT: ;
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)
92 // CHECK-NEXT: ;
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)
97 // CHECK-NEXT: ;
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)
103 // CHECK-NEXT: ;
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)
109 // CHECK-NEXT: ;
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)
115 // CHECK-NEXT: ;
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)
121 // CHECK-NEXT: ;
122 #pragma acc kernels loop async
123 for(int i = 0;i<5;++i);