1 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++14 \
2 // RUN: -ast-print %s | FileCheck %s --check-prefix=PRINT
4 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++14 \
5 // RUN: -ast-dump %s | FileCheck %s --check-prefix=DUMP
7 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++14 -emit-pch -o %t %s
9 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++14 -include-pch \
10 // RUN: %t -ast-print %s | FileCheck %s --check-prefix=PRINT
12 // RUN: %clang_cc1 -fopenmp -fopenmp-version=52 -std=c++14 -include-pch \
13 // RUN: %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP
14 // expected-no-diagnostics
19 typedef enum omp_allocator_handle_t
{
20 omp_null_allocator
= 0,
21 omp_default_mem_alloc
= 1,
22 omp_large_cap_mem_alloc
= 2,
23 omp_const_mem_alloc
= 3,
24 omp_high_bw_mem_alloc
= 4,
25 omp_low_lat_mem_alloc
= 5,
26 omp_cgroup_mem_alloc
= 6,
27 omp_pteam_mem_alloc
= 7,
28 omp_thread_mem_alloc
= 8,
29 } omp_allocator_handle_t
;
31 omp_allocator_handle_t
myAlloc() {
32 return omp_large_cap_mem_alloc
;
37 #pragma omp scope private(a) allocate(omp_const_mem_alloc:a)
39 #pragma omp scope private(a,b) allocate(allocator(omp_const_mem_alloc):a,b)
41 #pragma omp scope private(c,a,b) allocate(allocator(myAlloc()):a,b,c)
43 #pragma omp scope private(c,a,b,d) allocate(myAlloc():a,b,c,d)
44 // DUMP: FunctionDecl {{.*}}
45 // DUMP: DeclRefExpr {{.*}}'omp_allocator_handle_t' EnumConstant {{.*}}'omp_large_cap_mem_alloc' 'omp_allocator_handle_t'
46 // DUMP: FunctionDecl {{.*}}
47 // DUMP: OMPScopeDirective {{.*}}
48 // DUMP: OMPPrivateClause {{.*}}
49 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
50 // DUMP: OMPAllocateClause {{.*}}
51 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
52 // DUMP: OMPScopeDirective {{.*}}
53 // DUMP: OMPPrivateClause {{.*}}
54 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
55 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
56 // DUMP: OMPAllocateClause {{.*}}
57 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
58 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
59 // DUMP: OMPScopeDirective {{.*}}
60 // DUMP: OMPPrivateClause {{.*}}
61 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'c' 'int'
62 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
63 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
64 // DUMP: OMPAllocateClause {{.*}}
65 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
66 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
67 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'c' 'int'
68 // DUMP: OMPScopeDirective {{.*}}
69 // DUMP: OMPPrivateClause {{.*}}
70 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'c' 'int'
71 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
72 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
73 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'d' 'int'
74 // DUMP: OMPAllocateClause {{.*}}
75 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'a' 'int'
76 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'b' 'int'
77 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'c' 'int'
78 // DUMP: DeclRefExpr {{.*}}'int' lvalue Var {{.*}}'d' 'int'
79 // PRINT: #pragma omp scope private(a) allocate(omp_const_mem_alloc: a)
80 // PRINT: #pragma omp scope private(a,b) allocate(allocator(omp_const_mem_alloc): a,b)
81 // PRINT: #pragma omp scope private(c,a,b) allocate(allocator(myAlloc()): a,b,c)
82 // PRINT: #pragma omp scope private(c,a,b,d) allocate(myAlloc(): a,b,c,d)