diff options
Diffstat (limited to 'clang/test/PCH/chain-openmp-allocate.cpp')
-rw-r--r-- | clang/test/PCH/chain-openmp-allocate.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/clang/test/PCH/chain-openmp-allocate.cpp b/clang/test/PCH/chain-openmp-allocate.cpp new file mode 100644 index 00000000000..ea529b56ba9 --- /dev/null +++ b/clang/test/PCH/chain-openmp-allocate.cpp @@ -0,0 +1,36 @@ +// no PCH +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -ast-print -include %s -include %s %s -o - | FileCheck %s +// with PCH +// RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -ast-print -chain-include %s -chain-include %s %s -o - | FileCheck %s +// no PCH +// RUN: %clang_cc1 -fopenmp -ast-print -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-ALLOC-1 +// RUN: %clang_cc1 -fopenmp -ast-print -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-ALLOC-2 +// with PCH +// RUN: %clang_cc1 -fopenmp -ast-print -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-ALLOC-1 +// RUN: %clang_cc1 -fopenmp -ast-print -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-ALLOC-2 + +#if !defined(PASS1) +#define PASS1 + +int a; +// CHECK: int a; + +#elif !defined(PASS2) +#define PASS2 + +#pragma omp allocate(a) +// CHECK: #pragma omp allocate(a) + +#else + +// CHECK-LABEL: foo +// CHECK-ALLOC-LABEL: foo +int foo() { + return a; + // CHECK: return a; + // CHECK-ALLOC-1: return a; +} + +// CHECK-ALLOC-2: return a; + +#endif |