2018-01-13 06:25:17 +08:00
|
|
|
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat1.ll -o %t1.o
|
|
|
|
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat2.ll -o %t2.o
|
|
|
|
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o
|
2018-09-28 05:06:25 +08:00
|
|
|
; RUN: wasm-ld --export-dynamic -o %t.wasm %t.o %t1.o %t2.o
|
2018-01-13 06:25:17 +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
|
|
|
|
2019-06-07 14:00:46 +08:00
|
|
|
declare i32 @comdatFn()
|
2018-01-13 06:25:17 +08:00
|
|
|
|
2019-06-07 14:00:46 +08:00
|
|
|
define void @_start() {
|
2018-01-13 06:25:17 +08:00
|
|
|
entry:
|
2019-06-07 14:00:46 +08:00
|
|
|
%call = call i32 @comdatFn()
|
2018-01-13 06:25:17 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: - Type: GLOBAL
|
|
|
|
; CHECK-NEXT: Globals:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: true
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 66576
|
2018-01-17 09:34:31 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
|
|
|
; CHECK-NEXT: Type: I32
|
|
|
|
; CHECK-NEXT: Mutable: false
|
|
|
|
; CHECK-NEXT: InitExpr:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
2018-03-02 22:51:36 +08:00
|
|
|
; CHECK-NEXT: Value: 1024
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: - Type: EXPORT
|
|
|
|
; CHECK-NEXT: Exports:
|
|
|
|
; CHECK-NEXT: - Name: memory
|
|
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-NEXT: Index: 0
|
|
|
|
; CHECK-NEXT: - Name: _start
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 0
|
2019-06-07 14:00:46 +08:00
|
|
|
; CHECK-NEXT: - Name: comdatFn
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2018-03-02 22:51:36 +08:00
|
|
|
; CHECK-NEXT: - Name: constantData
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
2019-06-01 06:51:59 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2019-06-07 14:00:46 +08:00
|
|
|
; CHECK-NEXT: - Name: callComdatFn1
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 2
|
2019-06-07 14:00:46 +08:00
|
|
|
; CHECK-NEXT: - Name: callComdatFn2
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 3
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: - Type: ELEM
|
|
|
|
; CHECK-NEXT: Segments:
|
|
|
|
; CHECK-NEXT: - Offset:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 1
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Functions: [ 1 ]
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: - Type: CODE
|
|
|
|
; CHECK-NEXT: Functions:
|
|
|
|
; CHECK-NEXT: - Index: 0
|
|
|
|
; CHECK-NEXT: Locals:
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Body: 1081808080001A0B
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: - Index: 1
|
|
|
|
; CHECK-NEXT: Locals:
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Body: 4180888080000B
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 2
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Locals:
|
|
|
|
; CHECK-NEXT: Body: 4181808080000B
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: - Index: 3
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Locals:
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Body: 4181808080000B
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: - Type: DATA
|
|
|
|
; CHECK-NEXT: Segments:
|
|
|
|
; CHECK-NEXT: - SectionOffset: 7
|
2019-02-20 06:56:19 +08:00
|
|
|
; CHECK-NEXT: InitFlags: 0
|
2018-01-13 06:25:17 +08:00
|
|
|
; CHECK-NEXT: Offset:
|
|
|
|
; CHECK-NEXT: Opcode: I32_CONST
|
|
|
|
; CHECK-NEXT: Value: 1024
|
|
|
|
; CHECK-NEXT: Content: '616263'
|