Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / function-starts.s
blobae97b19a49ce94b8ae31cd984a4d537c077e6e07
1 # REQUIRES: x86
3 # RUN: rm -rf %t; split-file %s %t
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
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]]
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
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]]
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:
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
44 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/local.s -o %t/local.o
45 # RUN: %lld -lSystem %t/local.o -o %t/local
46 # RUN: llvm-objdump --syms %t/local > %t/objdump
47 # RUN: llvm-objdump --macho --function-starts %t/local >> %t/objdump
48 # RUN: FileCheck %s --check-prefix=LOCAL < %t/objdump
50 # LOCAL-LABEL: SYMBOL TABLE:
51 # LOCAL-NEXT: [[#%x,F1:]] l F __TEXT,__text +[Foo bar]
52 # LOCAL-NEXT: [[#%x,F2:]] l F __TEXT,__text _foo
53 # LOCAL: [[#%x,F3:]] g F __TEXT,__text _main
54 # LOCAL-LABEL: local:
55 # LOCAL: [[#F1]]
56 # LOCAL: [[#F2]]
57 # LOCAL: [[#F3]]
59 #--- basic.s
60 .section __TEXT,__text,regular,pure_instructions
61 .globl _f1
62 .globl _f2
63 .globl _main
64 _f1:
65 retq
66 _f2:
67 retq
68 _main:
69 retq
71 #--- alias.s
72 .section __TEXT,__text,regular,pure_instructions
73 .globl _f1
74 .equiv _f2, _f1
75 .globl _main
76 _f1:
77 retq
78 _main:
79 retq
81 #--- local.s
82 .section __TEXT,__text
83 "+[Foo bar]":
84 retq
86 _foo:
87 retq
89 .globl _main
90 _main:
91 retq