2020-02-07 05:30:23 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
|
2017-12-30 02:07:07 +08:00
|
|
|
|
2020-02-07 05:30:23 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=50 -ast-print %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=50 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
|
2014-07-21 19:26:11 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
|
|
|
void foo() {}
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
T tmain(T argc) {
|
|
|
|
static T a;
|
|
|
|
#pragma omp flush
|
2020-02-07 05:30:23 +08:00
|
|
|
#pragma omp flush acq_rel
|
2020-02-11 03:30:39 +08:00
|
|
|
#pragma omp flush acquire
|
2020-02-11 04:49:05 +08:00
|
|
|
#pragma omp flush release
|
2014-07-21 19:26:11 +08:00
|
|
|
#pragma omp flush(a)
|
|
|
|
return a + argc;
|
|
|
|
}
|
2016-11-10 16:49:37 +08:00
|
|
|
// CHECK: static T a;
|
2018-02-15 01:38:47 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush{{$}}
|
2020-02-07 05:30:23 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acq_rel{{$}}
|
2020-02-11 03:30:39 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acquire{{$}}
|
2020-02-11 04:49:05 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush release{{$}}
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush (a)
|
2016-11-10 16:49:37 +08:00
|
|
|
// CHECK: static int a;
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush
|
2020-02-07 05:30:23 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acq_rel{{$}}
|
2020-02-11 03:30:39 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acquire{{$}}
|
2020-02-11 04:49:05 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush release{{$}}
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush (a)
|
2016-11-10 16:49:37 +08:00
|
|
|
// CHECK: static char a;
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush
|
2020-02-07 05:30:23 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acq_rel{{$}}
|
2020-02-11 03:30:39 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acquire{{$}}
|
2020-02-11 04:49:05 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush release{{$}}
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush (a)
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
static int a;
|
|
|
|
// CHECK: static int a;
|
|
|
|
#pragma omp flush
|
2020-02-07 05:30:23 +08:00
|
|
|
#pragma omp flush acq_rel
|
2020-02-11 03:30:39 +08:00
|
|
|
#pragma omp flush acquire
|
2020-02-11 04:49:05 +08:00
|
|
|
#pragma omp flush release
|
2014-07-21 19:26:11 +08:00
|
|
|
#pragma omp flush(a)
|
|
|
|
// CHECK-NEXT: #pragma omp flush
|
2020-02-07 05:30:23 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acq_rel
|
2020-02-11 03:30:39 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush acquire{{$}}
|
2020-02-11 04:49:05 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush release
|
2014-07-21 19:26:11 +08:00
|
|
|
// CHECK-NEXT: #pragma omp flush (a)
|
|
|
|
return tmain(argc) + tmain(argv[0][0]) + a;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|