[llvm] 2064557 - [WebAssembly] Add more EH assembly test cases (#108654)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 23:20:47 PDT 2024
Author: Heejin Ahn
Date: 2024-09-13T23:20:44-07:00
New Revision: 20645572e435021c15838cc4ef1cb6b4a50d2e6f
URL: https://github.com/llvm/llvm-project/commit/20645572e435021c15838cc4ef1cb6b4a50d2e6f
DIFF: https://github.com/llvm/llvm-project/commit/20645572e435021c15838cc4ef1cb6b4a50d2e6f.diff
LOG: [WebAssembly] Add more EH assembly test cases (#108654)
This adds assembly tests for a catch-less `try` and a `try` with a
multivalue return.
Added:
Modified:
llvm/test/MC/WebAssembly/eh-assembly.s
Removed:
################################################################################
diff --git a/llvm/test/MC/WebAssembly/eh-assembly.s b/llvm/test/MC/WebAssembly/eh-assembly.s
index 8c4ae3bb3e4e49..cd33d198f8d9f5 100644
--- a/llvm/test/MC/WebAssembly/eh-assembly.s
+++ b/llvm/test/MC/WebAssembly/eh-assembly.s
@@ -37,6 +37,21 @@ eh_legacy_test:
catch __cpp_exception
end_try
drop
+
+ # try-catch with a mulvivalue return
+ try () -> (i32, f32)
+ i32.const 0
+ f32.const 0.0
+ catch __cpp_exception
+ f32.const 1.0
+ end_try
+ drop
+ drop
+
+ # Catch-less try
+ try
+ call foo
+ end_try
end_function
# CHECK-LABEL: eh_legacy_test:
@@ -66,4 +81,18 @@ eh_legacy_test:
# CHECK-NEXT: catch __cpp_exception
# CHECK-NEXT: end_try
# CHECK-NEXT: drop
+
+# CHECK: try () -> (i32, f32)
+# CHECK-NEXT: i32.const 0
+# CHECK-NEXT: f32.const 0x0p0
+# CHECK-NEXT: catch __cpp_exception
+# CHECK-NEXT: f32.const 0x1p0
+# CHECK-NEXT: end_try
+# CHECK-NEXT: drop
+# CHECK-NEXT: drop
+
+# CHECK: try
+# CHECK-NEXT: call foo
+# CHECK-NEXT: end_try
# CHECK-NEXT: end_function
+
More information about the llvm-commits
mailing list