blob: 78a7fd016716cb1937a4e2facf11b0ffcf5b0763 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep {(trunc i} | not grep ext
Nick Lewycky37d04642009-04-23 05:15:08 +00002
3define i16 @test1(i8 %x) {
4 %A = sext i8 %x to i32
5 %B = trunc i32 %A to i16
6 ret i16 %B
7}
8
9define i8 @test2(i16 %x) {
10 %A = sext i16 %x to i32
11 %B = trunc i32 %A to i8
12 ret i8 %B
13}
14
15define i16 @test3(i16 %x) {
16 %A = sext i16 %x to i32
17 %B = trunc i32 %A to i16
18 ret i16 %B
19}
20
21define i16 @test4(i8 %x) {
22 %A = zext i8 %x to i32
23 %B = trunc i32 %A to i16
24 ret i16 %B
25}
26
27define i8 @test5(i16 %x) {
28 %A = zext i16 %x to i32
29 %B = trunc i32 %A to i8
30 ret i8 %B
31}
32
33define i16 @test6(i16 %x) {
34 %A = zext i16 %x to i32
35 %B = trunc i32 %A to i16
36 ret i16 %B
37}