Index: cfe/trunk/include/clang/Basic/OpenMPKinds.def =================================================================== --- cfe/trunk/include/clang/Basic/OpenMPKinds.def +++ cfe/trunk/include/clang/Basic/OpenMPKinds.def @@ -454,6 +454,7 @@ OPENMP_TARGET_UPDATE_CLAUSE(device) OPENMP_TARGET_UPDATE_CLAUSE(to) OPENMP_TARGET_UPDATE_CLAUSE(from) +OPENMP_TARGET_UPDATE_CLAUSE(nowait) // Clauses allowed for OpenMP directive 'teams'. // TODO More clauses for 'teams' directive. Index: cfe/trunk/test/OpenMP/target_update_ast_print.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_update_ast_print.cpp +++ cfe/trunk/test/OpenMP/target_update_ast_print.cpp @@ -13,26 +13,26 @@ static T a; U b; int l; -#pragma omp target update to(a) if(l>5) device(l) +#pragma omp target update to(a) if(l>5) device(l) nowait -#pragma omp target update from(b) if(l<5) device(l-1) +#pragma omp target update from(b) if(l<5) device(l-1) nowait return a + targ + (T)b; } // CHECK: static int a; // CHECK-NEXT: float b; // CHECK-NEXT: int l; // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) -// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) +// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait // CHECK: static char a; // CHECK-NEXT: float b; // CHECK-NEXT: int l; -// CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) -// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) +// CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait +// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait // CHECK: static T a; // CHECK-NEXT: U b; // CHECK-NEXT: int l; -// CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) -// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) +// CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait +// CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait int main(int argc, char **argv) { static int a; @@ -42,10 +42,10 @@ // CHECK: static int a; // CHECK-NEXT: int n; // CHECK-NEXT: float f; -#pragma omp target update to(a) if(f>0.0) device(n) - // CHECK-NEXT: #pragma omp target update to(a) if(f > 0.) device(n) -#pragma omp target update from(f) if(f<0.0) device(n+1) - // CHECK-NEXT: #pragma omp target update from(f) if(f < 0.) device(n + 1) +#pragma omp target update to(a) if(f>0.0) device(n) nowait +// CHECK-NEXT: #pragma omp target update to(a) if(f > 0.) device(n) nowait +#pragma omp target update from(f) if(f<0.0) device(n+1) nowait +// CHECK-NEXT: #pragma omp target update from(f) if(f < 0.) device(n + 1) nowait return foo(argc, f) + foo(argv[0][0], f) + a; } Index: cfe/trunk/test/OpenMP/target_update_nowait_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_update_nowait_messages.cpp +++ cfe/trunk/test/OpenMP/target_update_nowait_messages.cpp @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +int main(int argc, char **argv) { + int i; + + #pragma omp nowait target update to(i) // expected-error {{expected an OpenMP directive}} + #pragma omp target nowait update to(i) // expected-error {{unexpected OpenMP clause 'update' in directive '#pragma omp target'}} expected-error {{unexpected OpenMP clause 'to' in directive '#pragma omp target'}} + {} + #pragma omp target update nowait() to(i) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} + #pragma omp target update to(i) nowait( // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} + #pragma omp target update to(i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} + #pragma omp target update to(i) nowait device (-10u) + #pragma omp target update to(i) nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} + #pragma omp target update to(i) nowait nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}} + #pragma omp target update nowait to(i) nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}} + return 0; +}