xref: /llvm-project/llvm/test/CodeGen/ARM/rem_crash.ll (revision f2b521ffc5498f271b83f2b74da9faa440008d63)
1*f2b521ffSNAKAMURA Takumi; RUN: llc < %s -mtriple=arm-unknown-unknown
2f824ced6SRenato Golin
3f824ced6SRenato Golindefine i8 @test_minsize_uu8(i8 %x) minsize optsize {
4f824ced6SRenato Golinentry:
5f824ced6SRenato Golin  %0 = udiv i8 %x, 10
6f824ced6SRenato Golin  %1 = urem i8 %x, 10
7f824ced6SRenato Golin  %res = add i8 %0, %1
8f824ced6SRenato Golin  ret i8 %res
9f824ced6SRenato Golin}
10f824ced6SRenato Golin
11f824ced6SRenato Golindefine i8 @test_minsize_ss8(i8 %x) minsize optsize {
12f824ced6SRenato Golinentry:
13f824ced6SRenato Golin  %0 = sdiv i8 %x, 10
14f824ced6SRenato Golin  %1 = srem i8 %x, 10
15f824ced6SRenato Golin  %res = add i8 %0, %1
16f824ced6SRenato Golin  ret i8 %res
17f824ced6SRenato Golin}
18f824ced6SRenato Golin
19f824ced6SRenato Golindefine i8 @test_minsize_us8(i8 %x) minsize optsize {
20f824ced6SRenato Golinentry:
21f824ced6SRenato Golin  %0 = udiv i8 %x, 10
22f824ced6SRenato Golin  %1 = srem i8 %x, 10
23f824ced6SRenato Golin  %res = add i8 %0, %1
24f824ced6SRenato Golin  ret i8 %res
25f824ced6SRenato Golin}
26f824ced6SRenato Golin
27f824ced6SRenato Golindefine i8 @test_minsize_su8(i8 %x) minsize optsize {
28f824ced6SRenato Golinentry:
29f824ced6SRenato Golin  %0 = sdiv i8 %x, 10
30f824ced6SRenato Golin  %1 = urem i8 %x, 10
31f824ced6SRenato Golin  %res = add i8 %0, %1
32f824ced6SRenato Golin  ret i8 %res
33f824ced6SRenato Golin}
34f824ced6SRenato Golin
35f824ced6SRenato Golindefine i16 @test_minsize_uu16(i16 %x) minsize optsize {
36f824ced6SRenato Golinentry:
37f824ced6SRenato Golin  %0 = udiv i16 %x, 10
38f824ced6SRenato Golin  %1 = urem i16 %x, 10
39f824ced6SRenato Golin  %res = add i16 %0, %1
40f824ced6SRenato Golin  ret i16 %res
41f824ced6SRenato Golin}
42f824ced6SRenato Golin
43f824ced6SRenato Golindefine i16 @test_minsize_ss16(i16 %x) minsize optsize {
44f824ced6SRenato Golinentry:
45f824ced6SRenato Golin  %0 = sdiv i16 %x, 10
46f824ced6SRenato Golin  %1 = srem i16 %x, 10
47f824ced6SRenato Golin  %res = add i16 %0, %1
48f824ced6SRenato Golin  ret i16 %res
49f824ced6SRenato Golin}
50f824ced6SRenato Golin
51f824ced6SRenato Golindefine i16 @test_minsize_us16(i16 %x) minsize optsize {
52f824ced6SRenato Golinentry:
53f824ced6SRenato Golin  %0 = udiv i16 %x, 10
54f824ced6SRenato Golin  %1 = srem i16 %x, 10
55f824ced6SRenato Golin  %res = add i16 %0, %1
56f824ced6SRenato Golin  ret i16 %res
57f824ced6SRenato Golin}
58f824ced6SRenato Golin
59f824ced6SRenato Golindefine i16 @test_minsize_su16(i16 %x) minsize optsize {
60f824ced6SRenato Golinentry:
61f824ced6SRenato Golin  %0 = sdiv i16 %x, 10
62f824ced6SRenato Golin  %1 = urem i16 %x, 10
63f824ced6SRenato Golin  %res = add i16 %0, %1
64f824ced6SRenato Golin  ret i16 %res
65f824ced6SRenato Golin}
66f824ced6SRenato Golin
67f824ced6SRenato Golindefine i32 @test_minsize_uu32(i32 %x) minsize optsize {
68f824ced6SRenato Golinentry:
69f824ced6SRenato Golin  %0 = udiv i32 %x, 10
70f824ced6SRenato Golin  %1 = urem i32 %x, 10
71f824ced6SRenato Golin  %res = add i32 %0, %1
72f824ced6SRenato Golin  ret i32 %res
73f824ced6SRenato Golin}
74f824ced6SRenato Golin
75f824ced6SRenato Golindefine i32 @test_minsize_ss32(i32 %x) minsize optsize {
76f824ced6SRenato Golinentry:
77f824ced6SRenato Golin  %0 = sdiv i32 %x, 10
78f824ced6SRenato Golin  %1 = srem i32 %x, 10
79f824ced6SRenato Golin  %res = add i32 %0, %1
80f824ced6SRenato Golin  ret i32 %res
81f824ced6SRenato Golin}
82f824ced6SRenato Golin
83f824ced6SRenato Golindefine i32 @test_minsize_us32(i32 %x) minsize optsize {
84f824ced6SRenato Golinentry:
85f824ced6SRenato Golin  %0 = udiv i32 %x, 10
86f824ced6SRenato Golin  %1 = srem i32 %x, 10
87f824ced6SRenato Golin  %res = add i32 %0, %1
88f824ced6SRenato Golin  ret i32 %res
89f824ced6SRenato Golin}
90f824ced6SRenato Golin
91f824ced6SRenato Golindefine i32 @test_minsize_su32(i32 %x) minsize optsize {
92f824ced6SRenato Golinentry:
93f824ced6SRenato Golin  %0 = sdiv i32 %x, 10
94f824ced6SRenato Golin  %1 = urem i32 %x, 10
95f824ced6SRenato Golin  %res = add i32 %0, %1
96f824ced6SRenato Golin  ret i32 %res
97f824ced6SRenato Golin}
98f824ced6SRenato Golin
99f824ced6SRenato Golindefine i64 @test_minsize_uu64(i64 %x) minsize optsize {
100f824ced6SRenato Golinentry:
101f824ced6SRenato Golin  %0 = udiv i64 %x, 10
102f824ced6SRenato Golin  %1 = urem i64 %x, 10
103f824ced6SRenato Golin  %res = add i64 %0, %1
104f824ced6SRenato Golin  ret i64 %res
105f824ced6SRenato Golin}
106f824ced6SRenato Golin
107f824ced6SRenato Golindefine i64 @test_minsize_ss64(i64 %x) minsize optsize {
108f824ced6SRenato Golinentry:
109f824ced6SRenato Golin  %0 = sdiv i64 %x, 10
110f824ced6SRenato Golin  %1 = srem i64 %x, 10
111f824ced6SRenato Golin  %res = add i64 %0, %1
112f824ced6SRenato Golin  ret i64 %res
113f824ced6SRenato Golin}
114f824ced6SRenato Golin
115f824ced6SRenato Golindefine i64 @test_minsize_us64(i64 %x) minsize optsize {
116f824ced6SRenato Golinentry:
117f824ced6SRenato Golin  %0 = udiv i64 %x, 10
118f824ced6SRenato Golin  %1 = srem i64 %x, 10
119f824ced6SRenato Golin  %res = add i64 %0, %1
120f824ced6SRenato Golin  ret i64 %res
121f824ced6SRenato Golin}
122f824ced6SRenato Golin
123f824ced6SRenato Golindefine i64 @test_minsize_su64(i64 %x) minsize optsize {
124f824ced6SRenato Golinentry:
125f824ced6SRenato Golin  %0 = sdiv i64 %x, 10
126f824ced6SRenato Golin  %1 = urem i64 %x, 10
127f824ced6SRenato Golin  %res = add i64 %0, %1
128f824ced6SRenato Golin  ret i64 %res
129f824ced6SRenato Golin}
130f824ced6SRenato Golin
131f824ced6SRenato Golindefine i8 @test_uu8(i8 %x) optsize {
132f824ced6SRenato Golinentry:
133f824ced6SRenato Golin  %0 = udiv i8 %x, 10
134f824ced6SRenato Golin  %1 = urem i8 %x, 10
135f824ced6SRenato Golin  %res = add i8 %0, %1
136f824ced6SRenato Golin  ret i8 %res
137f824ced6SRenato Golin}
138f824ced6SRenato Golin
139f824ced6SRenato Golindefine i8 @test_ss8(i8 %x) optsize {
140f824ced6SRenato Golinentry:
141f824ced6SRenato Golin  %0 = sdiv i8 %x, 10
142f824ced6SRenato Golin  %1 = srem i8 %x, 10
143f824ced6SRenato Golin  %res = add i8 %0, %1
144f824ced6SRenato Golin  ret i8 %res
145f824ced6SRenato Golin}
146f824ced6SRenato Golin
147f824ced6SRenato Golindefine i8 @test_us8(i8 %x) optsize {
148f824ced6SRenato Golinentry:
149f824ced6SRenato Golin  %0 = udiv i8 %x, 10
150f824ced6SRenato Golin  %1 = srem i8 %x, 10
151f824ced6SRenato Golin  %res = add i8 %0, %1
152f824ced6SRenato Golin  ret i8 %res
153f824ced6SRenato Golin}
154f824ced6SRenato Golin
155f824ced6SRenato Golindefine i8 @test_su8(i8 %x) optsize {
156f824ced6SRenato Golinentry:
157f824ced6SRenato Golin  %0 = sdiv i8 %x, 10
158f824ced6SRenato Golin  %1 = urem i8 %x, 10
159f824ced6SRenato Golin  %res = add i8 %0, %1
160f824ced6SRenato Golin  ret i8 %res
161f824ced6SRenato Golin}
162f824ced6SRenato Golin
163f824ced6SRenato Golindefine i16 @test_uu16(i16 %x) optsize {
164f824ced6SRenato Golinentry:
165f824ced6SRenato Golin  %0 = udiv i16 %x, 10
166f824ced6SRenato Golin  %1 = urem i16 %x, 10
167f824ced6SRenato Golin  %res = add i16 %0, %1
168f824ced6SRenato Golin  ret i16 %res
169f824ced6SRenato Golin}
170f824ced6SRenato Golin
171f824ced6SRenato Golindefine i16 @test_ss16(i16 %x) optsize {
172f824ced6SRenato Golinentry:
173f824ced6SRenato Golin  %0 = sdiv i16 %x, 10
174f824ced6SRenato Golin  %1 = srem i16 %x, 10
175f824ced6SRenato Golin  %res = add i16 %0, %1
176f824ced6SRenato Golin  ret i16 %res
177f824ced6SRenato Golin}
178f824ced6SRenato Golin
179f824ced6SRenato Golindefine i16 @test_us16(i16 %x) optsize {
180f824ced6SRenato Golinentry:
181f824ced6SRenato Golin  %0 = udiv i16 %x, 10
182f824ced6SRenato Golin  %1 = srem i16 %x, 10
183f824ced6SRenato Golin  %res = add i16 %0, %1
184f824ced6SRenato Golin  ret i16 %res
185f824ced6SRenato Golin}
186f824ced6SRenato Golin
187f824ced6SRenato Golindefine i16 @test_su16(i16 %x) optsize {
188f824ced6SRenato Golinentry:
189f824ced6SRenato Golin  %0 = sdiv i16 %x, 10
190f824ced6SRenato Golin  %1 = urem i16 %x, 10
191f824ced6SRenato Golin  %res = add i16 %0, %1
192f824ced6SRenato Golin  ret i16 %res
193f824ced6SRenato Golin}
194f824ced6SRenato Golin
195f824ced6SRenato Golindefine i32 @test_uu32(i32 %x) optsize {
196f824ced6SRenato Golinentry:
197f824ced6SRenato Golin  %0 = udiv i32 %x, 10
198f824ced6SRenato Golin  %1 = urem i32 %x, 10
199f824ced6SRenato Golin  %res = add i32 %0, %1
200f824ced6SRenato Golin  ret i32 %res
201f824ced6SRenato Golin}
202f824ced6SRenato Golin
203f824ced6SRenato Golindefine i32 @test_ss32(i32 %x) optsize {
204f824ced6SRenato Golinentry:
205f824ced6SRenato Golin  %0 = sdiv i32 %x, 10
206f824ced6SRenato Golin  %1 = srem i32 %x, 10
207f824ced6SRenato Golin  %res = add i32 %0, %1
208f824ced6SRenato Golin  ret i32 %res
209f824ced6SRenato Golin}
210f824ced6SRenato Golin
211f824ced6SRenato Golindefine i32 @test_us32(i32 %x) optsize {
212f824ced6SRenato Golinentry:
213f824ced6SRenato Golin  %0 = udiv i32 %x, 10
214f824ced6SRenato Golin  %1 = srem i32 %x, 10
215f824ced6SRenato Golin  %res = add i32 %0, %1
216f824ced6SRenato Golin  ret i32 %res
217f824ced6SRenato Golin}
218f824ced6SRenato Golin
219f824ced6SRenato Golindefine i32 @test_su32(i32 %x) optsize {
220f824ced6SRenato Golinentry:
221f824ced6SRenato Golin  %0 = sdiv i32 %x, 10
222f824ced6SRenato Golin  %1 = urem i32 %x, 10
223f824ced6SRenato Golin  %res = add i32 %0, %1
224f824ced6SRenato Golin  ret i32 %res
225f824ced6SRenato Golin}
226f824ced6SRenato Golin
227f824ced6SRenato Golindefine i64 @test_uu64(i64 %x) optsize {
228f824ced6SRenato Golinentry:
229f824ced6SRenato Golin  %0 = udiv i64 %x, 10
230f824ced6SRenato Golin  %1 = urem i64 %x, 10
231f824ced6SRenato Golin  %res = add i64 %0, %1
232f824ced6SRenato Golin  ret i64 %res
233f824ced6SRenato Golin}
234f824ced6SRenato Golin
235f824ced6SRenato Golindefine i64 @test_ss64(i64 %x) optsize {
236f824ced6SRenato Golinentry:
237f824ced6SRenato Golin  %0 = sdiv i64 %x, 10
238f824ced6SRenato Golin  %1 = srem i64 %x, 10
239f824ced6SRenato Golin  %res = add i64 %0, %1
240f824ced6SRenato Golin  ret i64 %res
241f824ced6SRenato Golin}
242f824ced6SRenato Golin
243f824ced6SRenato Golindefine i64 @test_us64(i64 %x) optsize {
244f824ced6SRenato Golinentry:
245f824ced6SRenato Golin  %0 = udiv i64 %x, 10
246f824ced6SRenato Golin  %1 = srem i64 %x, 10
247f824ced6SRenato Golin  %res = add i64 %0, %1
248f824ced6SRenato Golin  ret i64 %res
249f824ced6SRenato Golin}
250f824ced6SRenato Golin
251f824ced6SRenato Golindefine i64 @test_su64(i64 %x) optsize {
252f824ced6SRenato Golinentry:
253f824ced6SRenato Golin  %0 = sdiv i64 %x, 10
254f824ced6SRenato Golin  %1 = urem i64 %x, 10
255f824ced6SRenato Golin  %res = add i64 %0, %1
256f824ced6SRenato Golin  ret i64 %res
257f824ced6SRenato Golin}
258