1 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
2
3 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
4
foo()5 void foo() { }
6
xxx(int argc)7 void xxx(int argc) {
8 int map; // expected-note {{initialize the variable 'map' to silence this warning}}
9 #pragma omp target data map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
10 for (int i = 0; i < 10; ++i)
11 ;
12 }
13
main(int argc,char ** argv)14 int main(int argc, char **argv) {
15 int a;
16 #pragma omp target data // expected-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}}
17 {}
18 L1:
19 foo();
20 #pragma omp target data map(a) allocate(a) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp target data'}}
21 {
22 foo();
23 goto L1; // expected-error {{use of undeclared label 'L1'}}
24 }
25 goto L2; // expected-error {{use of undeclared label 'L2'}}
26 #pragma omp target data map(a)
27 L2:
28 foo();
29
30 #pragma omp target data map(a)(i) // expected-warning {{extra tokens at the end of '#pragma omp target data' are ignored}}
31 {
32 foo();
33 }
34 #pragma omp target unknown // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
35 {
36 foo();
37 }
38 return 0;
39 }
40