Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / wasm / name-section-mangling.s
bloba24fbc747d76ebc130fd33a1c318adcda8d778e8
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.
10 .globl _start
11 .globl _Z3fooi
12 .weak _Z3bari
14 .functype _Z3bari (i32) -> ()
16 _Z3fooi:
17 .functype _Z3fooi (i32) -> ()
18 end_function
20 _start:
21 .functype _start () -> ()
22 i32.const 1
23 call _Z3fooi
24 i32.const 1
25 call _Z3bari
26 end_function
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
42 # CHECK-NEXT: Locals:
43 # CHECK-NEXT: Body: 000B
44 # CHECK-NEXT: - Index: 1
45 # CHECK-NEXT: Locals:
46 # CHECK-NEXT: Body: 410110828080800041011080808080000B
47 # CHECK-NEXT: - Index: 2
48 # CHECK-NEXT: Locals:
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
64 # CHECK-NEXT: ...