Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / wasm / map-file.s
blob2757f50187ffe5136e0608bb6617aeaee2b6744c
1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t1.o
2 # RUN: wasm-ld %t1.o -o %t -M | FileCheck --match-full-lines --strict-whitespace %s
3 # RUN: wasm-ld %t1.o -o %t -print-map | FileCheck --match-full-lines --strict-whitespace %s
4 # RUN: wasm-ld %t1.o -o %t -Map=%t.map
5 # RUN: FileCheck --match-full-lines --strict-whitespace %s < %t.map
7 .globaltype wasm_global, i32, immutable
8 wasm_global:
10 bar:
11 .functype bar () -> (i32)
12 i32.const somedata
13 i32.const somezeroes
14 drop
15 end_function
17 write_global:
18 .functype write_global (i32) -> ()
19 local.get 0
20 global.set wasm_global
21 end_function
23 .globl _start
24 _start:
25 .functype _start () -> ()
26 call bar
27 call write_global
28 end_function
30 .section .data.somedata,"",@
31 somedata:
32 .int32 123
33 .int32 bar
34 .size somedata, 8
36 .section .bss.somezeroes,"",@
37 somezeroes:
38 .int32 0
39 .size somezeroes, 4
41 .section .debug_info,"",@
42 .int32 bar
45 # CHECK: Addr Off Size Out In Symbol
46 # CHECK-NEXT: - 8 e TYPE
47 # CHECK-NEXT: - 16 6 FUNCTION
48 # CHECK-NEXT: - 1c 7 TABLE
49 # CHECK-NEXT: - 23 5 MEMORY
50 # CHECK-NEXT: - 28 f GLOBAL
51 # CHECK-NEXT: 0 0 0 __stack_pointer
52 # CHECK-NEXT: 1 0 0 wasm_global
53 # CHECK-NEXT: - 37 15 EXPORT
54 # CHECK-NEXT: - 4c 9 ELEM
55 # CHECK-NEXT: - 55 2d CODE
56 # CHECK-NEXT: - 56 10 {{.*}}{{/|\\}}map-file.s.tmp1.o:(bar)
57 # CHECK-NEXT: - 56 10 bar
58 # CHECK-NEXT: - 66 b {{.*}}{{/|\\}}map-file.s.tmp1.o:(write_global)
59 # CHECK-NEXT: - 66 b write_global
60 # CHECK-NEXT: - 71 f {{.*}}{{/|\\}}map-file.s.tmp1.o:(_start)
61 # CHECK-NEXT: - 71 f _start
62 # CHECK-NEXT: - 82 11 DATA
63 # CHECK-NEXT: 400 83 8 .data
64 # CHECK-NEXT: 400 89 8 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.data.somedata)
65 # CHECK-NEXT: 400 89 8 somedata
66 # CHECK-NEXT: 408 82 4 .bss
67 # CHECK-NEXT: 408 0 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.bss.somezeroes)
68 # CHECK-NEXT: 408 0 4 somezeroes
69 # CHECK-NEXT: - 93 12 CUSTOM(.debug_info)
70 # CHECK-NEXT: - a5 61 CUSTOM(name)
72 # RUN: not wasm-ld %t1.o -o /dev/null -Map=/ 2>&1 \
73 # RUN: | FileCheck -check-prefix=FAIL %s
74 # FAIL: wasm-ld: error: cannot open map file /