brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 0ee9edb Raw
56 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t && mkdir -p %t3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o4# RUN: %lld -o %t/executable %t/test.o5# RUN: %lld -execute -o %t/explicit-executable %t/test.o6# RUN: %lld -bundle -o %t/bundle %t/test.o7# RUN: %lld -dylib -o %t/dylib %t/test.o8 9## These load commands should be in every final output binary.10# COMMON-DAG: cmd LC_DYLD_INFO_ONLY11# COMMON-DAG: cmd LC_SYMTAB12# COMMON-DAG: cmd LC_DYSYMTAB13# COMMON-DAG: cmd LC_UUID14 15## Check for the presence of load commands that are essential for a working16## executable. Also check that it has the right filetype.17# RUN: llvm-objdump --macho --all-headers %t/executable | FileCheck %s --check-prefix=COMMON18# RUN: llvm-objdump --macho --all-headers %t/executable | FileCheck %s --check-prefix=EXEC19# RUN: llvm-objdump --macho --all-headers %t/explicit-executable | FileCheck %s --check-prefix=COMMON20# RUN: llvm-objdump --macho --all-headers %t/explicit-executable | FileCheck %s --check-prefix=EXEC21# EXEC:      magic        cputype cpusubtype  caps    filetype22# EXEC-NEXT: MH_MAGIC_64  X86_64         ALL  {{.*}}  EXECUTE23# EXEC-DAG:  cmd LC_MAIN24# EXEC-DAG:  cmd LC_LOAD_DYLINKER25 26## Check for the absence of load commands that should not be in an executable.27# RUN: llvm-objdump --macho --all-headers %t/executable | FileCheck %s --check-prefix=NEXEC28# NEXEC-NOT: cmd: LC_ID_DYLIB29 30## Check for the presence / absence of load commands for the dylib.31# RUN: llvm-objdump --macho --all-headers %t/dylib | FileCheck %s --check-prefix=COMMON32# RUN: llvm-objdump --macho --all-headers %t/dylib | FileCheck %s --check-prefix=DYLIB33# DYLIB:      magic        cputype cpusubtype  caps    filetype34# DYLIB-NEXT: MH_MAGIC_64  X86_64         ALL  {{.*}}  DYLIB35# DYLIB:      cmd LC_ID_DYLIB36 37# RUN: llvm-objdump --macho --all-headers %t/bundle | FileCheck %s --check-prefix=NDYLIB38# NDYLIB-NOT: cmd: LC_MAIN39# NDYLIB-NOT: cmd: LC_LOAD_DYLINKER40 41## Check for the presence / absence of load commands for the bundle.42# RUN: llvm-objdump --macho --all-headers %t/bundle | FileCheck %s --check-prefix=COMMON43# RUN: llvm-objdump --macho --all-headers %t/bundle | FileCheck %s --check-prefix=BUNDLE44# BUNDLE:      magic        cputype cpusubtype  caps    filetype45# BUNDLE-NEXT: MH_MAGIC_64  X86_64         ALL  {{.*}}  BUNDLE46 47# RUN: llvm-objdump --macho --all-headers %t/bundle | FileCheck %s --check-prefix=NBUNDLE48# NBUNDLE-NOT: cmd: LC_MAIN49# NBUNDLE-NOT: cmd: LC_LOAD_DYLINKER50 51.text52.global _main53_main:54  mov $0, %rax55  ret56