Skip to content

[WebAssembly] Add ref.test_func handling to AsmParser #139642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename to ref.test
  • Loading branch information
hoodmane committed May 13, 2025
commit 6a4693a238723f78c9126071b0b0be2ae5481af9
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
if (parseFunctionTableOperand(&FunctionTable))
return true;
ExpectFuncType = true;
} else if (Name == "ref.test_func") {
} else if (Name == "ref.test") {
ExpectFuncType = true;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defm REF_TEST_FUNCREF :
(outs),
(ins TypeIndex:$type),
[],
"ref.test_func\t$type, $ref", "ref.test_func $type", 0xfb14>;
"ref.test\t$type, $ref", "ref.test $type", 0xfb14>;

defm "" : REF_I<FUNCREF, funcref, "func">;
defm "" : REF_I<EXTERNREF, externref, "extern">;
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/MC/WebAssembly/reference-types.s
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ ref_null_test:
ref_test_test:
.functype ref_test_test () -> (i32, i32)
ref.null_func
ref.test_func () -> ()
ref.test () -> ()
ref.null_func
ref.test_func () -> (i32)
ref.test () -> (i32)
end_function

# CHECK-LABEL: ref_sig_test_funcref:
Expand Down