Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / static-link.s
blobc3760f13af9532a2c01c6a052683edcf75ed87d4
1 # REQUIRES: x86
3 # RUN: mkdir -p %t
5 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libgoodbye.s -o %t/goodbye.o
6 # RUN: llvm-ar --format=darwin crs %t/libgoodbye.a %t/goodbye.o
8 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o
9 # RUN: %lld -o %t/test -L%t -lgoodbye %t/test.o
11 # RUN: llvm-objdump --syms -d -r %t/test | FileCheck %s
13 # CHECK: SYMBOL TABLE:
14 # CHECK: {{0+}}[[ADDR:[0-9a-f]+]] g O __TEXT,__cstring _goodbye_world
16 # CHECK: Disassembly of section __TEXT,__text
17 # CHECK-LABEL: <_main>:
18 # CHECK: leaq {{.*}}(%rip), %rsi ## 0x[[ADDR]] <_goodbye_world>
20 .section __TEXT,__text
21 .global _main
23 _main:
24 movl $0x2000004, %eax # write()
25 mov $1, %rdi # stdout
26 leaq _goodbye_world(%rip), %rsi
27 mov $15, %rdx # length
28 syscall
29 mov $0, %rax
30 ret