Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / strip-all.s
blobee788c69c994f1a84e42ba7fd56eb93ab577dfdf
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 # RUN: ld.lld %t.o -o %t1
5 #RUN: llvm-objdump --section-headers %t1 | FileCheck %s --check-prefix BEFORE
6 #BEFORE: .symtab
7 #BEFORE-NEXT: .shstrtab
8 #BEFORE-NEXT: .strtab
10 #RUN: ld.lld %t.o --strip-all -o %t1
11 #RUN: llvm-objdump --section-headers %t1 | FileCheck %s --check-prefix AFTER
12 #AFTER-NOT: .symtab
13 #AFTER: .shstrtab
14 #AFTER-NOT: .strtab
16 # Ignore --strip-all if -r is specified
17 #RUN: ld.lld %t.o --strip-all -r -o %t1
18 #RUN: llvm-objdump --section-headers %t1 | FileCheck %s --check-prefix BEFORE
20 # Test alias -s
21 #RUN: ld.lld %t.o -s -o %t1
22 #RUN: llvm-objdump --section-headers %t1 | FileCheck %s --check-prefix AFTER
24 # RUN: not ld.lld %t.o --strip-all --emit-relocs -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
25 # ERR: error: --strip-all and --emit-relocs may not be used together
27 # exits with return code 42 on linux
28 .globl _start
29 _start:
30 mov $60, %rax
31 mov $42, %rdi
32 syscall