llvm.org GIT mirror llvm / d8e637e
Pass the .ll files to llvm-link directly. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222681 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
5 changed file(s) with 154 addition(s) and 160 deletion(s). Raw diff Collapse all Expand all
0 %intlist = type { %intlist*, i32 }
1
2
3 %Ty1 = type { %Ty2* }
4 %Ty2 = type opaque
5
6 %VecSize = type { <10 x i32> }
7
8 @GVTy1 = global %Ty1* null
9 @GVTy2 = external global %Ty2*
10
11
12 @MyVar = global i32 4
13 @MyIntList = external global %intlist
14 @AConst = constant i32 1234
15
16 ;; Intern in both testlink[12].ll
17 @Intern1 = internal constant i32 52
18
19 ;; Intern in one but not in other
20 @Intern2 = constant i32 12345
21
22 @MyIntListPtr = constant { %intlist* } { %intlist* @MyIntList }
23 @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
24 @0 = constant i32 412
25
26 ; Provides definition of Struct1 and of S1GV.
27 %Struct1 = type { i32 }
28 @S1GV = global %Struct1* null
29
30 define i32 @foo(i32 %blah) {
31 store i32 %blah, i32* @MyVar
32 %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
33 store i32 12, i32* %idx
34 %ack = load i32* @0
35 %fzo = add i32 %ack, %blah
36 ret i32 %fzo
37 }
38
39 declare void @unimp(float, double)
40
41 define internal void @testintern() {
42 ret void
43 }
44
45 define void @Testintern() {
46 ret void
47 }
48
49 define internal void @testIntern() {
50 ret void
51 }
52
53 declare void @VecSizeCrash1(%VecSize)
0 ; RUN: llvm-link %s %S/Inputs/testlink.ll -S | FileCheck %s
1
2 ; CHECK: %Ty2 = type { %Ty1* }
3 ; CHECK: %Ty1 = type { %Ty2* }
4 %Ty1 = type opaque
5 %Ty2 = type { %Ty1* }
6
7 ; CHECK: %intlist = type { %intlist*, i32 }
8 %intlist = type { %intlist*, i32 }
9
10 ; The uses of intlist in the other file should be remapped.
11 ; CHECK-NOT: {{%intlist.[0-9]}}
12
13 ; CHECK: %VecSize = type { <5 x i32> }
14 ; CHECK: %VecSize.{{[0-9]}} = type { <10 x i32> }
15 %VecSize = type { <5 x i32> }
16
17 %Struct1 = type opaque
18 @S1GV = external global %Struct1*
19
20
21 @GVTy1 = external global %Ty1*
22 @GVTy2 = global %Ty2* null
23
24
25 ; This should stay the same
26 ; CHECK: @MyIntList = global %intlist { %intlist* null, i32 17 }
27 @MyIntList = global %intlist { %intlist* null, i32 17 }
28
29
30 ; Nothing to link here.
31
32 ; CHECK: @0 = external global i32
33 @0 = external global i32
34 ; CHECK: @Inte = global i32 1
35 @Inte = global i32 1
36
37 ; Intern1 is intern in both files, rename testlink2's.
38 ; CHECK: @Intern1 = internal constant i32 42
39 @Intern1 = internal constant i32 42
40
41 ; This should get renamed since there is a definition that is non-internal in
42 ; the other module.
43 ; CHECK: @Intern2{{[0-9]+}} = internal constant i32 792
44 @Intern2 = internal constant i32 792
45
46
47 ; CHECK: @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
48 @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
49
50 ; CHECK: @MyVar = global i32 4
51 @MyVar = external global i32
52
53 ; Take value from other module.
54 ; CHECK: AConst = constant i32 1234
55 @AConst = linkonce constant i32 123
56
57 ; Renamed version of Intern1.
58 ; CHECK: @Intern1{{[0-9]+}} = internal constant i32 52
59
60
61 ; Globals linked from testlink2.
62 ; CHECK: @Intern2 = constant i32 12345
63
64 ; CHECK: @MyIntListPtr = constant
65 ; CHECK: @1 = constant i32 412
66
67
68 declare i32 @foo(i32)
69
70 declare void @print(i32)
71
72 define void @main() {
73 %v1 = load i32* @MyVar
74 call void @print(i32 %v1)
75 %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
76 %v2 = load i32* %idx
77 call void @print(i32 %v2)
78 %1 = call i32 @foo(i32 5)
79 %v3 = load i32* @MyVar
80 call void @print(i32 %v3)
81 %v4 = load i32* %idx
82 call void @print(i32 %v4)
83 ret void
84 }
85
86 define internal void @testintern() {
87 ret void
88 }
89
90 define internal void @Testintern() {
91 ret void
92 }
93
94 define void @testIntern() {
95 ret void
96 }
97
98 declare void @VecSizeCrash(%VecSize)
+0
-101
test/Linker/testlink1.ll less more
None ; RUN: llvm-as < %s > %t.bc
1 ; RUN: llvm-as < %p/testlink2.ll > %t2.bc
2 ; RUN: llvm-link %t.bc %t2.bc -S | FileCheck %s
3
4 ; CHECK: %Ty2 = type { %Ty1* }
5 ; CHECK: %Ty1 = type { %Ty2* }
6 %Ty1 = type opaque
7 %Ty2 = type { %Ty1* }
8
9 ; CHECK: %intlist = type { %intlist*, i32 }
10 %intlist = type { %intlist*, i32 }
11
12 ; The uses of intlist in the other file should be remapped.
13 ; CHECK-NOT: {{%intlist.[0-9]}}
14
15 ; CHECK: %VecSize = type { <5 x i32> }
16 ; CHECK: %VecSize.{{[0-9]}} = type { <10 x i32> }
17 %VecSize = type { <5 x i32> }
18
19 %Struct1 = type opaque
20 @S1GV = external global %Struct1*
21
22
23 @GVTy1 = external global %Ty1*
24 @GVTy2 = global %Ty2* null
25
26
27 ; This should stay the same
28 ; CHECK: @MyIntList = global %intlist { %intlist* null, i32 17 }
29 @MyIntList = global %intlist { %intlist* null, i32 17 }
30
31
32 ; Nothing to link here.
33
34 ; CHECK: @0 = external global i32
35 @0 = external global i32
36 ; CHECK: @Inte = global i32 1
37 @Inte = global i32 1
38
39 ; Intern1 is intern in both files, rename testlink2's.
40 ; CHECK: @Intern1 = internal constant i32 42
41 @Intern1 = internal constant i32 42
42
43 ; This should get renamed since there is a definition that is non-internal in
44 ; the other module.
45 ; CHECK: @Intern2{{[0-9]+}} = internal constant i32 792
46 @Intern2 = internal constant i32 792
47
48
49 ; CHECK: @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
50 @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
51
52 ; CHECK: @MyVar = global i32 4
53 @MyVar = external global i32
54
55 ; Take value from other module.
56 ; CHECK: AConst = constant i32 1234
57 @AConst = linkonce constant i32 123
58
59 ; Renamed version of Intern1.
60 ; CHECK: @Intern1{{[0-9]+}} = internal constant i32 52
61
62
63 ; Globals linked from testlink2.
64 ; CHECK: @Intern2 = constant i32 12345
65
66 ; CHECK: @MyIntListPtr = constant
67 ; CHECK: @1 = constant i32 412
68
69
70 declare i32 @foo(i32)
71
72 declare void @print(i32)
73
74 define void @main() {
75 %v1 = load i32* @MyVar
76 call void @print(i32 %v1)
77 %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
78 %v2 = load i32* %idx
79 call void @print(i32 %v2)
80 %1 = call i32 @foo(i32 5)
81 %v3 = load i32* @MyVar
82 call void @print(i32 %v3)
83 %v4 = load i32* %idx
84 call void @print(i32 %v4)
85 ret void
86 }
87
88 define internal void @testintern() {
89 ret void
90 }
91
92 define internal void @Testintern() {
93 ret void
94 }
95
96 define void @testIntern() {
97 ret void
98 }
99
100 declare void @VecSizeCrash(%VecSize)
+0
-58
test/Linker/testlink2.ll less more
None ; This file is used by testlink1.ll, so it doesn't actually do anything itself
1 ;
2 ; RUN: true
3
4 %intlist = type { %intlist*, i32 }
5
6
7 %Ty1 = type { %Ty2* }
8 %Ty2 = type opaque
9
10 %VecSize = type { <10 x i32> }
11
12 @GVTy1 = global %Ty1* null
13 @GVTy2 = external global %Ty2*
14
15
16 @MyVar = global i32 4
17 @MyIntList = external global %intlist
18 @AConst = constant i32 1234
19
20 ;; Intern in both testlink[12].ll
21 @Intern1 = internal constant i32 52
22
23 ;; Intern in one but not in other
24 @Intern2 = constant i32 12345
25
26 @MyIntListPtr = constant { %intlist* } { %intlist* @MyIntList }
27 @MyVarPtr = linkonce global { i32* } { i32* @MyVar }
28 @0 = constant i32 412
29
30 ; Provides definition of Struct1 and of S1GV.
31 %Struct1 = type { i32 }
32 @S1GV = global %Struct1* null
33
34 define i32 @foo(i32 %blah) {
35 store i32 %blah, i32* @MyVar
36 %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1
37 store i32 12, i32* %idx
38 %ack = load i32* @0
39 %fzo = add i32 %ack, %blah
40 ret i32 %fzo
41 }
42
43 declare void @unimp(float, double)
44
45 define internal void @testintern() {
46 ret void
47 }
48
49 define void @Testintern() {
50 ret void
51 }
52
53 define internal void @testIntern() {
54 ret void
55 }
56
57 declare void @VecSizeCrash1(%VecSize)
0 ; RUN: llvm-as < %s > %t.bc
1 ; RUN: llvm-as < %p/testlink1.ll > %t2.bc
1 ; RUN: llvm-as < %p/testlink.ll > %t2.bc
22 ; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc
33 ; RUN: llvm-dis < %t1.bc | FileCheck %s
44 ; CHECK: kallsyms_names = extern_weak