| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
| ;; RUN: wasm-ctor-eval %s --ctors=ctor --kept-exports=ctor --quiet -all -S -o - | filecheck %s |
| |
| (module |
| (rec |
| ;; CHECK: (rec |
| ;; CHECK-NEXT: (type $struct (sub (descriptor $desc) (struct))) |
| (type $struct (sub (descriptor $desc) (struct))) |
| ;; CHECK: (type $desc (describes $struct) (struct)) |
| (type $desc (describes $struct) (struct)) |
| ) |
| ;; CHECK: (type $2 (func)) |
| |
| ;; CHECK: (global $ctor-eval$global_2 (ref (exact $desc)) (struct.new_default $desc)) |
| |
| ;; CHECK: (global $ctor-eval$global (ref (exact $struct)) (struct.new_default_desc $struct |
| ;; CHECK-NEXT: (global.get $ctor-eval$global_2) |
| ;; CHECK-NEXT: )) |
| |
| ;; CHECK: (global $global (ref $struct) (global.get $ctor-eval$global)) |
| (global $global (export "g") (ref $struct) |
| (struct.new_desc $struct |
| (struct.new $desc) |
| ) |
| ) |
| |
| ;; Export some arbitrary ctor so we do anything at all. |
| (func $ctor (export "ctor") |
| (nop) |
| ) |
| ) |
| ;; CHECK: (export "g" (global $global)) |
| |
| ;; CHECK: (export "ctor" (func $ctor_1)) |
| |
| ;; CHECK: (func $ctor_1 (type $2) |
| ;; CHECK-NEXT: (nop) |
| ;; CHECK-NEXT: ) |