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
11 .functype bar () -> (i32)
18 .functype write_global (i32) -> ()
20 global.set wasm_global
25 .functype _start () -> ()
30 .section .data.somedata,"",@
36 .section .bss.somezeroes,"",@
41 .section .debug_info,"",@
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 /