1# REQUIRES: x86 2 3# RUN: rm -rf %t; split-file %s %t 4 5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/basic.s -o %t/basic.o 6# RUN: %lld -lSystem %t/basic.o -o %t/basic 7# RUN: llvm-objdump --syms %t/basic > %t/objdump 8# RUN: llvm-objdump --macho --function-starts %t/basic >> %t/objdump 9# RUN: FileCheck %s --check-prefix=BASIC < %t/objdump 10 11# BASIC-LABEL: SYMBOL TABLE: 12# BASIC-NEXT: [[#%x,MAIN:]] g F __TEXT,__text _main 13# BASIC-NEXT: [[#%x,F1:]] g F __TEXT,__text _f1 14# BASIC-NEXT: [[#%x,F2:]] g F __TEXT,__text _f2 15# BASIC-LABEL: basic: 16# BASIC: [[#F1]] 17# BASIC: [[#F2]] 18# BASIC: [[#MAIN]] 19 20# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/alias.s -o %t/alias.o 21# RUN: %lld -lSystem %t/alias.o -o %t/alias 22# RUN: llvm-objdump --syms %t/alias > %t/objdump 23# RUN: llvm-objdump --macho --function-starts %t/alias >> %t/objdump 24# RUN: FileCheck %s --check-prefix=ALIAS < %t/objdump 25 26# ALIAS-LABEL: SYMBOL TABLE: 27# ALIAS-NEXT: [[#%x,F2:]] l F __TEXT,__text _f2 28# ALIAS-NEXT: [[#%x,MAIN:]] g F __TEXT,__text _main 29# ALIAS-NEXT: [[#%x,F1:]] g F __TEXT,__text _f1 30# ALIAS-LABEL: alias: 31# ALIAS: [[#F1]] 32# ALIAS: [[#MAIN]] 33 34# RUN: %lld %t/basic.o -no_function_starts -o %t/basic-no-function-starts 35# RUN: llvm-objdump --macho --function-starts %t/basic-no-function-starts | FileCheck %s --check-prefix=NO-FUNCTION-STARTS 36# NO-FUNCTION-STARTS: basic-no-function-starts: 37# NO-FUNCTION-STARTS-EMPTY: 38 39# RUN: %lld -lSystem %t/basic.o -no_function_starts -function_starts -o %t/basic-explicit 40# RUN: llvm-objdump --syms %t/basic > %t/objdump 41# RUN: llvm-objdump --macho --function-starts %t/basic >> %t/objdump 42# RUN: FileCheck %s --check-prefix=BASIC < %t/objdump 43 44#--- basic.s 45.section __TEXT,__text,regular,pure_instructions 46.globl _f1 47.globl _f2 48.globl _main 49_f1: 50 retq 51_f2: 52 retq 53_main: 54 retq 55 56#--- alias.s 57.section __TEXT,__text,regular,pure_instructions 58.globl _f1 59.equiv _f2, _f1 60.globl _main 61_f1: 62 retq 63_main: 64 retq 65