1// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ast-print %s | FileCheck %s
2// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -emit-pch -o %t %s
3// RUN: %clang_cc1 -fopenmp=libiomp5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s
4// expected-no-diagnostics
5
6#ifndef HEADER
7#define HEADER
8
9void foo() {}
10
11template <class T>
12T tmain(T argc) {
13  static T a;
14#pragma omp flush
15#pragma omp flush(a)
16  return a + argc;
17}
18// CHECK:      static int a;
19// CHECK-NEXT: #pragma omp flush
20// CHECK-NEXT: #pragma omp flush (a)
21// CHECK:      static char a;
22// CHECK-NEXT: #pragma omp flush
23// CHECK-NEXT: #pragma omp flush (a)
24// CHECK:      static T a;
25// CHECK-NEXT: #pragma omp flush
26// CHECK-NEXT: #pragma omp flush (a)
27
28int main(int argc, char **argv) {
29  static int a;
30// CHECK: static int a;
31#pragma omp flush
32#pragma omp flush(a)
33// CHECK-NEXT: #pragma omp flush
34// CHECK-NEXT: #pragma omp flush (a)
35  return tmain(argc) + tmain(argv[0][0]) + a;
36}
37
38#endif
39