-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Update WebAssemblyAsmTypeCheck for table.get
This patch is aimed to resolve [[ #53789 | GitHub Issue #53789 ]]. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D120229
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# RUN: llvm-mc -mattr=+reference-types -triple=wasm32-unknown-unknown -filetype=obj -o %t.o %s | ||
# RUN: wasm-ld --no-entry --export obtain_funcref_from_table_index %t.o -o %t.wasm | ||
# RUN: obj2yaml %t.wasm | FileCheck %s | ||
|
||
.globl __indirect_function_table | ||
.tabletype __indirect_function_table, funcref | ||
|
||
.globl obtain_funcref_from_table_index | ||
|
||
obtain_funcref_from_table_index: | ||
.functype obtain_funcref_from_table_index(i32) -> (funcref) | ||
local.get 0 | ||
table.get __indirect_function_table | ||
end_function | ||
|
||
# CHECK: Sections: | ||
# CHECK-NEXT: - Type: TYPE | ||
# CHECK-NEXT: Signatures: | ||
# CHECK-NEXT: - Index: 0 | ||
# CHECK-NEXT: ParamTypes: | ||
# CHECK-NEXT: - I32 | ||
# CHECK-NEXT: ReturnTypes: | ||
# CHECK-NEXT: - FUNCREF |