Home | History | Annotate | Download | only in OpenMP
      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 // expected-no-diagnostics
      5 
      6 #ifndef HEADER
      7 #define HEADER
      8 
      9 void foo() {}
     10 
     11 template <class T>
     12 T tmain(T argc) {
     13   static T a;
     14 #pragma omp taskyield
     15   return a + argc;
     16 }
     17 // CHECK:      static int a;
     18 // CHECK-NEXT: #pragma omp taskyield
     19 // CHECK:      static char a;
     20 // CHECK-NEXT: #pragma omp taskyield
     21 // CHECK:      static T a;
     22 // CHECK-NEXT: #pragma omp taskyield
     23 
     24 int main(int argc, char **argv) {
     25   static int a;
     26 // CHECK: static int a;
     27 #pragma omp taskyield
     28   // CHECK-NEXT: #pragma omp taskyield
     29   return tmain(argc) + tmain(argv[0][0]) + a;
     30 }
     31 
     32 #endif
     33