diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-05-16 21:06:17 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-05-16 21:06:17 +0000 |
commit | 482feb33b2bba677d47bab859d9e1e95d67016bd (patch) | |
tree | 408a1806b664a39913852fead5af017c352607e8 /test/CodeGen | |
parent | a4c920db7a3620f365144eac9aaad7ca23062caa (diff) | |
download | external_llvm-482feb33b2bba677d47bab859d9e1e95d67016bd.zip external_llvm-482feb33b2bba677d47bab859d9e1e95d67016bd.tar.gz external_llvm-482feb33b2bba677d47bab859d9e1e95d67016bd.tar.bz2 |
Make fast-isel work correctly s/uadd.with.overflow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/X86/fast-isel-extract.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-extract.ll b/test/CodeGen/X86/fast-isel-extract.ll index 5493fbf..e51c417 100644 --- a/test/CodeGen/X86/fast-isel-extract.ll +++ b/test/CodeGen/X86/fast-isel-extract.ll @@ -1,6 +1,7 @@ ; RUN: llc < %s -mtriple x86_64-apple-darwin11 -O0 | FileCheck %s %struct.x = type { i64, i64 } +%addovf = type { i32, i1 } declare %struct.x @f() define void @test1(i64*) nounwind ssp { @@ -24,3 +25,24 @@ define void @test2(i64*) nounwind ssp { ; CHECK: callq _f ; CHECK-NEXT: addq $10, %rdx } + +declare %addovf @llvm.sadd.with.overflow.i32(i32, i32) nounwind readnone + +define void @test3(i32 %x, i32 %y, i32* %z) { + %r = call %addovf @llvm.sadd.with.overflow.i32(i32 %x, i32 %y) + %sum = extractvalue %addovf %r, 0 + %sum3 = mul i32 %sum, 3 + %bit = extractvalue %addovf %r, 1 + br i1 %bit, label %then, label %end + +then: + store i32 %sum3, i32* %z + br label %end + +end: + ret void +; CHECK: test3 +; CHECK: addl +; CHECK: seto %al +; CHECK: testb $1, %al +} |