1 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized 2 3 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized 4 foo()5void foo() { 6 } 7 foobool(int argc)8bool foobool(int argc) { 9 return argc; 10 } 11 12 struct S1; // expected-note {{declared here}} 13 main(int argc,char ** argv)14int main(int argc, char **argv) { 15 int i, z; 16 #pragma omp target enter data map(to: i) device // expected-error {{expected '(' after 'device'}} 17 #pragma omp target enter data map(to: i) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} 18 #pragma omp target enter data map(to: i) device () // expected-error {{expected expression}} 19 #pragma omp target enter data map(to: i) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} 20 #pragma omp target enter data map(to: i) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} 21 #pragma omp target enter data map(to: i) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}} 22 #pragma omp target enter data map(to: i) device (argc +z + argc ) 23 #pragma omp target enter data map(to: i) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'device' clause}} 24 #pragma omp target enter data map(to: i) device (S1) // expected-error {{'S1' does not refer to a value}} 25 #pragma omp target enter data map(to: i) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}} 26 #pragma omp target enter data map(to: i) device (-10u) 27 #pragma omp target enter data map(to: i) device (device_num: -10u) // expected-error {{use of undeclared identifier 'device_num'}} expected-error {{expected ')'}} expected-note {{to match this '('}} 28 #pragma omp target enter data map(to: i) device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}} 29 foo(); 30 31 return 0; 32 } 33