2017-12-19 08:18:16 +08:00
|
|
|
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown-wasm %p/Inputs/hello.ll -o %t.hello.o
|
|
|
|
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-unknown-wasm %s -o %t.o
|
2017-12-09 01:58:25 +08:00
|
|
|
; RUN: lld -flavor wasm --emit-relocs --allow-undefined --no-entry -o %t.wasm %t.o %t.hello.o
|
2017-11-18 02:14:09 +08:00
|
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
|
|
|
|
@foo = hidden global i32 1, align 4
|
|
|
|
@aligned_bar = hidden global i32 3, align 16
|
|
|
|
|
|
|
|
@hello_str = external global i8*
|
|
|
|
@external_ref = global i8** @hello_str, align 8
|
|
|
|
|
|
|
|
; CHECK: - Type: GLOBAL
|
|
|
|
; CHECK-NEXT: Globals:
|
|
|
|
; CHECK-NEXT: - Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: true
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: InitExpr:
|
2017-11-18 02:14:09 +08:00
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 66608
|
|
|
|
; CHECK-NEXT: - Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: false
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
2017-12-12 05:52:21 +08:00
|
|
|
; CHECK-NEXT: Value: 1024
|
2017-11-18 02:14:09 +08:00
|
|
|
; CHECK-NEXT: - Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: false
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
2017-12-12 05:52:21 +08:00
|
|
|
; CHECK-NEXT: Value: 1040
|
2017-11-18 02:14:09 +08:00
|
|
|
; CHECK-NEXT: - Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: false
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
2017-12-12 05:52:21 +08:00
|
|
|
; CHECK-NEXT: Value: 1048
|
2017-11-18 02:14:09 +08:00
|
|
|
; CHECK-NEXT: - Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: false
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
2017-12-12 05:52:21 +08:00
|
|
|
; CHECK-NEXT: Value: 1052
|
2017-11-18 02:14:09 +08:00
|
|
|
|
|
|
|
; CHECK: - Type: DATA
|
|
|
|
; CHECK-NEXT: Relocations:
|
|
|
|
; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
|
2017-12-12 05:52:21 +08:00
|
|
|
; CHECK-NEXT: Index: 4
|
2017-11-18 02:14:09 +08:00
|
|
|
; CHECK-NEXT: Offset: 0x0000001F
|
|
|
|
; CHECK-NEXT: Segments:
|
|
|
|
; CHECK-NEXT: - SectionOffset: 7
|
|
|
|
; CHECK-NEXT: MemoryIndex: 0
|
|
|
|
; CHECK-NEXT: Offset:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 1024
|
|
|
|
; CHECK-NEXT: Content: 0100000000000000000000000000000003000000000000001C040000
|
|
|
|
; CHECK-NEXT: - SectionOffset: 41
|
|
|
|
; CHECK-NEXT: MemoryIndex: 0
|
|
|
|
; CHECK-NEXT: Offset:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 1052
|
|
|
|
; CHECK-NEXT: Content: 68656C6C6F0A00
|
|
|
|
|
|
|
|
; CHECK: - Type: CUSTOM
|
|
|
|
; CHECK-NEXT: Name: linking
|
|
|
|
; CHECK-NEXT: DataSize: 35
|