blob: 292b6e161aebae99848602c00c5cc3bac946182d [file] [log] [blame]
Alexey Bataeva9148882019-07-08 15:45:24 +00001// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
Kelvin Libf594a52016-12-17 05:48:59 +00002
Alexey Bataeva9148882019-07-08 15:45:24 +00003// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
Alexey Bataeva8a9153a2017-12-29 18:07:07 +00004
Kelvin Libf594a52016-12-17 05:48:59 +00005void 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) {
Alexey Bataeva9148882019-07-08 15:45:24 +000015 int z;
Kelvin Libf594a52016-12-17 05:48:59 +000016#pragma omp target teams device // expected-error {{expected '(' after 'device'}}
17 foo();
18#pragma omp target teams device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
19 foo();
20#pragma omp target teams device () // expected-error {{expected expression}}
21 foo();
22#pragma omp target teams device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
23 foo();
24#pragma omp target teams device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
25 foo();
26#pragma omp target teams device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
27 foo();
Alexey Bataeva9148882019-07-08 15:45:24 +000028#pragma omp target teams device (argc + argc + z)
Kelvin Libf594a52016-12-17 05:48:59 +000029 foo();
30#pragma omp target teams device (argc), device (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'device' clause}}
31 foo();
32#pragma omp target teams device (S1) // expected-error {{'S1' does not refer to a value}}
33 foo();
34#pragma omp target teams device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
35 foo();
36#pragma omp target teams device (-10u)
37 foo();
38#pragma omp target teams device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
39 foo();
40
41 return 0;
42}