summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-01 03:27:19 +0000
committerChris Lattner <sabre@nondot.org>2009-07-01 03:27:19 +0000
commitf95fa1b721e997510a19e5392bf326269ac04741 (patch)
tree9c9c5fadd63abc85b4b28139c53d20a4d1c2d54d /llvm/test
parentb4ce4fc4eefa73d50493eb078c408e1441c5807b (diff)
downloadbcm5719-llvm-f95fa1b721e997510a19e5392bf326269ac04741.tar.gz
bcm5719-llvm-f95fa1b721e997510a19e5392bf326269ac04741.zip
Fix some fast-isel problems selecting global variable addressing in
pic mode. llvm-svn: 74582
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/fast-isel-gv.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-gv.ll b/llvm/test/CodeGen/X86/fast-isel-gv.ll
new file mode 100644
index 00000000000..7a4b94d1b9b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/fast-isel-gv.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -fast-isel | grep {_kill@GOTPCREL}
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-apple-darwin10.0"
+@f = global i8 (...)* @kill ; <i8 (...)**> [#uses=1]
+
+declare signext i8 @kill(...)
+
+define i32 @main() nounwind ssp {
+entry:
+ %retval = alloca i32 ; <i32*> [#uses=2]
+ %0 = alloca i32 ; <i32*> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ %1 = load i8 (...)** @f, align 8 ; <i8 (...)*> [#uses=1]
+ %2 = icmp ne i8 (...)* %1, @kill ; <i1> [#uses=1]
+ %3 = zext i1 %2 to i32 ; <i32> [#uses=1]
+ store i32 %3, i32* %0, align 4
+ %4 = load i32* %0, align 4 ; <i32> [#uses=1]
+ store i32 %4, i32* %retval, align 4
+ br label %return
+
+return: ; preds = %entry
+ %retval1 = load i32* %retval ; <i32> [#uses=1]
+ ret i32 %retval1
+}
OpenPOWER on IntegriCloud