llvm.org GIT mirror llvm / 6141f17
llvm-link: Verify input modules Otherwise, broken input modules can cause assertions. I've updated two of the testcases that started failing (modules that had `Require` flags but didn't meet their own requirements), but Rafael and I decided that test/Linker/2011-08-22-ResolveAlias.ll should just be deleted outright -- it's a leftover of the way llvm-gcc used to implement weakref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233229 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 5 years ago
6 changed file(s) with 18 addition(s) and 237 deletion(s). Raw diff Collapse all Expand all
+0
-89
test/Linker/2011-08-22-ResolveAlias.ll less more
None ; PR10663
1 ; RUN: llvm-link %s %p/2011-08-22-ResolveAlias2.ll
2
3 %union.pthread_attr_t = type { [56 x i8] }
4 %union.pthread_mutex_t = type { [40 x i8] }
5 %struct.timespec = type { i64, i64 }
6 %union.pthread_mutexattr_t = type { [4 x i8] }
7 %union.pthread_cond_t = type { [48 x i8] }
8
9 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once
10 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific
11 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific
12 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
13 @_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join
14 @_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal
15 @_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self
16 @_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach
17 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel
18 @_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield
19 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
20 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
21 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
22 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
23 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
24 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
25 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
26 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal
27 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
28 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
29 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
30 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create
31 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete
32 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
33 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
34 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
35
36 declare extern_weak i32 @pthread_once(i32*, void ()*)
37
38 declare extern_weak i8* @pthread_getspecific(i32)
39
40 declare extern_weak i32 @pthread_setspecific(i32, i8*)
41
42 declare extern_weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)
43
44 declare extern_weak i32 @pthread_join(i64, i8**)
45
46 declare extern_weak i32 @pthread_equal(i64, i64)
47
48 declare extern_weak i64 @pthread_self()
49
50 declare extern_weak i32 @pthread_detach(i64)
51
52 declare extern_weak i32 @pthread_cancel(i64)
53
54 declare extern_weak i32 @sched_yield()
55
56 declare extern_weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*)
57
58 declare extern_weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*)
59
60 declare extern_weak i32 @pthread_mutex_timedlock(%union.pthread_mutex_t*, %struct.timespec*)
61
62 declare extern_weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*)
63
64 declare extern_weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)
65
66 declare extern_weak i32 @pthread_mutex_destroy(%union.pthread_mutex_t*)
67
68 declare extern_weak i32 @pthread_cond_broadcast(%union.pthread_cond_t*)
69
70 declare extern_weak i32 @pthread_cond_signal(%union.pthread_cond_t*)
71
72 declare extern_weak i32 @pthread_cond_wait(%union.pthread_cond_t*, %union.pthread_mutex_t*)
73
74 declare extern_weak i32 @pthread_cond_timedwait(%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)
75
76 declare extern_weak i32 @pthread_cond_destroy(%union.pthread_cond_t*)
77
78 declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*)
79
80 declare extern_weak i32 @pthread_key_delete(i32)
81
82 declare extern_weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*)
83
84 declare extern_weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32)
85
86 declare extern_weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*)
87
88 declare void @_GLOBAL__sub_I__ZN10BitBoard64coEv() nounwind uwtable
+0
-146
test/Linker/2011-08-22-ResolveAlias2.ll less more
None ; This file is used by 2011-08-22-ResolveAlias.ll
1 ; RUN: true
2
3 %struct.HexxagonBoard = type { %struct.BitBoard64, %struct.BitBoard64 }
4 %struct.BitBoard64 = type { i32, i32 }
5 %union.pthread_attr_t = type { [56 x i8] }
6 %union.pthread_mutex_t = type { [40 x i8] }
7 %struct.timespec = type { i64, i64 }
8 %union.pthread_mutexattr_t = type { [4 x i8] }
9 %union.pthread_cond_t = type { [48 x i8] }
10
11 @_ZN13HexxagonBoardC1ERKS_ = alias void (%struct.HexxagonBoard*, %struct.HexxagonBoard*)* @_ZN13HexxagonBoardC2ERKS_
12 @_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once
13 @_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific
14 @_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific
15 @_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create
16 @_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join
17 @_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal
18 @_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self
19 @_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach
20 @_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel
21 @_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield
22 @_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock
23 @_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock
24 @_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock
25 @_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock
26 @_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init
27 @_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy
28 @_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast
29 @_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal
30 @_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait
31 @_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait
32 @_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy
33 @_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create
34 @_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete
35 @_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init
36 @_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype
37 @_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy
38
39 define void @_ZN13HexxagonBoardC2ERKS_(%struct.HexxagonBoard*, %struct.HexxagonBoard*) uwtable align 2 {
40 ret void
41 }
42
43 define weak i32 @pthread_once(i32*, void ()*) {
44 ret i32 0
45 }
46
47 define weak i8* @pthread_getspecific(i32) {
48 ret i8* null
49 }
50
51 define weak i32 @pthread_setspecific(i32, i8*) {
52 ret i32 0
53 }
54
55 define weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) {
56 ret i32 0
57 }
58
59 define weak i32 @pthread_join(i64, i8**) {
60 ret i32 0
61 }
62
63 define weak i32 @pthread_equal(i64, i64) {
64 ret i32 0
65 }
66
67 define weak i64 @pthread_self() {
68 ret i64 0
69 }
70
71 define weak i32 @pthread_detach(i64) {
72 ret i32 0
73 }
74
75 define weak i32 @pthread_cancel(i64) {
76 ret i32 0
77 }
78
79 define weak i32 @sched_yield() {
80 ret i32 0
81 }
82
83 define weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) {
84 ret i32 0
85 }
86
87 define weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) {
88 ret i32 0
89 }
90
91 define weak i32 @pthread_mutex_timedlock(%union.pthread_mutex_t*, %struct.timespec*) {
92 ret i32 0
93 }
94
95 define weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) {
96 ret i32 0
97 }
98
99 define weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) {
100 ret i32 0
101 }
102
103 define weak i32 @pthread_mutex_destroy(%union.pthread_mutex_t*) {
104 ret i32 0
105 }
106
107 define weak i32 @pthread_cond_broadcast(%union.pthread_cond_t*) {
108 ret i32 0
109 }
110
111 define weak i32 @pthread_cond_signal(%union.pthread_cond_t*) {
112 ret i32 0
113 }
114
115 define weak i32 @pthread_cond_wait(%union.pthread_cond_t*, %union.pthread_mutex_t*) {
116 ret i32 0
117 }
118
119 define weak i32 @pthread_cond_timedwait(%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*) {
120 ret i32 0
121 }
122
123 define weak i32 @pthread_cond_destroy(%union.pthread_cond_t*) {
124 ret i32 0
125 }
126
127 define weak i32 @pthread_key_create(i32*, void (i8*)*) {
128 ret i32 0
129 }
130
131 define weak i32 @pthread_key_delete(i32) {
132 ret i32 0
133 }
134
135 define weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) {
136 ret i32 0
137 }
138
139 define weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) {
140 ret i32 0
141 }
142
143 define weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) {
144 ret i32 0
145 }
0 ; RUN: not llvm-link -o /dev/null %s 2>&1 | FileCheck %s
1
2 ; CHECK: input module '{{.*}}broken.ll' is broken
3 define i32 @foo(i32 %v) {
4 %first = add i32 %v, %second
5 %second = add i32 %v, 3
6 ret i32 %first
7 }
11 ; RUN: true
22
33 !0 = !{i32 3, !"foo", !{!"bar", i32 42}}
4 !1 = !{i32 1, !"bar", i32 42}
45
5 !llvm.module.flags = !{ !0 }
6 !llvm.module.flags = !{ !0, !1 }
11 ; RUN: true
22
33 !0 = !{i32 3, !"foo", !{!"bar", i32 42}}
4 !1 = !{i32 2, !"bar", i32 42}
45
5 !llvm.module.flags = !{ !0 }
6 !llvm.module.flags = !{ !0, !1 }
111111 return 1;
112112 }
113113
114 if (verifyModule(*M)) {
115 errs() << argv[0] << ": input module '" << InputFilenames[i]
116 << "' is broken!\n";
117 return 1;
118 }
119
114120 if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n";
115121
116122 if (L.linkInModule(M.get()))