1 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fnoopenmp-use-tls -ferror-limit 100 -emit-llvm -o - %s
2 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -emit-llvm -o - %s
4 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -emit-llvm -o - %s
5 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -emit-llvm -o - %s
7 #pragma omp allocate // expected-error {{expected '(' after 'allocate'}}
8 #pragma omp allocate( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}}
9 #pragma omp allocate() // expected-error {{expected identifier}}
10 #pragma omp allocate(1) // expected-error {{expected unqualified-id}}
16 #pragma omp allocate(1) // expected-error {{expected unqualified-id}}
18 } d
; // expected-note {{'d' defined here}}
20 int a
; // expected-note {{'a' defined here}}
22 #pragma omp allocate(a)
23 #pragma omp allocate(u) // expected-error {{use of undeclared identifier 'u'}}
24 #pragma omp allocate(d, a)
25 int foo() { // expected-note {{declared here}}
27 #pragma omp allocate(l)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
31 #pragma omp allocate(a)(
32 // expected-warning@-1 {{extra tokens at the end of '#pragma omp allocate' are ignored}}
33 #pragma omp allocate(a)[ // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
34 #pragma omp allocate(a) { // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
35 #pragma omp allocate(a)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
36 #pragma omp allocate(a)] // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
37 #pragma omp allocate(a) } // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
38 #pragma omp allocate a // expected-error {{expected '(' after 'allocate'}}
39 #pragma omp allocate(d // expected-error {{expected ')'}} expected-note {{to match this '('}}
40 #pragma omp allocate(d)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
42 #pragma omp allocate(x)) // expected-warning {{extra tokens at the end of '#pragma omp allocate' are ignored}}
43 #pragma omp allocate(y)),
44 // expected-warning@-1 {{extra tokens at the end of '#pragma omp allocate' are ignored}}
45 #pragma omp allocate(a, d)
46 #pragma omp allocate(d.a) // expected-error {{expected identifier}}
47 #pragma omp allocate((float)a) // expected-error {{expected unqualified-id}}
48 int foa
; // expected-note {{'foa' declared here}}
49 #pragma omp allocate(faa) // expected-error {{use of undeclared identifier 'faa'; did you mean 'foa'?}}
50 #pragma omp allocate(foo) // expected-error {{'foo' is not a global variable, static local variable or static data member}}
51 #pragma omp allocate(int a = 2) // expected-error {{expected unqualified-id}}
55 extern IncompleteSt e
;
56 #pragma omp allocate(e)
59 #pragma omp allocate(f)
63 int a
; // expected-note {{declared here}}
64 static int b
; // expected-note {{'b' declared here}}
68 TestClass(int aaa
) : a(aaa
) {}
69 #pragma omp allocate(b, a) // expected-error {{'a' is not a global variable, static local variable or static data member}}
71 #pragma omp allocate(b) // expected-error {{use of undeclared identifier 'b'}}
72 #pragma omp allocate(TestClass::b) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'TestClass::b' variable declaration}}
73 #pragma omp allocate(g)
77 #pragma omp allocate(m, m)
79 #pragma omp allocate(m) // expected-error {{use of undeclared identifier 'm'}}
80 #pragma omp allocate(ns::m)
81 #pragma omp allocate(ns \
82 : m) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}}
85 const volatile int i
= 10;
86 #pragma omp allocate(h, i)
95 TempClass(T aaa
) : a(aaa
) {}
97 #pragma omp allocate(s)
99 #pragma omp allocate(s) // expected-error {{use of undeclared identifier 's'}}
101 static __thread
int t
;
102 #pragma omp allocate(t)
104 // Register "0" is currently an invalid register for global register variables.
105 // Use "esp" instead of "0".
106 // register int reg0 __asm__("0");
107 register int reg0
__asm__("esp");
108 #pragma omp allocate(reg0)
110 int o
; // expected-note {{candidate found by name lookup is 'o'}}
111 #pragma omp allocate(o)
113 int o
; // expected-note {{candidate found by name lookup is '(anonymous namespace)::o'}}
114 #pragma omp allocate(o)
115 #pragma omp allocate(o)
117 #pragma omp allocate(o) // expected-error {{reference to 'o' is ambiguous}}
118 #pragma omp allocate(::o)
120 int main(int argc
, char **argv
) {
125 static double d3
; // expected-note {{'d3' defined here}}
127 static TestClass
LocalClass(y
);
128 #pragma omp allocate(LocalClass)
133 #pragma omp allocate(argc + y) // expected-error {{expected identifier}}
134 #pragma omp allocate(argc, y)
135 #pragma omp allocate(d2)
136 #pragma omp allocate(d1)
140 #pragma omp allocate(d3) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'd3' variable declaration}}
142 #pragma omp allocate(d3)
144 #pragma omp allocate(d4) // expected-error {{'#pragma omp allocate' cannot be an immediate substatement}}
146 #pragma omp allocate(a) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'a' variable declaration}}
148 #pragma omp allocate(d) // expected-error {{'#pragma omp allocate' must appear in the scope of the 'd' variable declaration}}
149 #pragma omp parallel allocate(d) // expected-error {{the referenced item is not found in any private clause on the same directive}}