diff --git a/clang/include/clang/Basic/OpenMPKinds.def b/clang/include/clang/Basic/OpenMPKinds.def index a57d34ca497c..d56770a94342 100644 --- a/clang/include/clang/Basic/OpenMPKinds.def +++ b/clang/include/clang/Basic/OpenMPKinds.def @@ -355,6 +355,7 @@ OPENMP_TARGET_CLAUSE(if) OPENMP_TARGET_CLAUSE(device) OPENMP_TARGET_CLAUSE(map) OPENMP_TARGET_CLAUSE(private) +OPENMP_TARGET_CLAUSE(nowait) // Clauses allowed for OpenMP directive 'target data'. // TODO More clauses for 'target data' directive. diff --git a/clang/test/OpenMP/target_ast_print.cpp b/clang/test/OpenMP/target_ast_print.cpp index acf032a22120..13d14736babb 100644 --- a/clang/test/OpenMP/target_ast_print.cpp +++ b/clang/test/OpenMP/target_ast_print.cpp @@ -25,6 +25,8 @@ T tmain(T argc, T *argv) { foo(); #pragma omp target map(always,alloc: i) foo(); +#pragma omp target nowait + foo(); return 0; } @@ -44,6 +46,8 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(always,alloc: i) // CHECK-NEXT: foo() +// CHECK-NEXT: #pragma omp target nowait +// CHECK-NEXT: foo() // CHECK: template char tmain(char argc, char *argv) { // CHECK-NEXT: char i, j, a[20] // CHECK-NEXT: #pragma omp target @@ -60,6 +64,8 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(always,alloc: i) // CHECK-NEXT: foo() +// CHECK-NEXT: #pragma omp target nowait +// CHECK-NEXT: foo() // CHECK: template T tmain(T argc, T *argv) { // CHECK-NEXT: T i, j, a[20] // CHECK-NEXT: #pragma omp target @@ -76,6 +82,8 @@ T tmain(T argc, T *argv) { // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(always,alloc: i) // CHECK-NEXT: foo() +// CHECK-NEXT: #pragma omp target nowait +// CHECK-NEXT: foo() // CHECK-LABEL: int main(int argc, char **argv) { int main (int argc, char **argv) { @@ -115,6 +123,11 @@ int main (int argc, char **argv) { foo(); // CHECK-NEXT: foo(); +#pragma omp target nowait +// CHECK-NEXT: #pragma omp target nowait + foo(); +// CHECK-NEXT: foo(); + return tmain(argc, &argc) + tmain(argv[0][0], argv[0]); } diff --git a/clang/test/OpenMP/target_nowait_messages.cpp b/clang/test/OpenMP/target_nowait_messages.cpp new file mode 100644 index 000000000000..7531c81c0f6a --- /dev/null +++ b/clang/test/OpenMP/target_nowait_messages.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s + +void foo() { +} + +int main(int argc, char **argv) { + #pragma omp target nowait( // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}} + foo(); + #pragma omp target nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}} + foo(); + #pragma omp target nowait device (-10u) + foo(); + #pragma omp target nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}} + foo(); + + return 0; +}