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