1 # RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
2 # RUN: wasm-ld --export=_Z3fooi --demangle -o %t_demangle.wasm %t.o
3 # RUN: obj2yaml %t_demangle.wasm | FileCheck --check-prefixes=CHECK,DEMANGLE %s
4 # RUN: wasm-ld --export=_Z3fooi --no-demangle -o %t_nodemangle.wasm %t.o
5 # RUN: obj2yaml %t_nodemangle.wasm | FileCheck --check-prefixes=CHECK,MANGLE %s
7 # Check that the EXPORT name is still mangled, but that the "name" custom
8 # section contains the unmangled name.
14 .functype _Z3bari (i32) -> ()
17 .functype _Z3fooi (i32) -> ()
21 .functype _start () -> ()
28 # CHECK: - Type: EXPORT
29 # CHECK-NEXT: Exports:
30 # CHECK-NEXT: - Name: memory
31 # CHECK-NEXT: Kind: MEMORY
32 # CHECK-NEXT: Index: 0
33 # CHECK-NEXT: - Name: _start
34 # CHECK-NEXT: Kind: FUNCTION
35 # CHECK-NEXT: Index: 1
36 # CHECK-NEXT: - Name: _Z3fooi
37 # CHECK-NEXT: Kind: FUNCTION
38 # CHECK-NEXT: Index: 2
39 # CHECK-NEXT: - Type: CODE
40 # CHECK-NEXT: Functions:
41 # CHECK-NEXT: - Index: 0
43 # CHECK-NEXT: Body: 000B
44 # CHECK-NEXT: - Index: 1
46 # CHECK-NEXT: Body: 410110828080800041011080808080000B
47 # CHECK-NEXT: - Index: 2
49 # CHECK-NEXT: Body: 0B
50 # CHECK-NEXT: - Type: CUSTOM
51 # CHECK-NEXT: Name: name
52 # CHECK-NEXT: FunctionNames:
53 # CHECK-NEXT: - Index: 0
54 # DEMANGLE-NEXT: Name: 'undefined_weak:bar(int)'
55 # MANGLE-NEXT: Name: 'undefined_weak:_Z3bari'
56 # CHECK-NEXT: - Index: 1
57 # CHECK-NEXT: Name: _start
58 # CHECK-NEXT: - Index: 2
59 # DEMANGLE-NEXT: Name: 'foo(int)'
60 # MANGLE-NEXT: Name: _Z3fooi
61 # CHECK-NEXT: GlobalNames:
62 # CHECK-NEXT: - Index: 0
63 # CHECK-NEXT: Name: __stack_pointer