1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
2 // RUN: not %clang_cc1 -fopenmp -std=c++11 -fopenmp-targets=aaa-bbb-ccc-ddd -o - %s 2>&1 | FileCheck %s
3 // CHECK: error: OpenMP target is invalid: 'aaa-bbb-ccc-ddd'
4 // RUN: not %clang_cc1 -fopenmp -std=c++11 -triple nvptx64-nvidia-cuda -o - %s 2>&1 | FileCheck --check-prefix CHECK-UNSUPPORTED-HOST-TARGET %s
5 // RUN: not %clang_cc1 -fopenmp -std=c++11 -triple nvptx-nvidia-cuda -o - %s 2>&1 | FileCheck --check-prefix CHECK-UNSUPPORTED-HOST-TARGET %s
6 // CHECK-UNSUPPORTED-HOST-TARGET: error: The target '{{nvptx64-nvidia-cuda|nvptx-nvidia-cuda}}' is not a supported OpenMP host target.
11 #pragma omp target // expected-error {{unexpected OpenMP directive '#pragma omp target'}}
13 int main(int argc, char **argv) {
14 #pragma omp target { // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
16 #pragma omp target ( // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
18 #pragma omp target [ // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
20 #pragma omp target ] // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
22 #pragma omp target ) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
24 #pragma omp target } // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
28 // expected-warning@+1 {{extra tokens at the end of '#pragma omp target' are ignored}}
29 #pragma omp target unknown()
37 goto L1; // expected-error {{use of undeclared label 'L1'}}
41 for (int i = 0; i < 10; ++i) {
47 break; // expected-error {{'break' statement not in loop or switch statement}}
48 continue; // expected-error {{'continue' statement not in loop statement}}
55 goto L2; // expected-error {{use of undeclared label 'L2'}}
61 return 1; // expected-error {{cannot return from OpenMP region}}
64 [[]] // expected-error {{an attribute list cannot appear here}}
66 for (int n = 0; n < 100; ++n) {}