Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: test/NaCl/PNaClABI/types.ll

Issue 221693002: PNaCl: Add support for GCC/LLVM vector extensions (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Address dschuff's comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; RUN: not pnacl-abicheck < %s | FileCheck %s 1 ; RUN: not pnacl-abicheck < %s | FileCheck %s
2 ; Test types allowed by PNaCl ABI 2 ; Test types allowed by PNaCl ABI
3 3
4 4
5 ; CHECK: Function badReturn has disallowed type: half* () 5 ; CHECK: Function badReturn has disallowed type: half* ()
6 define internal half* @badReturn() { 6 define internal half* @badReturn() {
7 unreachable 7 unreachable
8 } 8 }
9 9
10 ; CHECK: Function badArgType1 has disallowed type: void (half, i32) 10 ; CHECK: Function badArgType1 has disallowed type: void (half, i32)
11 define internal void @badArgType1(half %a, i32 %b) { 11 define internal void @badArgType1(half %a, i32 %b) {
12 ret void 12 ret void
13 } 13 }
14 ; CHECK: Function badArgType2 has disallowed type: void (i32, half) 14 ; CHECK: Function badArgType2 has disallowed type: void (i32, half)
15 define internal void @badArgType2(i32 %a, half %b) { 15 define internal void @badArgType2(i32 %a, half %b) {
16 ret void 16 ret void
17 } 17 }
18 18
19 19
20 define internal void @func() { 20 define internal void @func() {
21 entry: 21 entry:
22 br label %block 22 br label %block
23 block: 23 block:
24 24
25 ; We test for allowed/disallowed types via phi nodes. This gives us 25 ; We test for allowed/disallowed types via phi nodes. This gives us
26 ; a uniform way to test any type. 26 ; a uniform way to test any type.
27 27
28 ; Allowed types 28 ; Allowed types
29 29
30 ; Scalars.
30 phi i1 [ undef, %entry ] 31 phi i1 [ undef, %entry ]
31 phi i8 [ undef, %entry ] 32 phi i8 [ undef, %entry ]
32 phi i16 [ undef, %entry ] 33 phi i16 [ undef, %entry ]
33 phi i32 [ undef, %entry ] 34 phi i32 [ undef, %entry ]
34 phi i64 [ undef, %entry ] 35 phi i64 [ undef, %entry ]
35 phi float [ undef, %entry ] 36 phi float [ undef, %entry ]
36 phi double [ undef, %entry ] 37 phi double [ undef, %entry ]
38 ; Vectors.
39 phi <4 x i1> [ undef, %entry ]
40 phi <8 x i1> [ undef, %entry ]
41 phi <16 x i1> [ undef, %entry ]
42 phi <16 x i8> [ undef, %entry ]
43 phi <8 x i16> [ undef, %entry ]
44 phi <4 x i32> [ undef, %entry ]
45 phi <4 x float> [ undef, %entry ]
37 ; CHECK-NOT: disallowed 46 ; CHECK-NOT: disallowed
38 47
39 48
40 ; Disallowed integer types 49 ; Disallowed integer types
41 50
42 phi i4 [ undef, %entry ] 51 phi i4 [ undef, %entry ]
43 ; CHECK: Function func disallowed: bad operand: {{.*}} i4 52 ; CHECK: Function func disallowed: bad operand: {{.*}} i4
44 53
45 phi i33 [ undef, %entry ] 54 phi i33 [ undef, %entry ]
46 ; CHECK-NEXT: disallowed: bad operand: {{.*}} i33 55 ; CHECK-NEXT: disallowed: bad operand: {{.*}} i33
(...skipping 30 matching lines...) Expand all
77 86
78 phi { i32, float } [ undef, %entry ] 87 phi { i32, float } [ undef, %entry ]
79 ; CHECK-NEXT: disallowed: bad operand: {{.*}} { i32, float } 88 ; CHECK-NEXT: disallowed: bad operand: {{.*}} { i32, float }
80 89
81 phi void (i32)* [ undef, %entry ] 90 phi void (i32)* [ undef, %entry ]
82 ; CHECK-NEXT: disallowed: bad operand: {{.*}} void (i32)* 91 ; CHECK-NEXT: disallowed: bad operand: {{.*}} void (i32)*
83 92
84 phi <{ i8, i32 }> [ undef, %entry ] 93 phi <{ i8, i32 }> [ undef, %entry ]
85 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <{ i8, i32 }> 94 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <{ i8, i32 }>
86 95
87 ; Vector types are disallowed 96 ; Vector types of weird bit width are disallowed
97 phi <1 x i1> [ undef, %entry ]
98 phi <3 x i1> [ undef, %entry ]
99 phi <17 x i1> [ undef, %entry ]
100 phi <1 x i32> [ undef, %entry ]
88 phi <2 x i32> [ undef, %entry ] 101 phi <2 x i32> [ undef, %entry ]
102 phi <3 x i32> [ undef, %entry ]
103 phi <5 x i32> [ undef, %entry ]
104 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <1 x i1>
105 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <3 x i1>
106 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <17 x i1>
107 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <1 x i32>
89 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <2 x i32> 108 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <2 x i32>
109 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <3 x i32>
110 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <5 x i32>
111
112 ; i64 and double vectors are currently disallowed, and so are the
113 ; corresponding bool vectors.
114 phi <2 x i1> [ undef, %entry ]
115 phi <2 x i64> [ undef, %entry ]
116 phi <2 x double> [ undef, %entry ]
117 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <2 x i1>
118 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <2 x i64>
119 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <2 x double>
120
121 ; 256-bit width vectors are currently disallowed, and so are the
122 ; corresponding bool vectors.
123 phi <32 x i1> [ undef, %entry ]
124 phi <32 x i8> [ undef, %entry ]
125 phi <16 x i16> [ undef, %entry ]
126 phi <8 x i32> [ undef, %entry ]
127 phi <4 x i64> [ undef, %entry ]
128 phi <8 x float> [ undef, %entry ]
129 phi <4 x double> [ undef, %entry ]
130 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <32 x i1>
131 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <32 x i8>
132 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <16 x i16>
133 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <8 x i32>
134 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <4 x i64>
135 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <8 x float>
136 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <4 x double>
137
138 ; 512-bit width vectors are currently disallowed, and so are the
139 ; corresponding bool vectors.
140 phi <64 x i1> [ undef, %entry ]
141 phi <64 x i8> [ undef, %entry ]
142 phi <32 x i16> [ undef, %entry ]
143 phi <16 x i32> [ undef, %entry ]
144 phi <8 x i64> [ undef, %entry ]
145 phi <16 x float> [ undef, %entry ]
146 phi <8 x double> [ undef, %entry ]
147 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <64 x i1>
148 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <64 x i8>
149 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <32 x i16>
150 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <16 x i32>
151 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <8 x i64>
152 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <16 x float>
153 ; CHECK-NEXT: disallowed: bad operand: {{.*}} <8 x double>
90 154
91 ret void 155 ret void
92 } 156 }
93 157
94 158
95 ; Named types. With the current implementation, named types are legal 159 ; Named types. With the current implementation, named types are legal
96 ; until they are actually attempted to be used. Might want to fix that. 160 ; until they are actually attempted to be used. Might want to fix that.
97 %struct.s1 = type { half, float} 161 %struct.s1 = type { half, float}
98 %struct.s2 = type { i32, i32} 162 %struct.s2 = type { i32, i32}
99 163
(...skipping 27 matching lines...) Expand all
127 block: 191 block:
128 192
129 phi %struct.snake [ undef, %entry ] 193 phi %struct.snake [ undef, %entry ]
130 ; CHECK: disallowed: bad operand: {{.*}} %struct.snake 194 ; CHECK: disallowed: bad operand: {{.*}} %struct.snake
131 195
132 phi %struct.linked [ undef, %entry ] 196 phi %struct.linked [ undef, %entry ]
133 ; CHECK-NEXT: disallowed: bad operand: {{.*}} %struct.linked 197 ; CHECK-NEXT: disallowed: bad operand: {{.*}} %struct.linked
134 198
135 ret void 199 ret void
136 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698