| 1 |
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ast-print %s | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s |
| 3 |
// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 4 |
|
| 5 |
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=60 -ast-print %s | FileCheck %s |
| 6 |
// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -x c++ -std=c++11 -emit-pch -o %t %s |
| 7 |
// RUN: %clang_cc1 -fopenmp -fopenmp-version=60 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 8 |
|
| 9 |
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ast-print %s | FileCheck %s |
| 10 |
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++11 -emit-pch -o %t %s |
| 11 |
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=51 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 12 |
|
| 13 |
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=60 -ast-print %s | FileCheck %s |
| 14 |
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=60 -x c++ -std=c++11 -emit-pch -o %t %s |
| 15 |
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=60 -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 16 |
// expected-no-diagnostics |
| 17 |
|
| 18 |
#ifndef HEADER |
| 19 |
#define HEADER |
| 20 |
|
| 21 |
void foo() {} |
| 22 |
|
| 23 |
template <class T> |
| 24 |
T tmain(T argc) { |
| 25 |
static T a; |
| 26 |
#pragma omp flush |
| 27 |
#pragma omp flush acq_rel |
| 28 |
#pragma omp flush acquire |
| 29 |
#pragma omp flush release |
| 30 |
#pragma omp flush seq_cst |
| 31 |
#pragma omp flush(a) |
| 32 |
return a + argc; |
| 33 |
} |
| 34 |
// CHECK: static T a; |
| 35 |
// CHECK-NEXT: #pragma omp flush{{$}} |
| 36 |
// CHECK-NEXT: #pragma omp flush acq_rel{{$}} |
| 37 |
// CHECK-NEXT: #pragma omp flush acquire{{$}} |
| 38 |
// CHECK-NEXT: #pragma omp flush release{{$}} |
| 39 |
// CHECK-NEXT: #pragma omp flush seq_cst{{$}} |
| 40 |
// CHECK-NEXT: #pragma omp flush (a) |
| 41 |
// CHECK: static int a; |
| 42 |
// CHECK-NEXT: #pragma omp flush |
| 43 |
// CHECK-NEXT: #pragma omp flush acq_rel{{$}} |
| 44 |
// CHECK-NEXT: #pragma omp flush acquire{{$}} |
| 45 |
// CHECK-NEXT: #pragma omp flush release{{$}} |
| 46 |
// CHECK-NEXT: #pragma omp flush seq_cst{{$}} |
| 47 |
// CHECK-NEXT: #pragma omp flush (a) |
| 48 |
// CHECK: static char a; |
| 49 |
// CHECK-NEXT: #pragma omp flush |
| 50 |
// CHECK-NEXT: #pragma omp flush acq_rel{{$}} |
| 51 |
// CHECK-NEXT: #pragma omp flush acquire{{$}} |
| 52 |
// CHECK-NEXT: #pragma omp flush release{{$}} |
| 53 |
// CHECK-NEXT: #pragma omp flush seq_cst{{$}} |
| 54 |
// CHECK-NEXT: #pragma omp flush (a) |
| 55 |
|
| 56 |
int main(int argc, char **argv) { |
| 57 |
static int a; |
| 58 |
// CHECK: static int a; |
| 59 |
#pragma omp flush |
| 60 |
#pragma omp flush acq_rel |
| 61 |
#pragma omp flush acquire |
| 62 |
#pragma omp flush release |
| 63 |
#pragma omp flush seq_cst |
| 64 |
#pragma omp flush(a) |
| 65 |
// CHECK-NEXT: #pragma omp flush |
| 66 |
// CHECK-NEXT: #pragma omp flush acq_rel |
| 67 |
// CHECK-NEXT: #pragma omp flush acquire{{$}} |
| 68 |
// CHECK-NEXT: #pragma omp flush release |
| 69 |
// CHECK-NEXT: #pragma omp flush seq_cst |
| 70 |
// CHECK-NEXT: #pragma omp flush (a) |
| 71 |
return tmain(argc) + tmain(argv[0][0]) + a; |
| 72 |
} |
| 73 |
|
| 74 |
#endif |