1 // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp -std=c++11 -o - %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
4 // RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
5 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
8 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
11 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
17 #pragma omp teams // expected-error {{unexpected OpenMP directive '#pragma omp teams'}}
19 int main(int argc
, char **argv
) {
20 #pragma omp teams // omp45-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
24 f
; // expected-error {{use of undeclared identifier 'f'}}
26 #pragma omp teams { // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
29 #pragma omp teams ( // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
32 #pragma omp teams [ // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
35 #pragma omp teams ] // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
38 #pragma omp teams ) // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
41 #pragma omp teams } // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}}
46 // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams' are ignored}}
48 #pragma omp teams unknown()
58 goto L1
; // expected-error {{use of undeclared label 'L1'}}
62 for (int i
= 0; i
< 10; ++i
) {
69 break; // expected-error {{'break' statement not in loop or switch statement}}
70 continue; // expected-error {{'continue' statement not in loop statement}}
77 #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
78 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
80 goto L2
; // expected-error {{use of undeclared label 'L2'}}
88 return 1; // expected-error {{cannot return from OpenMP region}}
91 [[]] // expected-error {{an attribute list cannot appear here}}
94 for (int n
= 0; n
< 100; ++n
) {}