diff options
author | Tom Stellard <tstellar@redhat.com> | 2017-11-13 23:52:05 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2017-11-13 23:52:05 +0000 |
commit | 4958d4c0de2f137e6dc83a9efccaa84433091051 (patch) | |
tree | 41761f5c42f6564d11ed5c3fd4d37720ab206052 /test/OpenMP/ordered_messages.cpp | |
parent | 7751fc0fb489255c904e0df675fe311bc33cbef5 (diff) |
Merging r313675:
------------------------------------------------------------------------
r313675 | rcraik | 2017-09-19 14:04:23 -0700 (Tue, 19 Sep 2017) | 9 lines
[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values
When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec):
1) The iteration vector vec contains less than n items
2) The iteration vector vec contains a variable that is not a loop control variable
This patch addresses both of these issues.
Differential Revision: https://reviews.llvm.org/D38049
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@318116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/ordered_messages.cpp')
-rw-r--r-- | test/OpenMP/ordered_messages.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/OpenMP/ordered_messages.cpp b/test/OpenMP/ordered_messages.cpp index eb2c18e469..2e3d55ca83 100644 --- a/test/OpenMP/ordered_messages.cpp +++ b/test/OpenMP/ordered_messages.cpp @@ -270,5 +270,13 @@ int k; } } +#pragma omp for ordered(2) // expected-note {{as specified in 'ordered' clause}} + for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}} +#pragma omp ordered depend(sink : i) + int j; +#pragma omp ordered depend(sink : i, j) // expected-error {{expected loop iteration variable}} + foo(); + } + return foo<int>(); // expected-note {{in instantiation of function template specialization 'foo<int>' requested here}} } |