2 # RUN: rm -rf %t; split-file %s %t
4 ## Test that a weak symbol in a direct .o file wins over
5 ## a weak symbol in a .a file.
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o
10 # RUN: llvm-ar --format=darwin rcs %t/weakfoo.a %t/weakfoo.o
12 # PREFER-DIRECT-OBJECT-NOT: O __TEXT,weak __foo
14 # RUN: %lld -lSystem -o %t/out %t/weakfoo.a %t/test.o
15 # RUN: llvm-objdump --syms %t/out | FileCheck %s --check-prefix=PREFER-DIRECT-OBJECT
23 .weak_definition __foo
28 .subsections_via_symbols
32 .weak_definition __foo
38 # This pulls in weakfoo.a due to the __baz undef, but __foo should
39 # still be resolved against the weak symbol in this file.
44 .subsections_via_symbols