2020-05-21 12:35:18 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/start.s -o %t.start.o
|
2021-02-18 00:20:28 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
|
|
|
|
# RUN: wasm-ld --export-all --import-table -o %t.wasm %t.start.o %t.o
|
2018-03-28 01:38:51 +08:00
|
|
|
# RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
|
2021-02-18 00:20:28 +08:00
|
|
|
.globl require_function_table
|
|
|
|
require_function_table:
|
|
|
|
.functype require_function_table () -> ()
|
|
|
|
i32.const 1
|
|
|
|
call_indirect () -> ()
|
|
|
|
end_function
|
|
|
|
|
2018-03-28 01:38:51 +08:00
|
|
|
# Verify the --import-table flag creates a table import
|
|
|
|
|
|
|
|
# CHECK: - Type: IMPORT
|
|
|
|
# CHECK-NEXT: Imports:
|
|
|
|
# CHECK-NEXT: - Module: env
|
|
|
|
# CHECK-NEXT: Field: __indirect_function_table
|
|
|
|
# CHECK-NEXT: Kind: TABLE
|
|
|
|
# CHECK-NEXT: Table:
|
2020-10-13 22:13:10 +08:00
|
|
|
# CHECK-NEXT: Index: 0
|
2019-01-08 14:25:55 +08:00
|
|
|
# CHECK-NEXT: ElemType: FUNCREF
|
2018-03-28 01:38:51 +08:00
|
|
|
# CHECK-NEXT: Limits:
|
2021-03-23 21:46:32 +08:00
|
|
|
# CHECK-NEXT: Minimum: 0x1
|
2018-03-28 01:38:51 +08:00
|
|
|
|