diff options
author | Tyler Nowicki <tnowicki@apple.com> | 2014-07-31 20:15:14 +0000 |
---|---|---|
committer | Tyler Nowicki <tnowicki@apple.com> | 2014-07-31 20:15:14 +0000 |
commit | 0c9b34b3ec40f548d2e9eeac7f51731137f18463 (patch) | |
tree | f2fe55be4afe976e2e23fd24b4f28cf357d93eea /clang/test/Parser/pragma-loop.cpp | |
parent | 18fab4684d15da6627cb3b92d6a8ad4999a3361d (diff) | |
download | bcm5719-llvm-0c9b34b3ec40f548d2e9eeac7f51731137f18463.tar.gz bcm5719-llvm-0c9b34b3ec40f548d2e9eeac7f51731137f18463.zip |
Add a state variable to the loop hint attribute.
This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.
Resubmit with changes to try to fix the build-bot issue.
Reviewed by Aaron Ballman
llvm-svn: 214432
Diffstat (limited to 'clang/test/Parser/pragma-loop.cpp')
-rw-r--r-- | clang/test/Parser/pragma-loop.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Parser/pragma-loop.cpp b/clang/test/Parser/pragma-loop.cpp index ac07af9bc77..742a5d71e01 100644 --- a/clang/test/Parser/pragma-loop.cpp +++ b/clang/test/Parser/pragma-loop.cpp @@ -83,6 +83,9 @@ void test(int *List, int Length) { List[i] = i; } +/* expected-error {{expected ')'}} */ #pragma clang loop vectorize_width(1 +) 1 +/* expected-warning {{extra tokens at end of '#pragma clang loop'}} */ #pragma clang loop vectorize_width(1) +1 + /* expected-error {{invalid argument; expected a positive integer value}} */ #pragma clang loop vectorize_width(badvalue) /* expected-error {{invalid argument; expected a positive integer value}} */ #pragma clang loop interleave_count(badvalue) /* expected-error {{invalid argument; expected a positive integer value}} */ #pragma clang loop unroll_count(badvalue) |