another example.
[oota-llvm.git] / test / Transforms / InstCombine / cast-sext-zext.ll
1 ; RUN: opt < %s -instcombine -S | not grep sext
2 ; XFAIL: *
3 ; rdar://6598839
4
5 define zeroext i16 @t(i8 zeroext %on_off, i16* nocapture %puls) nounwind readonly {
6 entry:
7         %0 = zext i8 %on_off to i32
8         %1 = add i32 %0, -1
9         %2 = sext i32 %1 to i64
10         %3 = getelementptr i16* %puls, i64 %2
11         %4 = load i16* %3, align 2
12         ret i16 %4
13 }
14
15 define zeroext i64 @t2(i8 zeroext %on_off) nounwind readonly {
16 entry:
17         %0 = zext i8 %on_off to i32
18         %1 = add i32 %0, -1
19         %2 = sext i32 %1 to i64
20         ret i64 %2  ;; Should be (add (zext i8 -> i64), -1)
21 }