2018-03-13 21:30:04 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o %t.o
|
2018-09-28 05:06:25 +08:00
|
|
|
; RUN: wasm-ld --export=_Z3fooi --demangle -o %t_demangle.wasm %t.o
|
2018-11-10 00:57:41 +08:00
|
|
|
; RUN: obj2yaml %t_demangle.wasm | FileCheck --check-prefixes=CHECK,DEMANGLE %s
|
2018-09-28 05:06:25 +08:00
|
|
|
; RUN: wasm-ld --export=_Z3fooi --no-demangle -o %t_nodemangle.wasm %t.o
|
2018-11-10 00:57:41 +08:00
|
|
|
; RUN: obj2yaml %t_nodemangle.wasm | FileCheck --check-prefixes=CHECK,MANGLE %s
|
2018-03-13 21:30:04 +08:00
|
|
|
|
2018-05-11 01:59:41 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2018-03-13 21:30:04 +08:00
|
|
|
|
|
|
|
; Check that the EXPORT name is still mangled, but that the "name" custom
|
|
|
|
; section contains the unmangled name.
|
|
|
|
|
|
|
|
define void @_Z3fooi(i32 %arg) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare extern_weak void @_Z3bari(i32 %arg)
|
|
|
|
|
|
|
|
define void @_start() {
|
|
|
|
call void @_Z3fooi(i32 1)
|
|
|
|
call void @_Z3bari(i32 1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: - Type: EXPORT
|
|
|
|
; CHECK-NEXT: Exports:
|
|
|
|
; CHECK-NEXT: - Name: memory
|
|
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-NEXT: Index: 0
|
|
|
|
; CHECK-NEXT: - Name: _Z3fooi
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2018-08-04 08:04:06 +08:00
|
|
|
; CHECK-NEXT: - Name: _start
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 2
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: - Type: CODE
|
|
|
|
; CHECK-NEXT: Functions:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Locals:
|
|
|
|
; CHECK-NEXT: Body: 000B
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: Locals:
|
|
|
|
; CHECK-NEXT: Body: 0B
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 2
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: Locals:
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Body: 410110818080800041011080808080000B
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: - Type: CUSTOM
|
|
|
|
; CHECK-NEXT: Name: name
|
|
|
|
; CHECK-NEXT: FunctionNames:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
2020-05-02 00:14:59 +08:00
|
|
|
; DEMANGLE-NEXT: Name: 'undefined_weak:bar(int)'
|
|
|
|
; MANGLE-NEXT: Name: 'undefined_weak:_Z3bari'
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
2018-11-10 00:57:41 +08:00
|
|
|
; DEMANGLE-NEXT: Name: 'foo(int)'
|
|
|
|
; MANGLE-NEXT: Name: _Z3fooi
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 2
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: Name: _start
|
2020-11-19 13:38:23 +08:00
|
|
|
; CHECK-NEXT: GlobalNames:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Name: __stack_pointer
|
2018-03-13 21:30:04 +08:00
|
|
|
; CHECK-NEXT: ...
|