Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / wasm / merge-func-attr-section.s
blob0615778216558220884c95ebff193e0c8df91215
1 # RUN: split-file %s %t
2 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %t/a.s -o %t1.o
3 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %t/b.s -o %t2.o
4 # RUN: wasm-ld -o %t.wasm %t1.o %t2.o
5 # RUN: obj2yaml %t.wasm | FileCheck %s
7 # Ensure two custom funct_attr sections are concatenated together.
9 # CHECK: - Type: CUSTOM
10 # CHECK-NEXT: Name: llvm.func_attr.custom0
11 # CHECK-NEXT: Payload: '000000000100000003000000'
13 #--- a.s
15 # Function index 3 (after linking)
16 .functype baz () -> ()
17 # Function index 1
18 .functype foo () -> ()
19 # Function index 2
20 .functype bar () -> ()
21 .functype _start () -> ()
22 .globl foo
23 .type foo,@function
24 foo:
25 .functype foo () -> ()
26 end_function
28 .globl bar
29 .type bar,@function
30 bar:
31 .functype bar () -> ()
32 end_function
34 .globl _start
35 .type _start,@function
36 _start:
37 .functype _start () -> ()
38 call foo
39 call bar
40 call baz
41 end_function
43 .section .custom_section.llvm.func_attr.custom0,"",@
44 .int32 foo@FUNCINDEX
45 .int32 bar@FUNCINDEX
47 #--- b.s
48 .functype baz () -> ()
49 .globl baz
50 .type baz,@function
51 baz:
52 .functype baz () -> ()
53 end_function
55 .section .custom_section.llvm.func_attr.custom0,"",@
56 .int32 baz@FUNCINDEX