diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll | 14 | ||||
-rw-r--r-- | test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll b/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll new file mode 100644 index 0000000..cd61a10 --- /dev/null +++ b/test/Transforms/InstCombine/2008-02-16-SDivOverflow.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i.* 0} | count 2 +; PR2048 + +define i32 @i(i32 %a) { + %tmp1 = sdiv i32 %a, -1431655765 + %tmp2 = sdiv i32 %tmp1, 3 + ret i32 %tmp2 +} + +define i8 @j(i8 %a) { + %tmp1 = sdiv i8 %a, 64 + %tmp2 = sdiv i8 %tmp1, 3 + ret i8 %tmp2 +} diff --git a/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll b/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll new file mode 100644 index 0000000..0e260c4 --- /dev/null +++ b/test/Transforms/InstCombine/2008-02-16-SDivOverflow2.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {sdiv i8 \%a, 9} +; PR2048 + +define i8 @i(i8 %a) { + %tmp1 = sdiv i8 %a, -3 + %tmp2 = sdiv i8 %tmp1, -3 + ret i8 %tmp2 +} + |