blob: deb829e92673e2b5ce5329bc216563fc1252b787 [file] [log] [blame]
Alexey Bataevc6400582013-03-22 06:34:35 +00001// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
2// expected-no-diagnostics
3
4struct St{
5 int a;
6};
7
8struct St1{
9 int a;
10 static int b;
11// CHECK: static int b;
12#pragma omp threadprivate(b)
13// CHECK-NEXT: #pragma omp threadprivate(b)
14} d;
15
16int a, b;
17// CHECK: int a;
18// CHECK: int b;
19#pragma omp threadprivate(a)
20// CHECK-NEXT: #pragma omp threadprivate(a)
21#pragma omp threadprivate(d, b)
22// CHECK-NEXT: #pragma omp threadprivate(d,b)
23
24template <class T> T foo() {
25 static T v;
26 #pragma omp threadprivate(v)
27 return v;
28}
29//CHECK: template <class T = int> int foo() {
30//CHECK-NEXT: static int v;
31//CHECK-NEXT: #pragma omp threadprivate(v)
32//CHECK: template <class T> T foo() {
33//CHECK-NEXT: static T v;
34//CHECK-NEXT: #pragma omp threadprivate(v)
35
36int main () {
37 static int a;
38// CHECK: static int a;
39#pragma omp threadprivate(a)
40// CHECK-NEXT: #pragma omp threadprivate(a)
41 a=2;
42 return (foo<int>());
43}