[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/test-hidden.ll test-pic-1.ll test-pic-2.ll test-pic-3.ll test-pic-4.ll test-pic-5.ll test-pic-cpool.ll test-pic-jtbl.ll
Anton Korobeynikov
asl at math.spbu.ru
Fri Jan 12 11:21:22 PST 2007
Changes in directory llvm/test/Regression/CodeGen/X86:
test-hidden.ll added (r1.1)
test-pic-1.ll added (r1.1)
test-pic-2.ll added (r1.1)
test-pic-3.ll added (r1.1)
test-pic-4.ll added (r1.1)
test-pic-5.ll added (r1.1)
test-pic-cpool.ll added (r1.1)
test-pic-jtbl.ll added (r1.1)
---
Log message:
* PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)
---
Diffs of the changes: (+172 -0)
test-hidden.ll | 19 ++++++++++++++++++
test-pic-1.ll | 18 +++++++++++++++++
test-pic-2.ll | 17 ++++++++++++++++
test-pic-3.ll | 14 +++++++++++++
test-pic-4.ll | 21 +++++++++++++++++++
test-pic-5.ll | 13 ++++++++++++
test-pic-cpool.ll | 13 ++++++++++++
test-pic-jtbl.ll | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 172 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/test-hidden.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-hidden.ll:1.1
*** /dev/null Fri Jan 12 13:20:57 2007
--- llvm/test/Regression/CodeGen/X86/test-hidden.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,19 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | grep ".hidden" | wc -l | grep 2
+
+ %struct.Person = type { i32 }
+ %a = hidden global i32 0
+ %b = external global i32
+
+ implementation ; Functions:
+
+ define weak hidden void %_ZN6Person13privateMethodEv(%struct.Person* %this) {
+ ret void
+ }
+
+ declare void %function(i32)
+
+ define weak void %_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
+ ret void
+ }
+
Index: llvm/test/Regression/CodeGen/X86/test-pic-1.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-1.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-1.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,18 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOT | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 0
+
+ %ptr = external global i32*
+ %dst = external global i32
+ %src = external global i32
+
+ define void %foo() {
+ entry:
+ store i32* %dst, i32** %ptr
+ %tmp.s = load i32* %src
+ store i32 %tmp.s, i32* %dst
+ ret void
+ }
+
Index: llvm/test/Regression/CodeGen/X86/test-pic-2.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-2.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-2.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,17 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 4
+
+ %ptr = internal global i32* null
+ %dst = internal global i32 0
+ %src = internal global i32 0
+
+ define void %foo() {
+ entry:
+ store i32* %dst, i32** %ptr
+ %tmp.s = load i32* %src
+ store i32 %tmp.s, i32* %dst
+ ret void
+ }
+
Index: llvm/test/Regression/CodeGen/X86/test-pic-3.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-3.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-3.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,14 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
+
+ define void %bar() {
+ entry:
+ call void(...)* %foo()
+ br label %return
+ return:
+ ret void
+ }
+
+ declare void %foo(...)
Index: llvm/test/Regression/CodeGen/X86/test-pic-4.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-4.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-4.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,21 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep "GOT" | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep "GOTOFF" | wc -l | grep 0
+
+ %pfoo = external global void(...)*
+
+ define void %bar() {
+ entry:
+ %tmp = call void(...)*(...)* %afoo()
+ store void(...)* %tmp, void(...)** %pfoo
+ %tmp1 = load void(...)** %pfoo
+ call void(...)* %tmp1()
+ br label %return
+ return:
+ ret void
+ }
+
+ declare void(...)* %afoo(...)
Index: llvm/test/Regression/CodeGen/X86/test-pic-5.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-5.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-5.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,13 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
+
+ %ptr = external global i32*
+
+ define void %foo() {
+ entry:
+ %ptr = malloc i32, i32 10
+ ret void
+ }
+
Index: llvm/test/Regression/CodeGen/X86/test-pic-cpool.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-cpool.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-cpool.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,13 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 2 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep CPI | wc -l | grep 4
+
+ define double %foo(i32 %a.u) {
+ entry:
+ %tmp = icmp eq i32 %a.u,0
+ %retval = select bool %tmp, double 4.561230e+02, double 1.234560e+02
+ ret double %retval
+ }
+
Index: llvm/test/Regression/CodeGen/X86/test-pic-jtbl.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/test-pic-jtbl.ll:1.1
*** /dev/null Fri Jan 12 13:21:22 2007
--- llvm/test/Regression/CodeGen/X86/test-pic-jtbl.ll Fri Jan 12 13:20:47 2007
***************
*** 0 ****
--- 1,57 ----
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 13 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep JTI | wc -l | grep 15
+
+ define void %bar(i32 %n.u) {
+ entry:
+ switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
+ bb:
+ tail call void(...)* %foo1()
+ ret void
+ bb1:
+ tail call void(...)* %foo2()
+ ret void
+ bb2:
+ tail call void(...)* %foo6()
+ ret void
+ bb3:
+ tail call void(...)* %foo3()
+ ret void
+ bb4:
+ tail call void(...)* %foo4()
+ ret void
+ bb5:
+ tail call void(...)* %foo5()
+ ret void
+ bb6:
+ tail call void(...)* %foo1()
+ ret void
+ bb7:
+ tail call void(...)* %foo2()
+ ret void
+ bb8:
+ tail call void(...)* %foo6()
+ ret void
+ bb9:
+ tail call void(...)* %foo3()
+ ret void
+ bb10:
+ tail call void(...)* %foo4()
+ ret void
+ bb11:
+ tail call void(...)* %foo5()
+ ret void
+ bb12:
+ tail call void(...)* %foo6()
+ ret void
+ }
+
+ declare void %foo1(...)
+ declare void %foo2(...)
+ declare void %foo6(...)
+ declare void %foo3(...)
+ declare void %foo4(...)
+ declare void %foo5(...)
More information about the llvm-commits
mailing list