aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/inline-asm-pic.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-09-24 00:05:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-09-24 00:05:32 +0000
commitda43bcf624acb56a3d77bb5ae9a02728af032613 (patch)
treedd93cba15bfa2de5c6708211ff7d67d79792c3d6 /test/CodeGen/X86/inline-asm-pic.ll
parentdd4924c564c7a661b78b604ebf16dfef7aa62b35 (diff)
downloadexternal_llvm-da43bcf624acb56a3d77bb5ae9a02728af032613.zip
external_llvm-da43bcf624acb56a3d77bb5ae9a02728af032613.tar.gz
external_llvm-da43bcf624acb56a3d77bb5ae9a02728af032613.tar.bz2
Properly handle 'm' inline asm constraints. If a GV is being selected for the addressing mode, it requires the same logic for PIC relative addressing, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/inline-asm-pic.ll')
-rw-r--r--test/CodeGen/X86/inline-asm-pic.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/X86/inline-asm-pic.ll b/test/CodeGen/X86/inline-asm-pic.ll
new file mode 100644
index 0000000..04ad48d
--- /dev/null
+++ b/test/CodeGen/X86/inline-asm-pic.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic | grep lea
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic | grep call
+
+@main_q = internal global i8* null ; <i8**> [#uses=1]
+
+define void @func2() nounwind {
+entry:
+ tail call void asm "mov $1,%gs:$0", "=*m,ri,~{dirflag},~{fpsr},~{flags}"(i8** inttoptr (i32 152 to i8**), i8* bitcast (i8** @main_q to i8*)) nounwind
+ ret void
+}