brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · cf8992d Raw
62 lines · plain
1; REQUIRES: x862; RUN: rm -rf %t; split-file %s %t3 4; RUN: opt %t/f.ll -o %t/f.o5; RUN: llvm-ar rcs %t/libf.a %t/f.o6; RUN: llc -filetype=obj %t/q.ll -o %t/q.o7; RUN: llvm-ar rcs %t/libq.a %t/q.o8; RUN: llc -filetype=obj %t/m.ll -o %t/m.o9 10; RUN: %no-fatal-warnings-lld -dylib -lSystem -L%t %t/libf.a %t/m.o -o %t/test.out 2>&1 | FileCheck %s11 12; We can't read symbols that are set by module asm in the bitcode's symbol table.13; LTO internalizes `odr` in `f.ll`, and thus the prevailing `odr` remains unresolved.14; `q.ll` is loaded after LTO is finished during post-processing LC linker options.15; The unresolved prevailing `odr` is now resolved with `q.ll`.16 17; CHECK: warning: The pending prevailing symbol(_odr) in the bitcode file({{.*}}libf.a(f.o)) is overridden by a post-processed native object (from native archive): {{.*}}libq.a(q.o)18 19;--- f.ll20target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"21target triple = "x86_64-apple-macosx10.15.0"22 23!0 = !{!"-lq"}24!llvm.linker.options = !{!0}25 26define i64 @f()  {27  %1 = call i64 @odr()28  %2 = call i64 @q()29  %3 = add i64 %1, %230  ret i64 %331}32 33define weak hidden i64 @odr() noinline {34  ret i64 135}36 37declare i64 @q()38 39;--- q.ll40target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"41target triple = "x86_64-apple-macosx10.15.0"42 43define i64 @q() {44  %1 = call i64 @odr()45  ret i64 %146}47 48define linkonce_odr hidden i64 @odr() noinline {49  ret i64 250}51 52;--- m.ll53target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"54target triple = "x86_64-apple-macosx10.15.0"55 56declare i64 @f()57 58define i64 @m() {59  %1 = call i64 @f()60  ret i64 %161}62