|
28 | 28 |
|
29 | 29 | (type $B (struct_subtype (field i32) (field i32) (field f32) $A)) |
30 | 30 |
|
| 31 | + ;; CHECK: (type $void (func)) |
| 32 | + |
31 | 33 | ;; CHECK: (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B)) |
| 34 | + ;; NOMNL: (type $void (func)) |
| 35 | + |
32 | 36 | ;; NOMNL: (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B)) |
33 | 37 | (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B)) |
34 | 38 |
|
35 | 39 | (type $empty (struct)) |
36 | 40 |
|
37 | | - ;; CHECK: (type $void (func)) |
38 | | - |
39 | 41 | ;; CHECK: (type $C (struct_subtype (field i32) (field i32) (field f64) $A)) |
40 | | - ;; NOMNL: (type $void (func)) |
41 | | - |
42 | 42 | ;; NOMNL: (type $C (struct_subtype (field i32) (field i32) (field f64) $A)) |
43 | 43 | (type $C (struct_subtype (field i32) (field i32) (field f64) $A)) |
44 | 44 |
|
|
3157 | 3157 | ) |
3158 | 3158 | ) |
3159 | 3159 | ) |
| 3160 | + |
| 3161 | + ;; CHECK: (func $struct.set.null.fallthrough (type $void) |
| 3162 | + ;; CHECK-NEXT: (local $temp (ref null $struct)) |
| 3163 | + ;; CHECK-NEXT: (struct.set $struct $i8 |
| 3164 | + ;; CHECK-NEXT: (local.tee $temp |
| 3165 | + ;; CHECK-NEXT: (ref.null none) |
| 3166 | + ;; CHECK-NEXT: ) |
| 3167 | + ;; CHECK-NEXT: (i32.const 100) |
| 3168 | + ;; CHECK-NEXT: ) |
| 3169 | + ;; CHECK-NEXT: (unreachable) |
| 3170 | + ;; CHECK-NEXT: ) |
| 3171 | + ;; NOMNL: (func $struct.set.null.fallthrough (type $void) |
| 3172 | + ;; NOMNL-NEXT: (local $temp (ref null $struct)) |
| 3173 | + ;; NOMNL-NEXT: (struct.set $struct $i8 |
| 3174 | + ;; NOMNL-NEXT: (local.tee $temp |
| 3175 | + ;; NOMNL-NEXT: (ref.null none) |
| 3176 | + ;; NOMNL-NEXT: ) |
| 3177 | + ;; NOMNL-NEXT: (i32.const 100) |
| 3178 | + ;; NOMNL-NEXT: ) |
| 3179 | + ;; NOMNL-NEXT: (unreachable) |
| 3180 | + ;; NOMNL-NEXT: ) |
| 3181 | + (func $struct.set.null.fallthrough |
| 3182 | + (local $temp (ref null $struct)) |
| 3183 | + ;; The value falling through the tee shows the local.set will trap. We can |
| 3184 | + ;; append an unreachable after it. While doing so we must not emit a drop of |
| 3185 | + ;; the struct.set (which would be valid for a struct.get etc.). |
| 3186 | + (struct.set $struct 0 |
| 3187 | + (local.tee $temp |
| 3188 | + (ref.as_non_null |
| 3189 | + (ref.null none) |
| 3190 | + ) |
| 3191 | + ) |
| 3192 | + (i32.const 100) |
| 3193 | + ) |
| 3194 | + ) |
3160 | 3195 | ) |
0 commit comments