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