summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/signature-refining.wast40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast
index 7a5020e29..f6f889408 100644
--- a/test/lit/passes/signature-refining.wast
+++ b/test/lit/passes/signature-refining.wast
@@ -1119,3 +1119,43 @@
;; (see tests above for how we handle refining of return values).
)
)
+
+;; Visibility: The type we'd like to refine, $sig, is in a rec group with a
+;; public type, so do not optimize.
+(module
+ (rec
+ ;; CHECK: (rec
+ ;; CHECK-NEXT: (type $sig (sub (func (param anyref))))
+ (type $sig (sub (func (param anyref))))
+
+ ;; CHECK: (type $struct (struct))
+ (type $struct (struct))
+ )
+
+ ;; Export a global with $struct to make it public.
+ ;; CHECK: (type $2 (func))
+
+ ;; CHECK: (global $struct (ref $struct) (struct.new_default $struct))
+ (global $struct (ref $struct) (struct.new $struct))
+
+ ;; CHECK: (export "struct" (global $struct))
+ (export "struct" (global $struct))
+
+ ;; CHECK: (func $func (type $sig) (param $x anyref)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $func (type $sig) (param $x anyref)
+ )
+
+ ;; CHECK: (func $caller (type $2)
+ ;; CHECK-NEXT: (call $func
+ ;; CHECK-NEXT: (struct.new_default $struct)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $caller
+ (call $func
+ (struct.new $struct)
+ )
+ )
+)
+