[libc++] Refactor the sequence container benchmarks (#119763)
[llvm-project.git] / clang / test / SemaOpenACC / data-construct-deviceptr-ast.cpp
bloba4ac289ab4827797198af03688303df0239aa09c
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 int Global;
11 short GlobalArray[5];
13 void NormalUses(float *PointerParam) {
14 // CHECK: FunctionDecl{{.*}}NormalUses
15 // CHECK: ParmVarDecl
16 // CHECK-NEXT: CompoundStmt
18 #pragma acc data default(present) deviceptr(PointerParam)
19 for(int i = 0; i < 5; ++i);
20 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
21 // CHECK-NEXT: default(present)
22 // CHECK-NEXT: deviceptr clause
23 // CHECK-NEXT: DeclRefExpr{{.*}}'float *' lvalue ParmVar{{.*}} 'PointerParam' 'float *'
24 // CHECK-NEXT: ForStmt
25 // CHECK: NullStmt
28 template<typename T>
29 void TemplUses(T *t) {
30 // CHECK-NEXT: FunctionTemplateDecl
31 // CHECK-NEXT: TemplateTypeParmDecl{{.*}}typename depth 0 index 0 T
32 // CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void (T *)'
33 // CHECK-NEXT: ParmVarDecl{{.*}} referenced t 'T *'
34 // CHECK-NEXT: CompoundStmt
36 #pragma acc data default(present) deviceptr(t)
37 for(int i = 0; i < 5; ++i);
38 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
39 // CHECK-NEXT: default(present)
40 // CHECK-NEXT: deviceptr clause
41 // CHECK-NEXT: DeclRefExpr{{.*}}'T *' lvalue ParmVar{{.*}} 't' 'T *'
42 // CHECK-NEXT: ForStmt
43 // CHECK: NullStmt
46 // Check the instantiated versions of the above.
47 // CHECK-NEXT: FunctionDecl{{.*}} used TemplUses 'void (int *)' implicit_instantiation
48 // CHECK-NEXT: TemplateArgument type 'int'
49 // CHECK-NEXT: BuiltinType{{.*}} 'int'
50 // CHECK-NEXT: ParmVarDecl{{.*}} used t 'int *'
51 // CHECK-NEXT: CompoundStmt
53 // CHECK-NEXT: OpenACCDataConstruct{{.*}} data
54 // CHECK-NEXT: default(present)
55 // CHECK-NEXT: deviceptr clause
56 // CHECK-NEXT: DeclRefExpr{{.*}}'int *' lvalue ParmVar{{.*}} 't' 'int *'
57 // CHECK-NEXT: ForStmt
58 // CHECK: NullStmt
62 void Inst() {
63 int i;
64 TemplUses(&i);
66 #endif