github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/integration_test/spectest/v2/testdata/start.wast (about)

     1  (assert_invalid
     2    (module (func) (start 1))
     3    "unknown function"
     4  )
     5  
     6  (assert_invalid
     7    (module
     8      (func $main (result i32) (return (i32.const 0)))
     9      (start $main)
    10    )
    11    "start function"
    12  )
    13  (assert_invalid
    14    (module
    15      (func $main (param $a i32))
    16      (start $main)
    17    )
    18    "start function"
    19  )
    20  
    21  (module
    22    (memory (data "A"))
    23    (func $inc
    24      (i32.store8
    25        (i32.const 0)
    26        (i32.add
    27          (i32.load8_u (i32.const 0))
    28          (i32.const 1)
    29        )
    30      )
    31    )
    32    (func $get (result i32)
    33      (return (i32.load8_u (i32.const 0)))
    34    )
    35    (func $main
    36      (call $inc)
    37      (call $inc)
    38      (call $inc)
    39    )
    40  
    41    (start $main)
    42    (export "inc" (func $inc))
    43    (export "get" (func $get))
    44  )
    45  (assert_return (invoke "get") (i32.const 68))
    46  (invoke "inc")
    47  (assert_return (invoke "get") (i32.const 69))
    48  (invoke "inc")
    49  (assert_return (invoke "get") (i32.const 70))
    50  
    51  (module
    52    (memory (data "A"))
    53    (func $inc
    54      (i32.store8
    55        (i32.const 0)
    56        (i32.add
    57          (i32.load8_u (i32.const 0))
    58          (i32.const 1)
    59        )
    60      )
    61    )
    62    (func $get (result i32)
    63      (return (i32.load8_u (i32.const 0)))
    64    )
    65    (func $main
    66      (call $inc)
    67      (call $inc)
    68      (call $inc)
    69    )
    70    (start 2)
    71    (export "inc" (func $inc))
    72    (export "get" (func $get))
    73  )
    74  (assert_return (invoke "get") (i32.const 68))
    75  (invoke "inc")
    76  (assert_return (invoke "get") (i32.const 69))
    77  (invoke "inc")
    78  (assert_return (invoke "get") (i32.const 70))
    79  
    80  (module
    81    (func $print_i32 (import "spectest" "print_i32") (param i32))
    82    (func $main (call $print_i32 (i32.const 1)))
    83    (start 1)
    84  )
    85  
    86  (module
    87    (func $print_i32 (import "spectest" "print_i32") (param i32))
    88    (func $main (call $print_i32 (i32.const 2)))
    89    (start $main)
    90  )
    91  
    92  (module
    93    (func $print (import "spectest" "print"))
    94    (start $print)
    95  )
    96  
    97  (assert_trap
    98    (module (func $main (unreachable)) (start $main))
    99    "unreachable"
   100  )
   101  
   102  (assert_malformed
   103    (module quote "(module (func $a (unreachable)) (func $b (unreachable)) (start $a) (start $b))")
   104    "multiple start sections"
   105  )