Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / emit-relocs-icf2.s
blob87e4ef59a94a63579fa4fa96ce29e1704b946d5c
1 # REQUIRES: x86
3 ## On RELA targets, r_addend may be updated for --emit-relocs.
4 ## With ICF, merged sections do not have output sections assigned.
5 ## Test we don't crash.
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
8 # RUN: ld.lld --gc-sections --emit-relocs --icf=all %t.o -o %t
9 # RUN: llvm-readobj -r %t | FileCheck %s
11 # CHECK: Relocations [
12 # CHECK-NEXT: Section (3) .rela.text {
13 # CHECK-NEXT: R_X86_64_64 .text 0x11
14 # CHECK-NEXT: R_X86_64_64 .text 0x11
15 # CHECK-NEXT: R_X86_64_64 .rodata 0x0
16 # CHECK-NEXT: }
17 # CHECK-NEXT: ]
19 .rodata
20 quux:
21 .quad 0xfe
23 .section .text.foo,"ax"
24 foo:
25 .quad quux
27 .section .text.bar,"ax"
28 bar:
29 .quad quux
31 .section .text.baz,"ax"
32 baz:
33 .quad quux
35 .text
36 .quad foo
37 .quad bar
39 .global _start
40 _start:
41 nop