1 ; RUN: opt < %s -instcombine -S > %t
2 ; RUN: not grep zext %t
3 ; RUN: not grep sext %t
5 ; Instcombine should be able to eliminate all of these ext casts.
9 define i64 @foo(i64 %a) {
10 %b = trunc i64 %a to i32
12 %d = zext i32 %c to i64
13 call void @use(i32 %b)
16 define i64 @bar(i64 %a) {
17 %b = trunc i64 %a to i32
20 %d = sext i32 %q to i64
21 call void @use(i32 %b)
24 define i64 @goo(i64 %a) {
25 %b = trunc i64 %a to i32
27 %d = zext i32 %c to i64
28 call void @use(i32 %b)
31 define i64 @hoo(i64 %a) {
32 %b = trunc i64 %a to i32
35 %d = zext i32 %x to i64
36 call void @use(i32 %b)