File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,10 @@ bool ModuleLinker::run() {
526
526
if (linkIfNeeded (GA))
527
527
return true ;
528
528
529
+ for (GlobalIFunc &GI : SrcM->ifuncs ())
530
+ if (linkIfNeeded (GI))
531
+ return true ;
532
+
529
533
for (unsigned I = 0 ; I < ValuesToLink.size (); ++I) {
530
534
GlobalValue *GV = ValuesToLink[I];
531
535
const Comdat *SC = GV->getComdat ();
Original file line number Diff line number Diff line change
1
+ ; RUN: split-file %s %t
2
+ ; RUN: llvm-link %t/a.ll %t/b.ll -S -o - | FileCheck %s
3
+
4
+ ;; Check that ifuncs are linked in properly.
5
+
6
+ ; CHECK-DAG: @foo = ifunc void (), bitcast (void ()* ()* @foo_resolve to void ()*)
7
+ ; CHECK-DAG: define internal void ()* @foo_resolve() {
8
+
9
+ ; CHECK-DAG: @bar = ifunc void (), bitcast (void ()* ()* @bar_resolve to void ()*)
10
+ ; CHECK-DAG: define internal void ()* @bar_resolve() {
11
+
12
+ ;--- a.ll
13
+ declare void @bar ()
14
+
15
+ ;--- b.ll
16
+ @foo = ifunc void (), bitcast (void ()* ()* @foo_resolve to void ()*)
17
+ @bar = ifunc void (), bitcast (void ()* ()* @bar_resolve to void ()*)
18
+
19
+ define internal void ()* @foo_resolve () {
20
+ ret void ()* null
21
+ }
22
+
23
+ define internal void ()* @bar_resolve () {
24
+ ret void ()* null
25
+ }
You can’t perform that action at this time.
0 commit comments