diff options
author | Duncan Sands <baldrick@free.fr> | 2012-10-02 15:03:49 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-10-02 15:03:49 +0000 |
commit | 48da0be8b5821dddbb5233ad9cb198369031684b (patch) | |
tree | d07c95e8b95e64a915a84fcaabf2ec4c875b1a66 /test | |
parent | 9e36496eb39656df8894a6a1cd56f3561f6672a4 (diff) | |
download | external_llvm-48da0be8b5821dddbb5233ad9cb198369031684b.zip external_llvm-48da0be8b5821dddbb5233ad9cb198369031684b.tar.gz external_llvm-48da0be8b5821dddbb5233ad9cb198369031684b.tar.bz2 |
Fix PR13991: legalizing an overflowing multiplication operation is harder than
the add/sub case since in the case of multiplication you also have to check that
the operation in the larger type did not overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/smul-with-overflow.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/smul-with-overflow.ll b/test/CodeGen/X86/smul-with-overflow.ll index 7ac3840..2d0b2f7 100644 --- a/test/CodeGen/X86/smul-with-overflow.ll +++ b/test/CodeGen/X86/smul-with-overflow.ll @@ -67,3 +67,17 @@ entry: ; CHECK: mull ; CHECK-NEXT: ret } + +declare { i63, i1 } @llvm.smul.with.overflow.i63(i63, i63) nounwind readnone + +define i1 @test5() nounwind { +entry: + %res = call { i63, i1 } @llvm.smul.with.overflow.i63(i63 4, i63 4611686018427387903) + %sum = extractvalue { i63, i1 } %res, 0 + %overflow = extractvalue { i63, i1 } %res, 1 + ret i1 %overflow +; Was returning false, should return true (not constant folded yet though). +; PR13991 +; CHECK: test5: +; CHECK-NOT: xorb +} |