1 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp45 -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
2 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp51 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
4 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
5 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp51 -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
10 bool foobool(int argc
) {
14 struct S1
; // expected-note {{declared here}}
16 int main(int argc
, char **argv
) {
18 #pragma omp target device // expected-error {{expected '(' after 'device'}}
20 #pragma omp target device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
22 #pragma omp target device () // expected-error {{expected expression}}
24 #pragma omp target device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
26 #pragma omp target device (argc: // expected-error {{expected ')'}} expected-note {{to match this '('}} omp51-error {{expected expression}}
28 #pragma omp target device (z-argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
30 #pragma omp target device (device_num : argc > 0 ? argv[1] : argv[2]) // omp45-error {{use of undeclared identifier 'device_num'}} omp45-error {{expected ')'}} omp45-note {{to match this '('}} omp51-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
32 #pragma omp target device (argc: argc + argc) // omp45-error {{expected ')'}} omp45-note {{to match this '('}} omp51-error {{expected 'ancestor' or 'device_num' in OpenMP clause 'device'}}
34 #pragma omp target device (argc), device (argc+1) // expected-error {{directive '#pragma omp target' cannot contain more than one 'device' clause}}
36 #pragma omp target device (S1) // expected-error {{'S1' does not refer to a value}}
38 #pragma omp target device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
40 #pragma omp target device (-10u)
42 #pragma omp target device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
44 #pragma omp target device (ancestor) // expected-error {{use of undeclared identifier 'ancestor'}}