diff options
Diffstat (limited to 'test/metadce/table.wast')
-rw-r--r-- | test/metadce/table.wast | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/metadce/table.wast b/test/metadce/table.wast new file mode 100644 index 000000000..d1ee93ae4 --- /dev/null +++ b/test/metadce/table.wast @@ -0,0 +1,30 @@ +(module + (type $array (array (mut funcref))) + + (table $table-used 10 funcref) + + (table $table-unused 10 funcref) + + ;; An active element segment, which is always used. + (elem $elem (table $table-used) (i32.const 0) $func) + + (elem $passive-elem-used $func) + + (elem $passive-elem-unused $func) + + (func $func (export "test") + ;; Use the used table and passive element segment. + (table.fill $table-used + (i32.const 0) + (ref.func $func) + (i32.const 0) + ) + (drop + (array.new_elem $array $passive-elem-used + (i32.const 0) + (i32.const 1) + ) + ) + ) +) + |