2018-01-24 11:29:47 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o %t.o
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: wasm-ld --relocatable -o %t.wasm %t.o
|
2017-12-06 04:38:22 +08:00
|
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
|
2018-05-11 01:59:41 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2018-01-24 11:29:47 +08:00
|
|
|
|
2017-12-06 04:38:22 +08:00
|
|
|
; Function Attrs: nounwind
|
2018-01-23 05:55:43 +08:00
|
|
|
define i32 @_start() local_unnamed_addr {
|
2017-12-06 04:38:22 +08:00
|
|
|
entry:
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: --- !WASM
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: FileHeader:
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: Version: 0x00000001
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Sections:
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: TYPE
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Signatures:
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Index: 0
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: ParamTypes:
|
2019-10-19 04:27:30 +08:00
|
|
|
; CHECK-NEXT: ReturnTypes:
|
|
|
|
; CHECK-NEXT: - I32
|
2018-01-23 05:55:43 +08:00
|
|
|
; CHECK-NEXT: - Type: IMPORT
|
2018-01-24 08:22:53 +08:00
|
|
|
; CHECK-NEXT: Imports:
|
2018-01-23 05:55:43 +08:00
|
|
|
; CHECK-NEXT: - Module: env
|
|
|
|
; CHECK-NEXT: Field: __stack_pointer
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
|
|
|
; CHECK-NEXT: GlobalType: I32
|
2018-02-23 13:08:53 +08:00
|
|
|
; CHECK-NEXT: GlobalMutable: true
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: FUNCTION
|
2018-01-23 05:55:43 +08:00
|
|
|
; CHECK-NEXT: FunctionTypes: [ 0 ]
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: TABLE
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Tables:
|
2019-01-08 14:25:55 +08:00
|
|
|
; CHECK-NEXT: - ElemType: FUNCREF
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Limits:
|
2017-12-14 08:34:25 +08:00
|
|
|
; CHECK-NEXT: Flags: [ HAS_MAX ]
|
2018-01-25 05:37:30 +08:00
|
|
|
; CHECK-NEXT: Initial: 0x00000001
|
|
|
|
; CHECK-NEXT: Maximum: 0x00000001
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: MEMORY
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Memories:
|
2018-01-23 05:55:43 +08:00
|
|
|
; CHECK-NEXT: - Initial: 0x00000000
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: CODE
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Relocations:
|
2019-02-05 01:49:33 +08:00
|
|
|
; CHECK-NEXT: - Type: R_WASM_GLOBAL_INDEX_LEB
|
2018-03-01 01:20:51 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: Offset: 0x00000004
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Functions:
|
2018-01-10 05:47:36 +08:00
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Locals:
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: Body: 23808080800041106B1A41000B
|
|
|
|
; CHECK-NEXT: - Type: CUSTOM
|
|
|
|
; CHECK-NEXT: Name: linking
|
2019-01-16 09:43:21 +08:00
|
|
|
; CHECK-NEXT: Version: 2
|
2018-02-23 13:08:53 +08:00
|
|
|
; CHECK-NEXT: SymbolTable:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
|
|
|
; CHECK-NEXT: Name: _start
|
|
|
|
; CHECK-NEXT: Flags: [ ]
|
|
|
|
; CHECK-NEXT: Function: 0
|
2018-03-01 01:20:51 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
|
|
|
; CHECK-NEXT: Name: __stack_pointer
|
|
|
|
; CHECK-NEXT: Flags: [ UNDEFINED ]
|
|
|
|
; CHECK-NEXT: Global: 0
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Type: CUSTOM
|
|
|
|
; CHECK-NEXT: Name: name
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: FunctionNames:
|
2017-12-06 04:38:22 +08:00
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Name: _start
|
|
|
|
; CHECK-NEXT: ...
|