1 // RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
4 // RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
5 // RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
11 // FIXME: Add a test once we have clauses for this.
12 // CHECK-LABEL: NormalFunc
13 // CHECK-NEXT: CompoundStmt
14 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
15 // CHECK-NEXT: default(none)
16 // CHECK-NEXT: CompoundStmt
17 #pragma acc parallel default(none)
20 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
21 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
22 // CHECK-NEXT: default(present)
23 // CHECK-NEXT: CompoundStmt
24 #pragma acc parallel default(present)
27 // FIXME: Add a test once we have clauses for this.
28 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
29 // CHECK-NEXT: CompoundStmt
33 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
34 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
35 // CHECK-NEXT: CompoundStmt
39 // FIXME: Add a test once we have clauses for this.
40 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}kernels
41 // CHECK-NEXT: CompoundStmt
45 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}kernels
46 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}kernels
47 // CHECK-NEXT: CompoundStmt
55 #pragma acc parallel default(none)
60 #pragma acc serial default(present)
70 // CHECK-LABEL: FunctionTemplateDecl {{.*}}TemplFunc
71 // CHECK-NEXT: TemplateTypeParmDecl
74 // CHECK-NEXT: FunctionDecl
75 // CHECK-NEXT: CompoundStmt
76 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
77 // CHECK-NEXT: default(none)
78 // CHECK-NEXT: CompoundStmt
79 // CHECK-NEXT: DeclStmt
80 // CHECK-NEXT: VarDecl{{.*}} I 'typename T::type'
81 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
82 // CHECK-NEXT: default(present)
83 // CHECK-NEXT: CompoundStmt
84 // CHECK-NEXT: DeclStmt
85 // CHECK-NEXT: VarDecl{{.*}} I 'typename T::type'
86 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}kernels
87 // CHECK-NEXT: CompoundStmt
88 // CHECK-NEXT: DeclStmt
89 // CHECK-NEXT: VarDecl{{.*}} I 'typename T::type'
91 // Check instantiation.
92 // CHECK-LABEL: FunctionDecl{{.*}} used TemplFunc 'void ()' implicit_instantiation
93 // CHECK-NEXT: TemplateArgument type 'S'
94 // CHECK-NEXT: RecordType
95 // CHECK-NEXT: CXXRecord
96 // CHECK-NEXT: CompoundStmt
97 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}parallel
98 // CHECK-NEXT: default(none)
99 // CHECK-NEXT: CompoundStmt
100 // CHECK-NEXT: DeclStmt
101 // CHECK-NEXT: VarDecl{{.*}} I 'typename S::type':'int'
102 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}serial
103 // CHECK-NEXT: default(present)
104 // CHECK-NEXT: CompoundStmt
105 // CHECK-NEXT: DeclStmt
106 // CHECK-NEXT: VarDecl{{.*}} I 'typename S::type':'int'
107 // CHECK-NEXT: OpenACCComputeConstruct {{.*}}kernels
108 // CHECK-NEXT: CompoundStmt
109 // CHECK-NEXT: DeclStmt
110 // CHECK-NEXT: VarDecl{{.*}} I 'typename S::type':'int'
121 struct HasCtor
{ HasCtor(); operator int(); ~HasCtor();};
124 // CHECK-LABEL: useCtorType
125 // CHECK-NEXT: CompoundStmt
127 #pragma acc kernels num_workers(HasCtor{})
128 // CHECK-NEXT: OpenACCComputeConstruct{{.*}} kernels
129 // CHECK-NEXT: num_workers clause
130 // CHECK-NEXT: ImplicitCastExpr{{.*}}'int' <UserDefinedConversion>
131 // CHECK-NEXT: CXXMemberCallExpr{{.*}}'int'
132 // CHECK-NEXT: MemberExpr{{.*}}.operator int
133 // CHECK-NEXT: MaterializeTemporaryExpr{{.*}}'HasCtor'
134 // CHECK-NEXT: CXXBindTemporaryExpr{{.*}}'HasCtor'
135 // CHECK-NEXT: CXXTemporaryObjectExpr{{.*}}'HasCtor'
138 // CHECK-NEXT: WhileStmt
139 // CHECK-NEXT: CXXBoolLiteralExpr
140 // CHECK-NEXT: NullStmt