summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-16 20:27:46 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-16 20:27:46 +0000
commit2586b8f9366aed5a1efa44d3f18d095511601642 (patch)
tree04a013b86fd2dea6e72cbeba4a8644b31a4a8298 /test/CodeGen/X86
parent64f9fb1975e52cc1fea3ea9ce9414608c4412677 (diff)
downloadllvm-2586b8f9366aed5a1efa44d3f18d095511601642.tar.gz
llvm-2586b8f9366aed5a1efa44d3f18d095511601642.tar.bz2
llvm-2586b8f9366aed5a1efa44d3f18d095511601642.tar.xz
Basic fast-isel of extractvalue. Not too helpful on its own, given the IR clang generates for cases like this, but it should become more useful soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/fast-isel-extract.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-extract.ll b/test/CodeGen/X86/fast-isel-extract.ll
new file mode 100644
index 0000000000..5493fbf9e1
--- /dev/null
+++ b/test/CodeGen/X86/fast-isel-extract.ll
@@ -0,0 +1,26 @@
+; RUN: llc < %s -mtriple x86_64-apple-darwin11 -O0 | FileCheck %s
+
+%struct.x = type { i64, i64 }
+declare %struct.x @f()
+
+define void @test1(i64*) nounwind ssp {
+ %2 = tail call %struct.x @f() nounwind
+ %3 = extractvalue %struct.x %2, 0
+ %4 = add i64 %3, 10
+ store i64 %4, i64* %0
+ ret void
+; CHECK: test1:
+; CHECK: callq _f
+; CHECK-NEXT: addq $10, %rax
+}
+
+define void @test2(i64*) nounwind ssp {
+ %2 = tail call %struct.x @f() nounwind
+ %3 = extractvalue %struct.x %2, 1
+ %4 = add i64 %3, 10
+ store i64 %4, i64* %0
+ ret void
+; CHECK: test2:
+; CHECK: callq _f
+; CHECK-NEXT: addq $10, %rdx
+}