Fix PR13991: legalizing an overflowing multiplication operation is harder than
[oota-llvm.git] / test / CodeGen / X86 / smul-with-overflow.ll
index 7ac3840482a23912f1886eaa9673014aa7a1670f..2d0b2f7aa91d052e914ae6d9adf60bffd9ebebc8 100644 (file)
@@ -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
+}