Add a testcase where there is an overflow when combining two constants.

I noticed that a proposed optimization would have prevented this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-06-05 21:29:49 +00:00
parent ecbc72405e
commit 64bcc6d81e

View File

@ -76,3 +76,13 @@ define <2 x i64> @test8(<2 x i64> %A) {
; CHECK-NEXT: %add = sub <2 x i64> <i64 1, i64 2>, %A
; CHECK-NEXT: ret <2 x i64> %add
}
define i16 @test9(i16 %a) {
%b = mul i16 %a, 2
%c = mul i16 %a, 32767
%d = add i16 %b, %c
ret i16 %d
; CHECK-LABEL: @test9(
; CHECK-NEXT: %d = mul i16 %a, -32767
; CHECK-NEXT: ret i16 %d
}