Index: cfe/trunk/include/clang/Basic/OpenMPKinds.def =================================================================== --- cfe/trunk/include/clang/Basic/OpenMPKinds.def +++ cfe/trunk/include/clang/Basic/OpenMPKinds.def @@ -375,6 +375,7 @@ OPENMP_TARGET_EXIT_DATA_CLAUSE(if) OPENMP_TARGET_EXIT_DATA_CLAUSE(device) OPENMP_TARGET_EXIT_DATA_CLAUSE(map) +OPENMP_TARGET_EXIT_DATA_CLAUSE(nowait) // Clauses allowed for OpenMP directive 'teams'. // TODO More clauses for 'teams' directive. Index: cfe/trunk/test/OpenMP/target_exit_data_ast_print.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_exit_data_ast_print.cpp +++ cfe/trunk/test/OpenMP/target_exit_data_ast_print.cpp @@ -27,6 +27,22 @@ #pragma omp target exit data map(always,release: e) +#pragma omp target exit data nowait map(from: i) + +#pragma omp target exit data nowait map(from: i) if (target exit data: j > 0) + +#pragma omp target exit data map(from: i) if (b) nowait + +#pragma omp target exit data map(from: c) nowait + +#pragma omp target exit data map(from: c) nowait if(b>e) + +#pragma omp target exit data nowait map(release: x[0:10], c) + +#pragma omp target exit data nowait map(from: c) map(release: d) + +#pragma omp target exit data nowait map(always,release: e) + return 0; } @@ -41,6 +57,14 @@ // CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c) // CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d) // CHECK-NEXT: #pragma omp target exit data map(always,release: e) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0) +// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e) +// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d) +// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e) // CHECK: template char tmain(char argc, char *argv) { // CHECK-NEXT: char i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; @@ -52,6 +76,14 @@ // CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c) // CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d) // CHECK-NEXT: #pragma omp target exit data map(always,release: e) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0) +// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e) +// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d) +// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e) // CHECK: template T tmain(T argc, T *argv) { // CHECK-NEXT: T i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; @@ -63,6 +95,14 @@ // CHECK-NEXT: #pragma omp target exit data map(release: x[0:10],c) // CHECK-NEXT: #pragma omp target exit data map(from: c) map(release: d) // CHECK-NEXT: #pragma omp target exit data map(always,release: e) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: i) if(target exit data: j > 0) +// CHECK-NEXT: #pragma omp target exit data map(from: i) if(b) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait if(b > e) +// CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d) +// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e) int main (int argc, char **argv) { int b = argc, c, d, e, f, g, x[20]; @@ -94,6 +134,30 @@ #pragma omp target exit data map(always,release: e) // CHECK-NEXT: #pragma omp target exit data map(always,release: e) +#pragma omp target exit data nowait map(from: a) +// CHECK: #pragma omp target exit data nowait map(from: a) + +#pragma omp target exit data nowait map(from: a) if (target exit data: b) +// CHECK: #pragma omp target exit data nowait map(from: a) if(target exit data: b) + +#pragma omp target exit data map(from: a) if (b > g) nowait +// CHECK: #pragma omp target exit data map(from: a) if(b > g) nowait + +#pragma omp target exit data map(from: c) nowait +// CHECK-NEXT: #pragma omp target exit data map(from: c) nowait + +#pragma omp target exit data map(release: c) nowait if(b>g) +// CHECK-NEXT: #pragma omp target exit data map(release: c) nowait if(b > g) + +#pragma omp target exit data nowait map(from: x[0:10], c) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: x[0:10],c) + +#pragma omp target exit data nowait map(from: c) map(release: d) +// CHECK-NEXT: #pragma omp target exit data nowait map(from: c) map(release: d) + +#pragma omp target exit data nowait map(always,release: e) +// CHECK-NEXT: #pragma omp target exit data nowait map(always,release: e) + return tmain(argc, &argc) + tmain(argv[0][0], argv[0]); } Index: cfe/trunk/test/OpenMP/target_exit_data_nowait_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_exit_data_nowait_messages.cpp +++ cfe/trunk/test/OpenMP/target_exit_data_nowait_messages.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s + +int main(int argc, char **argv) { + int i; + + #pragma omp nowait target exit data map(from: i) // expected-error {{expected an OpenMP directive}} + #pragma omp target nowait exit data map(from: i) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}} + #pragma omp target exit nowait data map(from: i) // expected-error {{expected an OpenMP directive}} + #pragma omp target exit data nowait() map(from: i) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} expected-error {{expected at least one map clause for '#pragma omp target exit data'}} + #pragma omp target exit data map(from: i) nowait( // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} + #pragma omp target exit data map(from: i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} + #pragma omp target exit data map(from: i) nowait device (-10u) + #pragma omp target exit data map(from: i) nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} + #pragma omp target exit data map(from: i) nowait nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}} + #pragma omp target exit data nowait map(from: i) nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}} + return 0; +}