2 ; RUN: rm -rf %t; split-file %s %t
4 ; RUN: opt %t/f.ll -o %t/f.o
5 ; RUN: llvm-ar rcs %t/libf.a %t/f.o
6 ; RUN: llc -filetype=obj %t/q.ll -o %t/q.o
7 ; RUN: llvm-ar rcs %t/libq.a %t/q.o
8 ; RUN: llc -filetype=obj %t/m.ll -o %t/m.o
10 ; RUN: %no-fatal-warnings-lld -dylib -lSystem -L%t %t/libf.a %t/m.o -o %t/test.out 2>&1 | FileCheck %s
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`.
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)
20 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
21 target triple = "x86_64-apple-macosx10.15.0"
24 !llvm.linker.options = !{!0}
33 define weak hidden i64 @odr() noinline {
40 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
41 target triple = "x86_64-apple-macosx10.15.0"
48 define linkonce_odr hidden i64 @odr() noinline {
53 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
54 target triple = "x86_64-apple-macosx10.15.0"