Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / merge.s
blob4cba53fb47a329686a6fa1495094885aa5164a52
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/merge.s -o %t2.o
4 // RUN: ld.lld %t.o %t2.o -o %t
5 // RUN: llvm-readelf -S -s -x .mysec %t | FileCheck %s
6 // RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
8 // CHECK: Name Type Address Off Size ES Flg Lk Inf Al
9 // CHECK: .mysec PROGBITS 0000000000200120 000120 000008 04 AM 0 0 4
11 // CHECK-DAG: 0000000000200120 0 NOTYPE LOCAL DEFAULT 1 bar
12 // CHECK-DAG: 0000000000200120 0 NOTYPE LOCAL DEFAULT 1 zed
13 // CHECK-DAG: 0000000000200120 0 NOTYPE LOCAL HIDDEN 1 foo
15 // CHECK: Hex dump of section '.mysec':
16 // CHECK-NEXT: 0x00200120 42000000 10000000
18 .section .mysec,"aM",@progbits,4
19 .align 4
20 .global foo
21 .hidden foo
22 .long 0x10
23 foo:
24 .long 0x42
25 bar:
26 .long 0x42
27 zed:
28 .long 0x42
30 .text
31 .globl _start
32 _start:
33 // DISASM: Disassembly of section .text:
34 // DISASM-EMPTY:
35 // DISASM-NEXT: <_start>:
37 movl .mysec, %eax
38 // addr(0x10)
39 // DISASM-NEXT: movl 0x200124, %eax
41 movl .mysec+7, %eax
42 // addr(0x42) + 3
43 // DISASM-NEXT: movl 0x200123, %eax
45 movl .mysec+8, %eax
46 // addr(0x42)
47 // DISASM-NEXT: movl 0x200120, %eax
49 movl bar+7, %eax
50 // addr(0x42) + 3
51 // DISASM-NEXT: movl 0x200127, %eax
53 movl bar+8, %eax
54 // addr(0x42)
55 // DISASM-NEXT: movl 0x200128, %eax
57 movl foo, %eax
58 // addr(0x42)
59 // DISASM-NEXT: movl 0x200120, %eax
61 movl foo+7, %eax
62 // addr(0x42) + 7
63 // DISASM-NEXT: movl 0x200127, %eax
65 movl foo+8, %eax
66 // addr(0x42) + 8
67 // DISASM-NEXT: movl 0x200128, %eax
69 // From the other file: movl .mysec, %eax
70 // addr(0x42)
71 // DISASM-NEXT: movl 0x200120, %eax