[libc++] Refactor the sequence container benchmarks (#119763)
[llvm-project.git] / clang / test / SemaOpenACC / combined-construct-attach-ast.cpp
blobc0b8d1b2eab522f8d6782e2b7079997dd57efa83
1 // RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
3 // Test this with PCH.
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
7 #ifndef PCH_HELPER
8 #define PCH_HELPER
10 void NormalUses(float *PointerParam) {
11 // CHECK: FunctionDecl{{.*}}NormalUses
12 // CHECK: ParmVarDecl
13 // CHECK-NEXT: CompoundStmt
15 #pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
16 for (unsigned i = 0; i < 5; ++i);
17 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
18 // CHECK-NEXT: attach clause
19 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
20 // CHECK-NEXT: deviceptr clause
21 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
22 // CHECK-NEXT: ForStmt
23 // CHECK: NullStmt
26 template<typename T>
27 void TemplUses(T *PointerParam) {
28 // CHECK-NEXT: FunctionTemplateDecl
29 // CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 0 T
30 // CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T *)'
31 // CHECK-NEXT: ParmVarDecl{{.*}} referenced PointerParam 'T *'
32 // CHECK-NEXT: CompoundStmt
34 #pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
35 for (unsigned i = 0; i < 5; ++i);
36 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
37 // CHECK-NEXT: attach clause
38 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 'PointerParam' 'T *'
39 // CHECK-NEXT: deviceptr clause
40 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 'PointerParam' 'T *'
41 // CHECK-NEXT: ForStmt
42 // CHECK: NullStmt
44 // Check the instantiated versions of the above.
45 // CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (int *)' implicit_instantiation
46 // CHECK-NEXT: TemplateArgument type 'int'
47 // CHECK-NEXT: BuiltinType{{.*}} 'int'
48 // CHECK-NEXT: ParmVarDecl{{.*}} used PointerParam 'int *'
49 // CHECK-NEXT: CompoundStmt
51 //#pragma acc parallel loop attach(PointerParam) deviceptr(PointerParam)
52 // CHECK-NEXT: OpenACCCombinedConstruct{{.*}} parallel loop
53 // CHECK-NEXT: attach clause
54 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 'PointerParam' 'int *'
55 // CHECK-NEXT: deviceptr clause
56 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 'PointerParam' 'int *'
57 // CHECK-NEXT: ForStmt
58 // CHECK: NullStmt
62 void Inst() {
63 int i;
64 TemplUses(&i);
66 #endif