1 // RUN: %clang_cc1 -std=c++11 -verify %s 2 3 // Note that this puts the expected lines before the directives to work around 4 // limitations in the -verify mode. 5 test(int * List,int Length)6void test(int *List, int Length) { 7 int i = 0; 8 9 #pragma clang loop vectorize(assume_safety) 10 #pragma clang loop interleave(assume_safety) 11 while (i + 1 < Length) { 12 List[i] = i; 13 } 14 15 /* expected-error {{expected ')'}} */ #pragma clang loop vectorize(assume_safety 16 /* expected-error {{expected ')'}} */ #pragma clang loop interleave(assume_safety 17 18 /* expected-error {{invalid argument; expected 'enable', 'full' or 'disable'}} */ #pragma clang loop unroll(assume_safety) 19 20 /* expected-error {{invalid argument; expected 'enable', 'assume_safety' or 'disable'}} */ #pragma clang loop vectorize(badidentifier) 21 /* expected-error {{invalid argument; expected 'enable', 'assume_safety' or 'disable'}} */ #pragma clang loop interleave(badidentifier) 22 /* expected-error {{invalid argument; expected 'enable', 'full' or 'disable'}} */ #pragma clang loop unroll(badidentifier) 23 while (i-7 < Length) { 24 List[i] = i; 25 } 26 27 /* expected-error {{duplicate directives 'vectorize(assume_safety)' and 'vectorize(enable)'}} */ #pragma clang loop vectorize(enable) 28 #pragma clang loop vectorize(assume_safety) 29 /* expected-error {{duplicate directives 'interleave(assume_safety)' and 'interleave(enable)'}} */ #pragma clang loop interleave(enable) 30 #pragma clang loop interleave(assume_safety) 31 while (i-9 < Length) { 32 List[i] = i; 33 } 34 } 35