brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · c956922 Raw
49 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4## This test demonstrates that when we have two weak symbols of the same type,5## we pick the one whose containing file appears earlier in the command-line6## invocation.7 8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o9# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak1.s -o %t/weak1.o10# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak2.s -o %t/weak2.o11 12# RUN: %lld -lSystem -o %t/obj12 %t/weak1.o %t/weak2.o %t/test.o13# RUN: llvm-objdump --syms %t/obj12 | FileCheck %s --check-prefix=WEAK114# RUN: %lld -lSystem -o %t/obj21 %t/weak2.o %t/weak1.o %t/test.o15# RUN: llvm-objdump --syms %t/obj21 | FileCheck %s --check-prefix=WEAK216 17# WEAK1: O __TEXT,weak1 _foo18# WEAK2: O __TEXT,weak2 _foo19 20# RUN: %lld -dylib -install_name \21# RUN:   @executable_path/libweak1.dylib %t/weak1.o -o %t/libweak1.dylib22# RUN: %lld -dylib -install_name \23# RUN:   @executable_path/libweak2.dylib %t/weak2.o -o %t/libweak2.dylib24 25# RUN: %lld -lSystem -o %t/dylib12 -L%t -lweak1 -lweak2 %t/test.o26# RUN: llvm-objdump --macho --bind %t/dylib12 | FileCheck %s --check-prefix=DYLIB127# RUN: %lld -lSystem -o %t/dylib21 -L%t -lweak2 -lweak1 %t/test.o28# RUN: llvm-objdump --macho --bind %t/dylib21 | FileCheck %s --check-prefix=DYLIB229# DYLIB1: __DATA   __la_symbol_ptr    0x{{[0-9a-f]*}} pointer 0 libweak1         _foo30# DYLIB2: __DATA   __la_symbol_ptr    0x{{[0-9a-f]*}} pointer 0 libweak2         _foo31 32#--- weak1.s33.globl _foo34.weak_definition _foo35.section __TEXT,weak1;36_foo:37 38#--- weak2.s39.globl _foo40.weak_definition _foo41.section __TEXT,weak242_foo:43 44#--- test.s45.globl _main46_main:47  callq _foo48  ret49