[llvm-commits] [llvm] r80902 - in /llvm/trunk/test/CodeGen/X86: pic-2.ll pic-3.ll pic-4.ll pic-5.ll pic-6.ll pic.ll

Chris Lattner sabre at nondot.org
Wed Sep 2 23:29:23 PDT 2009


Author: lattner
Date: Thu Sep  3 01:29:23 2009
New Revision: 80902

URL: http://llvm.org/viewvc/llvm-project?rev=80902&view=rev
Log:
merge all the basic linux/32 pic tests together into one test.

Removed:
    llvm/trunk/test/CodeGen/X86/pic-2.ll
    llvm/trunk/test/CodeGen/X86/pic-3.ll
    llvm/trunk/test/CodeGen/X86/pic-4.ll
    llvm/trunk/test/CodeGen/X86/pic-5.ll
    llvm/trunk/test/CodeGen/X86/pic-6.ll
Modified:
    llvm/trunk/test/CodeGen/X86/pic.ll

Removed: llvm/trunk/test/CodeGen/X86/pic-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-2.ll?rev=80901&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic-2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic-2.ll (removed)
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN:   -o %t
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOTOFF %t | count 4
-
- at ptr = internal global i32* null
- at dst = internal global i32 0
- at 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
-}
-

Removed: llvm/trunk/test/CodeGen/X86/pic-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-3.ll?rev=80901&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic-3.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic-3.ll (removed)
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | FileCheck %s
-
-; CHECK: bar:
-; CHECK: call	.Lllvm$1.$piclabel
-; CHECK: popl	%ebx
-; CHECK: addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %ebx
-; CHECK: call	foo at PLT
-
-
-define void @bar() nounwind {
-entry:
-    call void(...)* @foo()
-    br label %return
-return:
-    ret void
-}
-
-declare void @foo(...)

Removed: llvm/trunk/test/CodeGen/X86/pic-4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-4.ll?rev=80901&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic-4.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic-4.ll (removed)
@@ -1,22 +0,0 @@
-; RUN: llvm-as < %s | \
-; RUN:   llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-; RUN: grep GOT %t | count 1
-; RUN: not grep GOTOFF %t
-
- at 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(...)

Removed: llvm/trunk/test/CodeGen/X86/pic-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-5.ll?rev=80901&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic-5.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic-5.ll (removed)
@@ -1,14 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN:   -o %t
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep PLT %t | count 1
-
- at ptr = external global i32* 
-
-define void @foo() {
-entry:
-    %ptr = malloc i32, i32 10
-    ret void
-}
-

Removed: llvm/trunk/test/CodeGen/X86/pic-6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic-6.ll?rev=80901&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic-6.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic-6.ll (removed)
@@ -1,18 +0,0 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
-; RUN:   -o %t
-; RUN:  grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-
- at ptr = global i32* null
- at dst = global i32 0
- at src = 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
-}
-

Modified: llvm/trunk/test/CodeGen/X86/pic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic.ll?rev=80902&r1=80901&r2=80902&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic.ll Thu Sep  3 01:29:23 2009
@@ -1,19 +1,126 @@
-; RUN: llvm-as < %s | \
-; RUN:   llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t
-; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | count 3
-; RUN: grep GOT %t | count 3
-; RUN: not grep GOTOFF %t
+; RUN: llc < %s -mtriple=i686-pc-linux-gnu -relocation-model=pic | FileCheck %s -check-prefix=LINUX
 
 @ptr = external global i32* 
 @dst = external global i32 
 @src = external global i32 
 
-define void @foo() nounwind {
+define void @test1() nounwind {
 entry:
     store i32* @dst, i32** @ptr
     %tmp.s = load i32* @src
     store i32 %tmp.s, i32* @dst
     ret void
+    
+; LINUX:    test1:
+; LINUX: .LBB1_0:
+; LINUX:	call	.Lllvm$1.$piclabel
+; LINUX-NEXT: .Lllvm$1.$piclabel:
+; LINUX-NEXT:	popl
+; LINUX:	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel],
+; LINUX:	movl	dst at GOT(%eax),
+; LINUX:	movl	ptr at GOT(%eax),
+; LINUX:	movl	src at GOT(%eax),
+; LINUX:	ret
+}
+
+ at ptr2 = global i32* null
+ at dst2 = global i32 0
+ at src2 = global i32 0
+
+define void @test2() nounwind {
+entry:
+    store i32* @dst2, i32** @ptr2
+    %tmp.s = load i32* @src2
+    store i32 %tmp.s, i32* @dst2
+    ret void
+    
+; LINUX: test2:
+; LINUX:	call	.Lllvm$2.$piclabel
+; LINUX-NEXT: .Lllvm$2.$piclabel:
+; LINUX-NEXT:	popl
+; LINUX:	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$2.$piclabel], %eax
+; LINUX:	movl	dst2 at GOT(%eax),
+; LINUX:	movl	ptr2 at GOT(%eax),
+; LINUX:	movl	src2 at GOT(%eax),
+; LINUX:	ret
+
+}
+
+declare i8* @malloc(i32)
+
+define void @test3() nounwind {
+entry:
+    %ptr = call i8* @malloc(i32 40)
+    ret void
+; LINUX: test3:
+; LINUX: 	pushl	%ebx
+; LINUX-NEXT: 	subl	$8, %esp
+; LINUX-NEXT: 	call	.Lllvm$3.$piclabel
+; LINUX-NEXT: .Lllvm$3.$piclabel:
+; LINUX-NEXT: 	popl	%ebx
+; LINUX: 	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$3.$piclabel], %ebx
+; LINUX: 	movl	$40, (%esp)
+; LINUX: 	call	malloc at PLT
+; LINUX: 	addl	$8, %esp
+; LINUX: 	popl	%ebx
+; LINUX: 	ret
+}
+
+ at pfoo = external global void(...)* 
+
+define void @test4() nounwind {
+entry:
+    %tmp = call void(...)*(...)* @afoo()
+    store void(...)* %tmp, void(...)** @pfoo
+    %tmp1 = load void(...)** @pfoo
+    call void(...)* %tmp1()
+    ret void
+; LINUX: test4:
+; LINUX: 	call	.Lllvm$4.$piclabel
+; LINUX-NEXT: .Lllvm$4.$piclabel:
+; LINUX: 	popl
+; LINUX: 	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$4.$piclabel],
+; LINUX: 	movl	pfoo at GOT(%esi),
+; LINUX: 	call	afoo at PLT
+; LINUX: 	call	*
+}
+
+declare void(...)* @afoo(...)
+
+define void @test5() nounwind {
+entry:
+    call void(...)* @foo()
+    ret void
+; LINUX: test5:
+; LINUX: call	.Lllvm$5.$piclabel
+; LINUX: popl	%ebx
+; LINUX: addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$5.$piclabel], %ebx
+; LINUX: call	foo at PLT
+}
+
+declare void @foo(...)
+
+
+ at ptr6 = internal global i32* null
+ at dst6 = internal global i32 0
+ at src6 = internal global i32 0
+
+define void @test6() nounwind {
+entry:
+    store i32* @dst6, i32** @ptr6
+    %tmp.s = load i32* @src6
+    store i32 %tmp.s, i32* @dst6
+    ret void
+    
+; LINUX: test6:
+; LINUX: 	call	.Lllvm$6.$piclabel
+; LINUX-NEXT: .Lllvm$6.$piclabel:
+; LINUX-NEXT: 	popl	%eax
+; LINUX: 	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$6.$piclabel], %eax
+; LINUX: 	leal	dst6 at GOTOFF(%eax), %ecx
+; LINUX: 	movl	%ecx, ptr6 at GOTOFF(%eax)
+; LINUX: 	movl	src6 at GOTOFF(%eax), %ecx
+; LINUX: 	movl	%ecx, dst6 at GOTOFF(%eax)
+; LINUX: 	ret
 }
 





More information about the llvm-commits mailing list