36 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o3 4# RUN: %lld -dylib -install_name @executable_path/libfoo.dylib \5# RUN: %t.o -o %t.dylib6# RUN: llvm-objdump --macho --dylib-id %t.dylib | FileCheck %s7# CHECK: @executable_path/libfoo.dylib8 9## If we are building a dylib, we shouldn't error out even if we are passed10## a flag for a missing entry symbol (since dylibs don't have entry symbols).11## Also check that we come up with the right install name if one isn't12## specified.13# RUN: %lld -dylib %t.o -o %t.defaultInstallName.dylib -e missing_entry14# RUN: obj2yaml %t.defaultInstallName.dylib | FileCheck %s -DOUTPUT=%t.defaultInstallName.dylib --check-prefix=DEFAULT-INSTALL-NAME15# DEFAULT-INSTALL-NAME: [[OUTPUT]]16 17## Check for the absence of load commands / segments that should not be in a18## dylib.19# RUN: llvm-objdump --macho --all-headers %t.dylib | FileCheck %s --check-prefix=NCHECK20# NCHECK-NOT: cmd LC_LOAD_DYLINKER21# NCHECK-NOT: cmd LC_MAIN22# NCHECK-NOT: segname __PAGEZERO23 24# RUN: llvm-objdump --syms --exports-trie %t.dylib | \25# RUN: FileCheck %s --check-prefix=EXPORTS26# EXPORTS-LABEL: SYMBOL TABLE:27# EXPORTS: [[#%x, HELLO_WORLD_ADDR:]] {{.*}} _hello_world28# EXPORTS-LABEL: Exports trie:29# EXPORTS: 0x{{0*}}[[#%X, HELLO_WORLD_ADDR]] _hello_world30 31.section __TEXT,__cstring32.globl _hello_world33 34_hello_world:35.asciz "Hello world!\n"36