2015-06-12 07:23:17 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -verify %s
|
|
|
|
|
|
|
|
// Note that this puts the expected lines before the directives to work around
|
|
|
|
// limitations in the -verify mode.
|
|
|
|
|
|
|
|
void test(int *List, int Length) {
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
#pragma clang loop vectorize(assume_safety)
|
|
|
|
#pragma clang loop interleave(assume_safety)
|
|
|
|
while (i + 1 < Length) {
|
|
|
|
List[i] = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* expected-error {{expected ')'}} */ #pragma clang loop vectorize(assume_safety
|
|
|
|
/* expected-error {{expected ')'}} */ #pragma clang loop interleave(assume_safety
|
|
|
|
|
2015-08-11 01:29:39 +08:00
|
|
|
/* expected-error {{invalid argument; expected 'enable', 'full' or 'disable'}} */ #pragma clang loop unroll(assume_safety)
|
2016-06-14 20:04:26 +08:00
|
|
|
/* expected-error {{invalid argument; expected 'enable' or 'disable'}} */ #pragma clang loop distribute(assume_safety)
|
2015-06-12 07:23:17 +08:00
|
|
|
|
|
|
|
/* expected-error {{invalid argument; expected 'enable', 'assume_safety' or 'disable'}} */ #pragma clang loop vectorize(badidentifier)
|
|
|
|
/* expected-error {{invalid argument; expected 'enable', 'assume_safety' or 'disable'}} */ #pragma clang loop interleave(badidentifier)
|
2015-08-11 01:29:39 +08:00
|
|
|
/* expected-error {{invalid argument; expected 'enable', 'full' or 'disable'}} */ #pragma clang loop unroll(badidentifier)
|
2015-06-12 07:23:17 +08:00
|
|
|
while (i-7 < Length) {
|
|
|
|
List[i] = i;
|
|
|
|
}
|
|
|
|
|
2018-08-03 09:21:16 +08:00
|
|
|
#pragma clang loop vectorize(enable)
|
|
|
|
/* expected-error {{duplicate directives 'vectorize(enable)' and 'vectorize(assume_safety)'}} */ #pragma clang loop vectorize(assume_safety)
|
|
|
|
#pragma clang loop interleave(enable)
|
|
|
|
/* expected-error {{duplicate directives 'interleave(enable)' and 'interleave(assume_safety)'}} */ #pragma clang loop interleave(assume_safety)
|
2015-06-12 07:23:17 +08:00
|
|
|
while (i-9 < Length) {
|
|
|
|
List[i] = i;
|
|
|
|
}
|
|
|
|
}
|