Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / arm-exidx-output.s
blob50e7820f2bdc6fadafd7198e8356449f3c8de00e
1 // REQUIRES: arm
2 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
3 // RUN: ld.lld %t.o -o %t
4 // RUN: llvm-readelf -S %t | FileCheck %s
6 // RUN: echo 'SECTIONS { .text.f1 : { *(.text.f1) } .text.f2 : { *(.text.f2) } }' > %t.lds
7 // RUN: ld.lld -T %t.lds %t.o -o %t1
8 // RUN: llvm-readelf -S %t1 | FileCheck --check-prefix=MULTI %s
10 // Check that only a single .ARM.exidx output section is created when
11 // there are input sections of the form .ARM.exidx.<section-name>. The
12 // assembler creates the .ARM.exidx input sections with the .cantunwind
13 // directive
15 // CHECK: [Nr] Name Type {{.*}} Flg Lk
16 // CHECK-NEXT: [ 0]
17 // CHECK-NEXT: [ 1] .ARM.exidx ARM_EXIDX {{.*}} AL 2
18 // CHECK-NEXT: [ 2] .text PROGBITS {{.*}} AX 0
20 // MULTI: [Nr] Name Type {{.*}} Flg Lk
21 // MULTI-NEXT: [ 0]
22 // MULTI-NEXT: [ 1] .ARM.exidx ARM_EXIDX {{.*}} AL 2
23 // MULTI-NEXT: [ 2] .text.f1 PROGBITS {{.*}} AX 0
24 // MULTI-NEXT: [ 3] .text.f2 PROGBITS {{.*}} AX 0
25 // MULTI-NEXT: [ 4] .text PROGBITS {{.*}} AX 0
27 .syntax unified
28 .section .text, "ax",%progbits
29 .globl _start
30 _start:
31 .fnstart
32 bx lr
33 .cantunwind
34 .fnend
36 .section .text.f1, "ax", %progbits
37 .globl f1
38 f1:
39 .fnstart
40 bx lr
41 .cantunwind
42 .fnend
44 .section .text.f2, "ax", %progbits
45 .globl f2
46 f2:
47 .fnstart
48 bx lr
49 .cantunwind
50 .fnend