brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · ff677a9 Raw
55 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4## This test demonstrates that when an archive file is fetched, its symbols5## always override any conflicting dylib symbols, regardless of any weak6## definition flags.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/libfoo.s -o %t/libfoo.o10# RUN: %lld -dylib -install_name @executable_path/libfoo.dylib %t/libfoo.o -o %t/libfoo.dylib11 12# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o13# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o14# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o15 16# RUN: llvm-ar --format=darwin rcs %t/foo.a %t/foo.o17# RUN: llvm-ar --format=darwin rcs %t/weakfoo.a %t/weakfoo.o18 19# PREFER-WEAK-OBJECT: O __TEXT,weak _foo20# PREFER-NONWEAK-OBJECT: O __TEXT,nonweak _foo21 22# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-ar -L%t -lfoo %t/weakfoo.a %t/test.o23# RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT24# RUN: %lld -lSystem -o %t/weak-ar-nonweak-dylib -L%t %t/weakfoo.a -lfoo %t/test.o25# RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT26 27# RUN: %lld -lSystem -o %t/weak-obj-nonweak-dylib -L%t %t/weakfoo.o -lfoo %t/test.o28# RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-obj-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT29# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-obj -L%t -lfoo %t/weakfoo.o %t/test.o30# RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-obj | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT31 32#--- libfoo.s33.globl _foo34_foo:35 36#--- foo.s37.globl _foo, _bar38.section __TEXT,nonweak39_bar:40_foo:41 42#--- weakfoo.s43.globl _foo, _bar44.weak_definition _foo45.section __TEXT,weak46_bar:47_foo:48 49#--- test.s50.globl _main51_main:52  callq _foo53  callq _bar54  ret55