brintos

brintos / llvm-project-archived public Read only

0
0
Text · 969 B · dd8ab86 Raw
45 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4## Test that a weak symbol in a direct .o file wins over5## a weak symbol in a .a file.6 7# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o9 10# RUN: llvm-ar --format=darwin rcs %t/weakfoo.a %t/weakfoo.o11 12# PREFER-DIRECT-OBJECT-NOT: O __TEXT,weak __foo13 14# RUN: %lld -lSystem -o %t/out %t/weakfoo.a %t/test.o15# RUN: llvm-objdump --syms %t/out | FileCheck %s --check-prefix=PREFER-DIRECT-OBJECT16 17#--- weakfoo.s18.globl __baz19__baz:20  ret21 22.section __TEXT,weak23.weak_definition __foo24.globl __foo25__foo:26  ret27 28.subsections_via_symbols29 30#--- test.s31.globl __foo32.weak_definition __foo33__foo:34  ret35 36.globl _main37_main:38  # This pulls in weakfoo.a due to the __baz undef, but __foo should39  # still be resolved against the weak symbol in this file.40  callq __baz41  callq __foo42  ret43 44.subsections_via_symbols45