Add test case for PR1261, currently XFAILed.
[oota-llvm.git] / test / Transforms / InstCombine / 2007-03-19-BadTruncChangePR1261.ll
1 ; For PR1261. Before bit accurate type support in InstCombine, this would
2 ; turn the sext into a zext.
3 ; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis &&
4 ; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | not grep zext
5 ; XFAIL: *
6
7 define i16 @test(i31 %zzz) {
8 entry:
9   %A = sext i31 %zzz to i32
10   %B = add i32 %A, 16384
11   %C = lshr i32 %B, 15
12   %D = trunc i32 %C to i16
13   ret i16 %D
14 }