llvm-project
24 строки · 816.0 Байт
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
2# RUN: wasm-ld --export-all --import-table -o %t.wasm %t.o
3# RUN: obj2yaml %t.wasm | FileCheck %s
4
5.globl _start
6_start:
7.functype _start () -> ()
8i32.const 1
9# call_indirect instruction implicitly references the function table
10call_indirect () -> ()
11end_function
12
13# Verify the --import-table flag creates a table import
14
15# CHECK: - Type: IMPORT
16# CHECK-NEXT: Imports:
17# CHECK-NEXT: - Module: env
18# CHECK-NEXT: Field: __indirect_function_table
19# CHECK-NEXT: Kind: TABLE
20# CHECK-NEXT: Table:
21# CHECK-NEXT: Index: 0
22# CHECK-NEXT: ElemType: FUNCREF
23# CHECK-NEXT: Limits:
24# CHECK-NEXT: Minimum: 0x1
25
26