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