1# REQUIRES: x86, shell 2# RUN: mkdir -p %t 3# RUN: echo ".globl _foo; _foo: ret" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/foo.o 4# RUN: mkdir -p %t/Foo.framework/Versions/A 5# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foo %t/foo.o -o %t/Foo.framework/Versions/A/Foo 6# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foobar %t/foo.o -o %t/Foo.framework/Versions/A/Foobar 7# RUN: ln -sf %t/Foo.framework/Versions/A %t/Foo.framework/Versions/Current 8# RUN: ln -sf %t/Foo.framework/Versions/Current/Foo %t/Foo.framework/Foo 9 10# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/test.o %s 11# RUN: %lld -lSystem -F%t -framework Foo %t/test.o -o %t/test 12# RUN: llvm-objdump --macho --lazy-bind %t/test | FileCheck %s --check-prefix=NOSUFFIX 13# NOSUFFIX: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} {{.*}}Foo _foo 14 15# RUN: %lld -lSystem -F%t -framework Foo,baz %t/test.o -o %t/test-wrong-suffix 16# RUN: llvm-objdump --macho --lazy-bind %t/test-wrong-suffix | FileCheck %s --check-prefix=NOSUFFIX 17 18# RUN: %lld -lSystem -F%t -framework Foo,bar %t/test.o -o %t/test-suffix 19# RUN: llvm-objdump --macho --lazy-bind %t/test-suffix | FileCheck %s --check-prefix=SUFFIX 20# SUFFIX: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} {{.*}}Foobar _foo 21 22.globl _main 23.text 24_main: 25 sub $8, %rsp # 16-byte-align the stack; dyld checks for this 26 callq _foo 27 mov $0, %rax 28 add $8, %rsp 29 ret 30