summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-gc-extern.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-10-14 16:07:57 -0700
committerGitHub <noreply@github.com>2024-10-14 16:07:57 -0700
commit93883fde36ac158fd415dcd6dbd387dcfd928d3c (patch)
tree1284161055319916352d520645b12f412283dd48 /test/lit/passes/optimize-instructions-gc-extern.wast
parente201819761bd8ae21bd03b2656a15544f9e44c32 (diff)
downloadbinaryen-93883fde36ac158fd415dcd6dbd387dcfd928d3c.tar.gz
binaryen-93883fde36ac158fd415dcd6dbd387dcfd928d3c.tar.bz2
binaryen-93883fde36ac158fd415dcd6dbd387dcfd928d3c.zip
[WasmGC] OptimizeInstructions: Cancel out internalize+externalize pairs (#7005)
Diffstat (limited to 'test/lit/passes/optimize-instructions-gc-extern.wast')
-rw-r--r--test/lit/passes/optimize-instructions-gc-extern.wast26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lit/passes/optimize-instructions-gc-extern.wast b/test/lit/passes/optimize-instructions-gc-extern.wast
index 067efb0ec..633a18a33 100644
--- a/test/lit/passes/optimize-instructions-gc-extern.wast
+++ b/test/lit/passes/optimize-instructions-gc-extern.wast
@@ -85,4 +85,30 @@
)
)
)
+
+ ;; CHECK: (func $extern.intern (type $3) (param $ext externref) (param $any anyref)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $any)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $ext)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $extern.intern (param $ext externref) (param $any anyref)
+ ;; Internalize/externalize operations cancel out.
+ (drop
+ (any.convert_extern
+ (extern.convert_any
+ (local.get $any)
+ )
+ )
+ )
+ (drop
+ (extern.convert_any
+ (any.convert_extern
+ (local.get $ext)
+ )
+ )
+ )
+ )
)