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