blob: 500417e113be64abd5bc76fbf920cc31691f1171 [file] [log] [blame]
Stephen Hinesef822542014-07-21 00:47:37 -07001// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s
2
3void foo() {
4}
5
6bool foobool(int argc) {
7 return argc;
8}
9
10struct S1; // expected-note {{declared here}}
11class S2 {
12 mutable int a;
13
14public:
15 S2() : a(0) {}
16 S2 &operator=(S2 &s2) { return *this; }
17};
18class S3 {
19 int a;
20
21public:
22 S3() : a(0) {}
23 S3 &operator=(S3 &s3) { return *this; }
24};
25class S4 { // expected-note {{'S4' declared here}}
26 int a;
27 S4();
28 S4 &operator=(const S4 &s4);
29
30public:
31 S4(int v) : a(v) {}
32};
33class S5 { // expected-note {{'S5' declared here}}
34 int a;
35 S5() : a(0) {}
36 S5 &operator=(const S5 &s5) { return *this; }
37
38public:
39 S5(int v) : a(v) {}
40};
41template <class T>
42class ST {
43public:
44 static T s;
45};
46
47S2 k;
48S3 h;
49S4 l(3); // expected-note {{'l' defined here}}
50S5 m(4); // expected-note {{'m' defined here}}
51#pragma omp threadprivate(h, k, l, m)
52
53int main(int argc, char **argv) {
54 int i;
55#pragma omp parallel sections copyin // expected-error {{expected '(' after 'copyin'}}
56 {
57 foo();
58 }
59#pragma omp parallel sections copyin( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
60 {
61 foo();
62 }
63#pragma omp parallel sections copyin() // expected-error {{expected expression}}
64 {
65 foo();
66 }
67#pragma omp parallel sections copyin(k // expected-error {{expected ')'}} expected-note {{to match this '('}}
68 {
69 foo();
70 }
71#pragma omp parallel sections copyin(h, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
72 {
73 foo();
74 }
75#pragma omp parallel sections copyin(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
76 {
77 foo();
78 }
79#pragma omp parallel sections copyin(l) // expected-error {{copyin variable must have an accessible, unambiguous copy assignment operator}}
80 {
81 foo();
82 }
83#pragma omp parallel sections copyin(S1) // expected-error {{'S1' does not refer to a value}}
84 {
85 foo();
86 }
87#pragma omp parallel sections copyin(argv[1]) // expected-error {{expected variable name}}
88 {
89 foo();
90 }
91#pragma omp parallel sections copyin(i) // expected-error {{copyin variable must be threadprivate}}
92 {
93 foo();
94 }
95#pragma omp parallel sections copyin(m) // expected-error {{copyin variable must have an accessible, unambiguous copy assignment operator}}
96 {
97 foo();
98 }
99#pragma omp parallel sections copyin(ST < int > ::s) // expected-error {{copyin variable must be threadprivate}}
100 {
101 foo();
102 }
103
104 return 0;
105}