File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 342342 )
343343)
344344
345+ ;; Two descriptor instances in globals.
346+ (module
347+ (rec
348+ ;; CHECK: (rec
349+ ;; CHECK-NEXT: (type $A (sub (descriptor $A.desc (struct))))
350+ (type $A (sub (descriptor $A.desc (struct ))))
351+ ;; CHECK: (type $A.desc (sub (describes $A (struct))))
352+ (type $A.desc (sub (describes $A (struct ))))
353+ )
354+
355+ ;; CHECK: (type $2 (func (param anyref)))
356+
357+ ;; CHECK: (global $A.desc (ref $A.desc) (struct.new_default $A.desc))
358+ (global $A.desc (ref $A.desc ) (struct.new $A.desc ))
359+
360+ ;; CHECK: (global $A.desc2 (ref $A.desc) (struct.new_default $A.desc))
361+ (global $A.desc2 (ref $A.desc ) (struct.new $A.desc ))
362+
363+ ;; CHECK: (func $test (type $2) (param $any anyref)
364+ ;; CHECK-NEXT: (drop
365+ ;; CHECK-NEXT: (ref.cast (ref $A)
366+ ;; CHECK-NEXT: (local.get $any)
367+ ;; CHECK-NEXT: )
368+ ;; CHECK-NEXT: )
369+ ;; CHECK-NEXT: )
370+ (func $test (param $any anyref )
371+ ;; We do not optimize here. TODO: we could with a select
372+ (drop
373+ (ref.cast (ref $A )
374+ (local.get $any )
375+ )
376+ )
377+ )
378+ )
379+
You can’t perform that action at this time.
0 commit comments