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 | f97cb15aeefcd018120a5d1f4dc8058e37cd0681 (patch) | |
tree | 7922f8b90de5297b7e5dc30d3a38269d582fe159 /llvm/test | |
parent | a99c35702d24b8f1342ca73dce94103eb94f9922 (diff) | |
download | bcm5719-llvm-f97cb15aeefcd018120a5d1f4dc8058e37cd0681.tar.gz bcm5719-llvm-f97cb15aeefcd018120a5d1f4dc8058e37cd0681.zip |
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.
llvm-svn: 165017
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/X86/smul-with-overflow.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/smul-with-overflow.ll b/llvm/test/CodeGen/X86/smul-with-overflow.ll index 7ac3840482a..2d0b2f7aa91 100644 --- a/llvm/test/CodeGen/X86/smul-with-overflow.ll +++ b/llvm/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 +} |