diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-26 08:21:58 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-26 08:21:58 +0000 |
commit | 1e0498a92d6e09d01c791a7f32299de6c8e02cac (patch) | |
tree | 80b5da2548f93a8a8f193b07da7851a496adb24d /clang/test/OpenMP/sections_misc_messages.c | |
parent | 07910d6ab548e7a57717af7e28d994cd652fd75d (diff) | |
download | bcm5719-llvm-1e0498a92d6e09d01c791a7f32299de6c8e02cac.tar.gz bcm5719-llvm-1e0498a92d6e09d01c791a7f32299de6c8e02cac.zip |
[OPENMP] Initial parsing and sema analysis for 'section' directive.
llvm-svn: 211767
Diffstat (limited to 'clang/test/OpenMP/sections_misc_messages.c')
-rw-r--r-- | clang/test/OpenMP/sections_misc_messages.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/OpenMP/sections_misc_messages.c b/clang/test/OpenMP/sections_misc_messages.c index e8aa5e28c0e..977d154156f 100644 --- a/clang/test/OpenMP/sections_misc_messages.c +++ b/clang/test/OpenMP/sections_misc_messages.c @@ -18,6 +18,13 @@ void test_no_clause() { // expected-error@+2 {{the statement for '#pragma omp sections' must be a compound statement}} #pragma omp sections ++i; + +#pragma omp sections + { + foo(); + foo(); // expected-error {{statement in 'omp sections' directive must be enclosed into a section region}} + } + } void test_branch_protected_scope() { @@ -40,12 +47,24 @@ L1: L2: x[i]++; } +#pragma omp section + if (i == 5) + goto L1; // expected-error {{use of undeclared label 'L1'}} + else if (i == 6) + return; // expected-error {{cannot return from OpenMP region}} + else if (i == 7) + goto L3; + else if (i == 8) { + L3: + x[i]++; + } } if (x[0] == 0) goto L2; // expected-error {{use of undeclared label 'L2'}} else if (x[1] == 1) goto L1; + goto L3; // expected-error {{use of undeclared label 'L3'}} } void test_invalid_clause() { @@ -55,6 +74,9 @@ void test_invalid_clause() { #pragma omp sections foo bar { foo(); +// expected-error@+1 {{unexpected OpenMP clause 'nowait' in directive '#pragma omp section'}} +#pragma omp section nowait + ; } } |