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