[llvm-branch-commits] [llvm-branch] r134396 - in /llvm/branches/type-system-rewrite/test/Linker: 2003-01-30-LinkerTypeRename.ll testlink1.ll testlink2.ll
Chris Lattner
sabre at nondot.org
Mon Jul 4 15:11:53 PDT 2011
Author: lattner
Date: Mon Jul 4 17:11:53 2011
New Revision: 134396
URL: http://llvm.org/viewvc/llvm-project?rev=134396&view=rev
Log:
filecheckize this so it is actually testing stuff.
Modified:
llvm/branches/type-system-rewrite/test/Linker/2003-01-30-LinkerTypeRename.ll
llvm/branches/type-system-rewrite/test/Linker/testlink1.ll
llvm/branches/type-system-rewrite/test/Linker/testlink2.ll
Modified: llvm/branches/type-system-rewrite/test/Linker/2003-01-30-LinkerTypeRename.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/test/Linker/2003-01-30-LinkerTypeRename.ll?rev=134396&r1=134395&r2=134396&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/test/Linker/2003-01-30-LinkerTypeRename.ll (original)
+++ llvm/branches/type-system-rewrite/test/Linker/2003-01-30-LinkerTypeRename.ll Mon Jul 4 17:11:53 2011
@@ -5,5 +5,6 @@
; RUN: llvm-as < %s > %t.2.bc
; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {%Ty } | not grep opaque
-%Ty = type i32
+%Ty = type {i32}
+ at GV = global %Ty* null
\ No newline at end of file
Modified: llvm/branches/type-system-rewrite/test/Linker/testlink1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/test/Linker/testlink1.ll?rev=134396&r1=134395&r2=134396&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/test/Linker/testlink1.ll (original)
+++ llvm/branches/type-system-rewrite/test/Linker/testlink1.ll Mon Jul 4 17:11:53 2011
@@ -1,18 +1,56 @@
; RUN: llvm-as < %s > %t.bc
; RUN: llvm-as < %p/testlink2.ll > %t2.bc
-; RUN: llvm-link %t.bc %t2.bc
+; RUN: llvm-link %t.bc %t2.bc -S | FileCheck %s
+; CHECK: %intlist = type { %intlist*, i32 }
%intlist = type { %intlist*, i32 }
- at MyVar = external global i32
+; The uses of intlist in the other file should be remapped.
+; CHECK-NOT: {{%intlist.[0-9]}}
+
+; This should stay the same
+; CHECK: @MyIntList = global %intlist { %intlist* null, i32 17 }
@MyIntList = global %intlist { %intlist* null, i32 17 }
+
+
+; Nothing to link here.
+
+; CHECK: @0 = external global i32
@0 = external global i32
+; CHECK: @Inte = global i32 1
@Inte = global i32 1
- at AConst = linkonce constant i32 123
+
+; Intern1 is intern in both files, rename testlink2's.
+; CHECK: @Intern1 = internal constant i32 42
@Intern1 = internal constant i32 42
+
+; This should get renamed since there is a definition that is non-internal in
+; the other module.
+; CHECK: @Intern2{{[0-9]+}} = internal constant i32 792
@Intern2 = internal constant i32 792
+
+
+; CHECK: @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
@MyVarPtr = linkonce global { i32* } { i32* @MyVar }
+; CHECK: @MyVar = global i32 4
+ at MyVar = external global i32
+
+; Take value from other module.
+; CHECK: AConst = constant i32 1234
+ at AConst = linkonce constant i32 123
+
+; Renamed version of Intern1.
+; CHECK: @Intern1{{[0-9]+}} = internal constant i32 52
+
+
+; Globals linked from testlink2.
+; CHECK: @Intern2 = constant i32 12345
+
+; CHECK: @MyIntListPtr = constant
+; CHECK: @1 = constant i32 412
+
+
declare i32 @foo(i32)
declare void @print(i32)
Modified: llvm/branches/type-system-rewrite/test/Linker/testlink2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/test/Linker/testlink2.ll?rev=134396&r1=134395&r2=134396&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/test/Linker/testlink2.ll (original)
+++ llvm/branches/type-system-rewrite/test/Linker/testlink2.ll Mon Jul 4 17:11:53 2011
@@ -6,7 +6,7 @@
@MyVar = global i32 4
@MyIntList = external global %intlist
- at AConst = constant i32 123
+ at AConst = constant i32 1234
;; Intern in both testlink[12].ll
@Intern1 = internal constant i32 52
@@ -19,25 +19,25 @@
@0 = constant i32 412
define i32 @foo(i32 %blah) {
-store i32 %blah, i32* @MyVar
-%idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
-store i32 12, i32* %idx
-%ack = load i32* @0
-%fzo = add i32 %ack, %blah
-ret i32 %fzo
+ store i32 %blah, i32* @MyVar
+ %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
+ store i32 12, i32* %idx
+ %ack = load i32* @0
+ %fzo = add i32 %ack, %blah
+ ret i32 %fzo
}
declare void @unimp(float, double)
define internal void @testintern() {
-ret void
+ ret void
}
define void @Testintern() {
-ret void
+ ret void
}
define internal void @testIntern() {
-ret void
+ ret void
}
More information about the llvm-branch-commits
mailing list