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 | 0eca5e96c1b22228c8efe6a99df123186bfb340b (patch) | |
tree | 3eda9832f1dff4a048c29baecbb63a641818fc94 /test/OpenMP/sections_misc_messages.c | |
parent | a7e2b09e84da88716b148b4042164e7b321aa13d (diff) |
[OPENMP] Initial parsing and sema analysis for 'section' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/sections_misc_messages.c')
-rw-r--r-- | test/OpenMP/sections_misc_messages.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/OpenMP/sections_misc_messages.c b/test/OpenMP/sections_misc_messages.c index e8aa5e28c0..977d154156 100644 --- a/test/OpenMP/sections_misc_messages.c +++ b/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 + ; } } |