1# REQUIRES: x86 2# RUN: split-file %s %t 3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o 4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o 5# RUN: %lld -lSystem -dylib %t/foo.o -o %t/libfoo.dylib 6 7# RUN: %lld -weak-lSystem %t/test.o -weak_framework CoreFoundation -weak_library %t/libfoo.dylib -o %t/test 8# RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s -DDIR=%t 9 10# CHECK: cmd LC_LOAD_WEAK_DYLIB 11# CHECK-NEXT: cmdsize 12# CHECK-NEXT: name /usr/lib/libSystem.B.dylib 13 14# CHECK: cmd LC_LOAD_WEAK_DYLIB 15# CHECK-NEXT: cmdsize 16# CHECK-NEXT: name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 17 18# CHECK: cmd LC_LOAD_WEAK_DYLIB 19# CHECK-NEXT: cmdsize 20# CHECK-NEXT: name [[DIR]]/libfoo.dylib 21 22#--- foo.s 23.globl _foo 24_foo: 25 ret 26 27#--- test.s 28.globl _main 29.text 30_main: 31 ret 32