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 6 7bar: 8 .functype bar () -> () 9 i32.const somedata 10 end_function 11 12 .globl _start 13_start: 14 .functype _start () -> () 15 call bar 16 end_function 17 18.section .data.somedata,"",@ 19somedata: 20 .int32 123 21.size somedata, 4 22 23.section .debug_info,"",@ 24 .int32 bar 25 26# CHECK: Addr Off Size Out In Symbol 27# CHECK-NEXT: - 8 6 TYPE 28# CHECK-NEXT: - e 5 FUNCTION 29# CHECK-NEXT: - 13 7 TABLE 30# CHECK-NEXT: - 1a 5 MEMORY 31# CHECK-NEXT: - 1f a GLOBAL 32# CHECK-NEXT: - 29 15 EXPORT 33# CHECK-NEXT: - 3e 15 CODE 34# CHECK-NEXT: - 3f 9 {{.*}}{{/|\\}}map-file.s.tmp1.o:(bar) 35# CHECK-NEXT: - 3f 9 bar 36# CHECK-NEXT: - 48 9 {{.*}}{{/|\\}}map-file.s.tmp1.o:(_start) 37# CHECK-NEXT: - 48 9 _start 38# CHECK-NEXT: - 53 d DATA 39# CHECK-NEXT: 400 54 4 .data 40# CHECK-NEXT: 400 5a 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.data.somedata) 41# CHECK-NEXT: 400 5a 4 somedata 42# CHECK-NEXT: - 60 12 CUSTOM(.debug_info) 43# CHECK-NEXT: - 72 2b CUSTOM(name) 44 45# RUN: not wasm-ld %t1.o -o /dev/null -Map=/ 2>&1 \ 46# RUN: | FileCheck -check-prefix=FAIL %s 47# FAIL: wasm-ld: error: cannot open map file / 48