blob: 65a007e271c478f46fa0139689cd95a45f81a0de [file] [log] [blame]
Alexey Bataevd1e40fb2014-06-26 12:05:45 +00001// 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, int N>
12T tmain(T argc) {
13 T b = argc, c, d, e, f, g;
14 static T a;
15// CHECK: static T a;
Alexey Bataevbae9a792014-06-27 10:37:06 +000016#pragma omp parallel private(g)
17#pragma omp single private(argc, b), firstprivate(c, d), nowait copyprivate(g)
Alexey Bataevd1e40fb2014-06-26 12:05:45 +000018 foo();
Alexey Bataevbae9a792014-06-27 10:37:06 +000019 // CHECK-NEXT: #pragma omp parallel private(g)
20 // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(c,d) nowait copyprivate(g)
Alexey Bataevd1e40fb2014-06-26 12:05:45 +000021 // CHECK-NEXT: foo();
22 return T();
23}
24
25int main(int argc, char **argv) {
26 int b = argc, c, d, e, f, g;
27 static int a;
28// CHECK: static int a;
Alexey Bataevbae9a792014-06-27 10:37:06 +000029#pragma omp parallel private(g)
30#pragma omp single private(argc, b), firstprivate(argv, c), nowait copyprivate(g)
Alexey Bataevd1e40fb2014-06-26 12:05:45 +000031 foo();
Alexey Bataevbae9a792014-06-27 10:37:06 +000032 // CHECK-NEXT: #pragma omp parallel private(g)
33 // CHECK-NEXT: #pragma omp single private(argc,b) firstprivate(argv,c) nowait copyprivate(g)
Alexey Bataevd1e40fb2014-06-26 12:05:45 +000034 // CHECK-NEXT: foo();
35 return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
36}
37
38#endif