From f97cb15aeefcd018120a5d1f4dc8058e37cd0681 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 2 Oct 2012 15:03:49 +0000 Subject: 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 --- llvm/test/CodeGen/X86/smul-with-overflow.ll | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'llvm/test/CodeGen/X86/smul-with-overflow.ll') 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 +} -- cgit v1.2.3