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

Side by Side Diff: tests_lit/llvm2ice_tests/convert.ll

Issue 914263005: Subzero: switch from llvm-objdump to objdump for lit tests (for LLVM merge) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 10 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 ; Simple test of signed and unsigned integer conversions. 1 ; Simple test of signed and unsigned integer conversions.
2 2
3 ; TODO(jvoung): llvm-objdump doesn't symbolize global symbols well, so we 3 ; TODO(jvoung): llvm-objdump doesn't symbolize global symbols well, so we
4 ; have [0] == i8v, [2] == i16v, [4] == i32v, [8] == i64v, etc. 4 ; have [0] == i8v, [2] == i16v, [4] == i32v, [8] == i64v, etc.
5 5
6 ; RUN: %p2i -i %s --args -O2 --verbose none \ 6 ; RUN: %p2i --assemble --disassemble -i %s --args -O2 --verbose none \
7 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ 7 ; RUN: | FileCheck %s
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s 8 ; RUN: %p2i --assemble --disassemble -i %s --args -Om1 --verbose none \
9 ; RUN: %p2i -i %s --args -Om1 --verbose none \ 9 ; RUN: | FileCheck %s
10 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \
11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
12 10
13 @i8v = internal global [1 x i8] zeroinitializer, align 1 11 @i8v = internal global [1 x i8] zeroinitializer, align 1
14 @i16v = internal global [2 x i8] zeroinitializer, align 2 12 @i16v = internal global [2 x i8] zeroinitializer, align 2
15 @i32v = internal global [4 x i8] zeroinitializer, align 4 13 @i32v = internal global [4 x i8] zeroinitializer, align 4
16 @i64v = internal global [8 x i8] zeroinitializer, align 8 14 @i64v = internal global [8 x i8] zeroinitializer, align 8
17 @u8v = internal global [1 x i8] zeroinitializer, align 1 15 @u8v = internal global [1 x i8] zeroinitializer, align 1
18 @u16v = internal global [2 x i8] zeroinitializer, align 2 16 @u16v = internal global [2 x i8] zeroinitializer, align 2
19 @u32v = internal global [4 x i8] zeroinitializer, align 4 17 @u32v = internal global [4 x i8] zeroinitializer, align 4
20 @u64v = internal global [8 x i8] zeroinitializer, align 8 18 @u64v = internal global [8 x i8] zeroinitializer, align 8
21 19
22 define void @from_int8() { 20 define void @from_int8() {
23 entry: 21 entry:
24 %__0 = bitcast [1 x i8]* @i8v to i8* 22 %__0 = bitcast [1 x i8]* @i8v to i8*
25 %v0 = load i8* %__0, align 1 23 %v0 = load i8* %__0, align 1
26 %v1 = sext i8 %v0 to i16 24 %v1 = sext i8 %v0 to i16
27 %__3 = bitcast [2 x i8]* @i16v to i16* 25 %__3 = bitcast [2 x i8]* @i16v to i16*
28 store i16 %v1, i16* %__3, align 1 26 store i16 %v1, i16* %__3, align 1
29 %v2 = sext i8 %v0 to i32 27 %v2 = sext i8 %v0 to i32
30 %__5 = bitcast [4 x i8]* @i32v to i32* 28 %__5 = bitcast [4 x i8]* @i32v to i32*
31 store i32 %v2, i32* %__5, align 1 29 store i32 %v2, i32* %__5, align 1
32 %v3 = sext i8 %v0 to i64 30 %v3 = sext i8 %v0 to i64
33 %__7 = bitcast [8 x i8]* @i64v to i64* 31 %__7 = bitcast [8 x i8]* @i64v to i64*
34 store i64 %v3, i64* %__7, align 1 32 store i64 %v3, i64* %__7, align 1
35 ret void 33 ret void
36 } 34 }
37 ; CHECK-LABEL: from_int8 35 ; CHECK-LABEL: from_int8
38 ; CHECK: mov {{.*}}, byte ptr [ 36 ; CHECK: mov {{.*}},BYTE PTR [
39 ; CHECK: movsx e{{.*}}, {{[a-d]l|byte ptr}} 37 ; CHECK: movsx e{{.*}},{{[a-d]l|BYTE PTR}}
40 ; CHECK: mov word ptr [ 38 ; CHECK: mov word ptr [
41 ; CHECK: movsx 39 ; CHECK: movsx
42 ; CHECK: mov dword ptr [ 40 ; CHECK: mov DWORD PTR [
43 ; CHECK: movsx 41 ; CHECK: movsx
44 ; CHECK: sar {{.*}}, 31 42 ; CHECK: sar {{.*}}, 31
45 ; This appears to be a bug in llvm-mc. It should be i64v and i64+4. 43 ; This appears to be a bug in llvm-mc. It should be i64v and i64+4.
46 ; CHECK-DAG: [.bss] 44 ; CHECK-DAG: [.bss]
47 ; CHECK-DAG: [.bss] 45 ; CHECK-DAG: [.bss]
48 46
49 define void @from_int16() { 47 define void @from_int16() {
50 entry: 48 entry:
51 %__0 = bitcast [2 x i8]* @i16v to i16* 49 %__0 = bitcast [2 x i8]* @i16v to i16*
52 %v0 = load i16* %__0, align 1 50 %v0 = load i16* %__0, align 1
53 %v1 = trunc i16 %v0 to i8 51 %v1 = trunc i16 %v0 to i8
54 %__3 = bitcast [1 x i8]* @i8v to i8* 52 %__3 = bitcast [1 x i8]* @i8v to i8*
55 store i8 %v1, i8* %__3, align 1 53 store i8 %v1, i8* %__3, align 1
56 %v2 = sext i16 %v0 to i32 54 %v2 = sext i16 %v0 to i32
57 %__5 = bitcast [4 x i8]* @i32v to i32* 55 %__5 = bitcast [4 x i8]* @i32v to i32*
58 store i32 %v2, i32* %__5, align 1 56 store i32 %v2, i32* %__5, align 1
59 %v3 = sext i16 %v0 to i64 57 %v3 = sext i16 %v0 to i64
60 %__7 = bitcast [8 x i8]* @i64v to i64* 58 %__7 = bitcast [8 x i8]* @i64v to i64*
61 store i64 %v3, i64* %__7, align 1 59 store i64 %v3, i64* %__7, align 1
62 ret void 60 ret void
63 } 61 }
64 ; CHECK-LABEL: from_int16 62 ; CHECK-LABEL: from_int16
65 ; CHECK: mov {{.*}}, word ptr [ 63 ; CHECK: mov {{.*}},word ptr [
66 ; CHECK: [.bss] 64 ; CHECK: [.bss]
67 ; CHECK: movsx e{{.*}}, {{.*x|[ds]i|bp|word ptr}} 65 ; CHECK: movsx e{{.*}},{{.*x|[ds]i|bp|word ptr}}
68 ; CHECK: [.bss] 66 ; CHECK: [.bss]
69 ; CHECK: movsx e{{.*}}, {{.*x|[ds]i|bp|word ptr}} 67 ; CHECK: movsx e{{.*}},{{.*x|[ds]i|bp|word ptr}}
70 ; CHECK: sar {{.*}}, 31 68 ; CHECK: sar {{.*}}, 31
71 ; CHECK: [.bss] 69 ; CHECK: [.bss]
72 70
73 define void @from_int32() { 71 define void @from_int32() {
74 entry: 72 entry:
75 %__0 = bitcast [4 x i8]* @i32v to i32* 73 %__0 = bitcast [4 x i8]* @i32v to i32*
76 %v0 = load i32* %__0, align 1 74 %v0 = load i32* %__0, align 1
77 %v1 = trunc i32 %v0 to i8 75 %v1 = trunc i32 %v0 to i8
78 %__3 = bitcast [1 x i8]* @i8v to i8* 76 %__3 = bitcast [1 x i8]* @i8v to i8*
79 store i8 %v1, i8* %__3, align 1 77 store i8 %v1, i8* %__3, align 1
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 %v2 = zext i8 %v0 to i32 122 %v2 = zext i8 %v0 to i32
125 %__5 = bitcast [4 x i8]* @i32v to i32* 123 %__5 = bitcast [4 x i8]* @i32v to i32*
126 store i32 %v2, i32* %__5, align 1 124 store i32 %v2, i32* %__5, align 1
127 %v3 = zext i8 %v0 to i64 125 %v3 = zext i8 %v0 to i64
128 %__7 = bitcast [8 x i8]* @i64v to i64* 126 %__7 = bitcast [8 x i8]* @i64v to i64*
129 store i64 %v3, i64* %__7, align 1 127 store i64 %v3, i64* %__7, align 1
130 ret void 128 ret void
131 } 129 }
132 ; CHECK-LABEL: from_uint8 130 ; CHECK-LABEL: from_uint8
133 ; CHECK: [.bss] 131 ; CHECK: [.bss]
134 ; CHECK: movzx e{{.*}}, {{[a-d]l|byte ptr}} 132 ; CHECK: movzx e{{.*}},{{[a-d]l|BYTE PTR}}
135 ; CHECK: [.bss] 133 ; CHECK: [.bss]
136 ; CHECK: movzx 134 ; CHECK: movzx
137 ; CHECK: [.bss] 135 ; CHECK: [.bss]
138 ; CHECK: movzx 136 ; CHECK: movzx
139 ; CHECK: mov {{.*}}, 0 137 ; CHECK: mov {{.*}},0
140 ; CHECK: [.bss] 138 ; CHECK: [.bss]
141 139
142 define void @from_uint16() { 140 define void @from_uint16() {
143 entry: 141 entry:
144 %__0 = bitcast [2 x i8]* @u16v to i16* 142 %__0 = bitcast [2 x i8]* @u16v to i16*
145 %v0 = load i16* %__0, align 1 143 %v0 = load i16* %__0, align 1
146 %v1 = trunc i16 %v0 to i8 144 %v1 = trunc i16 %v0 to i8
147 %__3 = bitcast [1 x i8]* @i8v to i8* 145 %__3 = bitcast [1 x i8]* @i8v to i8*
148 store i8 %v1, i8* %__3, align 1 146 store i8 %v1, i8* %__3, align 1
149 %v2 = zext i16 %v0 to i32 147 %v2 = zext i16 %v0 to i32
150 %__5 = bitcast [4 x i8]* @i32v to i32* 148 %__5 = bitcast [4 x i8]* @i32v to i32*
151 store i32 %v2, i32* %__5, align 1 149 store i32 %v2, i32* %__5, align 1
152 %v3 = zext i16 %v0 to i64 150 %v3 = zext i16 %v0 to i64
153 %__7 = bitcast [8 x i8]* @i64v to i64* 151 %__7 = bitcast [8 x i8]* @i64v to i64*
154 store i64 %v3, i64* %__7, align 1 152 store i64 %v3, i64* %__7, align 1
155 ret void 153 ret void
156 } 154 }
157 ; CHECK-LABEL: from_uint16 155 ; CHECK-LABEL: from_uint16
158 ; CHECK: [.bss] 156 ; CHECK: [.bss]
159 ; CHECK: [.bss] 157 ; CHECK: [.bss]
160 ; CHECK: movzx e{{.*}}, {{.*x|[ds]i|bp|word ptr}} 158 ; CHECK: movzx e{{.*}},{{.*x|[ds]i|bp|word ptr}}
161 ; CHECK: [.bss] 159 ; CHECK: [.bss]
162 ; CHECK: movzx e{{.*}}, {{.*x|[ds]i|bp|word ptr}} 160 ; CHECK: movzx e{{.*}},{{.*x|[ds]i|bp|word ptr}}
163 ; CHECK: mov {{.*}}, 0 161 ; CHECK: mov {{.*}},0
164 ; CHECK: [.bss] 162 ; CHECK: [.bss]
165 163
166 define void @from_uint32() { 164 define void @from_uint32() {
167 entry: 165 entry:
168 %__0 = bitcast [4 x i8]* @u32v to i32* 166 %__0 = bitcast [4 x i8]* @u32v to i32*
169 %v0 = load i32* %__0, align 1 167 %v0 = load i32* %__0, align 1
170 %v1 = trunc i32 %v0 to i8 168 %v1 = trunc i32 %v0 to i8
171 %__3 = bitcast [1 x i8]* @i8v to i8* 169 %__3 = bitcast [1 x i8]* @i8v to i8*
172 store i8 %v1, i8* %__3, align 1 170 store i8 %v1, i8* %__3, align 1
173 %v2 = trunc i32 %v0 to i16 171 %v2 = trunc i32 %v0 to i16
174 %__5 = bitcast [2 x i8]* @i16v to i16* 172 %__5 = bitcast [2 x i8]* @i16v to i16*
175 store i16 %v2, i16* %__5, align 1 173 store i16 %v2, i16* %__5, align 1
176 %v3 = zext i32 %v0 to i64 174 %v3 = zext i32 %v0 to i64
177 %__7 = bitcast [8 x i8]* @i64v to i64* 175 %__7 = bitcast [8 x i8]* @i64v to i64*
178 store i64 %v3, i64* %__7, align 1 176 store i64 %v3, i64* %__7, align 1
179 ret void 177 ret void
180 } 178 }
181 ; CHECK-LABEL: from_uint32 179 ; CHECK-LABEL: from_uint32
182 ; CHECK: [.bss] 180 ; CHECK: [.bss]
183 ; CHECK: [.bss] 181 ; CHECK: [.bss]
184 ; CHECK: [.bss] 182 ; CHECK: [.bss]
185 ; CHECK: mov {{.*}}, 0 183 ; CHECK: mov {{.*}},0
186 ; CHECK: [.bss] 184 ; CHECK: [.bss]
187 185
188 define void @from_uint64() { 186 define void @from_uint64() {
189 entry: 187 entry:
190 %__0 = bitcast [8 x i8]* @u64v to i64* 188 %__0 = bitcast [8 x i8]* @u64v to i64*
191 %v0 = load i64* %__0, align 1 189 %v0 = load i64* %__0, align 1
192 %v1 = trunc i64 %v0 to i8 190 %v1 = trunc i64 %v0 to i8
193 %__3 = bitcast [1 x i8]* @i8v to i8* 191 %__3 = bitcast [1 x i8]* @i8v to i8*
194 store i8 %v1, i8* %__3, align 1 192 store i8 %v1, i8* %__3, align 1
195 %v2 = trunc i64 %v0 to i16 193 %v2 = trunc i64 %v0 to i16
196 %__5 = bitcast [2 x i8]* @i16v to i16* 194 %__5 = bitcast [2 x i8]* @i16v to i16*
197 store i16 %v2, i16* %__5, align 1 195 store i16 %v2, i16* %__5, align 1
198 %v3 = trunc i64 %v0 to i32 196 %v3 = trunc i64 %v0 to i32
199 %__7 = bitcast [4 x i8]* @i32v to i32* 197 %__7 = bitcast [4 x i8]* @i32v to i32*
200 store i32 %v3, i32* %__7, align 1 198 store i32 %v3, i32* %__7, align 1
201 ret void 199 ret void
202 } 200 }
203 ; CHECK-LABEL: from_uint64 201 ; CHECK-LABEL: from_uint64
204 ; CHECK: [.bss] 202 ; CHECK: [.bss]
205 ; CHECK: [.bss] 203 ; CHECK: [.bss]
206 ; CHECK: [.bss] 204 ; CHECK: [.bss]
207 ; CHECK: [.bss] 205 ; CHECK: [.bss]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698