annotate clang/test/Parser/pragma-loop-safety.cpp @ 150:1d019706d866

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