|
51 | 51 | ;; CHECK: (type $struct_i64 (func (param structref) (result i64)))
|
52 | 52 | (type $struct_i64 (func (param (ref null struct)) (result i64)))
|
53 | 53 |
|
54 |
| - ;; CHECK: (import "env" "get-i32" (func $get-i32 (type $9) (result i32))) |
| 54 | + ;; CHECK: (import "env" "get-i32" (func $get-i32 (type $8) (result i32))) |
55 | 55 | (import "env" "get-i32" (func $get-i32 (result i32)))
|
56 | 56 |
|
57 | 57 | ;; These functions test if an `if` with subtyped arms is correctly folded
|
|
1418 | 1418 | )
|
1419 | 1419 | )
|
1420 | 1420 |
|
1421 |
| - ;; CHECK: (func $incompatible-test-heap-types-nonnullable (type $8) (param $anyref anyref) (result anyref) |
| 1421 | + ;; CHECK: (func $incompatible-test-heap-types-nonnullable (type $9) (param $anyref anyref) (result anyref) |
1422 | 1422 | ;; CHECK-NEXT: (block $outer (result anyref)
|
1423 | 1423 | ;; CHECK-NEXT: (drop
|
1424 | 1424 | ;; CHECK-NEXT: (block (result i32)
|
|
1460 | 1460 | )
|
1461 | 1461 | )
|
1462 | 1462 |
|
1463 |
| - ;; CHECK: (func $incompatible-test-heap-types-nullable (type $8) (param $anyref anyref) (result anyref) |
| 1463 | + ;; CHECK: (func $incompatible-test-heap-types-nullable (type $9) (param $anyref anyref) (result anyref) |
1464 | 1464 | ;; CHECK-NEXT: (block $outer (result anyref)
|
1465 | 1465 | ;; CHECK-NEXT: (drop
|
1466 | 1466 | ;; CHECK-NEXT: (block (result i32)
|
|
1501 | 1501 | )
|
1502 | 1502 | )
|
1503 | 1503 |
|
1504 |
| - ;; CHECK: (func $incompatible-test-heap-types-unreachable (type $8) (param $anyref anyref) (result anyref) |
| 1504 | + ;; CHECK: (func $incompatible-test-heap-types-unreachable (type $9) (param $anyref anyref) (result anyref) |
1505 | 1505 | ;; CHECK-NEXT: (block $outer (result anyref)
|
1506 | 1506 | ;; CHECK-NEXT: (drop
|
1507 | 1507 | ;; CHECK-NEXT: (block (result i32)
|
|
2641 | 2641 | )
|
2642 | 2642 | )
|
2643 | 2643 |
|
2644 |
| - ;; CHECK: (func $incompatible-cast-heap-types-nonnullable (type $8) (param $anyref anyref) (result anyref) |
| 2644 | + ;; CHECK: (func $incompatible-cast-heap-types-nonnullable (type $9) (param $anyref anyref) (result anyref) |
2645 | 2645 | ;; CHECK-NEXT: (block $outer (result (ref any))
|
2646 | 2646 | ;; CHECK-NEXT: (block
|
2647 | 2647 | ;; CHECK-NEXT: (drop
|
|
2677 | 2677 | )
|
2678 | 2678 | )
|
2679 | 2679 |
|
2680 |
| - ;; CHECK: (func $incompatible-cast-heap-types-nullable (type $8) (param $anyref anyref) (result anyref) |
| 2680 | + ;; CHECK: (func $incompatible-cast-heap-types-nullable (type $9) (param $anyref anyref) (result anyref) |
2681 | 2681 | ;; CHECK-NEXT: (block $outer (result anyref)
|
2682 | 2682 | ;; CHECK-NEXT: (ref.cast nullref
|
2683 | 2683 | ;; CHECK-NEXT: (block (result nullref)
|
|
2709 | 2709 | )
|
2710 | 2710 | )
|
2711 | 2711 |
|
2712 |
| - ;; CHECK: (func $incompatible-cast-heap-types-unreachable (type $8) (param $anyref anyref) (result anyref) |
| 2712 | + ;; CHECK: (func $incompatible-cast-heap-types-unreachable (type $9) (param $anyref anyref) (result anyref) |
2713 | 2713 | ;; CHECK-NEXT: (block $outer (result anyref)
|
2714 | 2714 | ;; CHECK-NEXT: (block
|
2715 | 2715 | ;; CHECK-NEXT: (drop
|
|
2966 | 2966 | )
|
2967 | 2967 | )
|
2968 | 2968 |
|
2969 |
| - ;; CHECK: (func $non-null-bottom-ref-test (type $9) (result i32) |
| 2969 | + ;; CHECK: (func $non-null-bottom-ref-test (type $8) (result i32) |
2970 | 2970 | ;; CHECK-NEXT: (local $0 funcref)
|
2971 | 2971 | ;; CHECK-NEXT: (drop
|
2972 | 2972 | ;; CHECK-NEXT: (local.tee $0
|
|
2989 | 2989 | )
|
2990 | 2990 | )
|
2991 | 2991 |
|
2992 |
| - ;; CHECK: (func $non-null-bottom-ref-test-notee (type $9) (result i32) |
| 2992 | + ;; CHECK: (func $non-null-bottom-ref-test-notee (type $8) (result i32) |
2993 | 2993 | ;; CHECK-NEXT: (local $0 funcref)
|
2994 | 2994 | ;; CHECK-NEXT: (drop
|
2995 | 2995 | ;; CHECK-NEXT: (loop (result (ref nofunc))
|
|
3009 | 3009 | )
|
3010 | 3010 | )
|
3011 | 3011 |
|
3012 |
| - ;; CHECK: (func $non-null-bottom-test (type $9) (result i32) |
| 3012 | + ;; CHECK: (func $non-null-bottom-test (type $8) (result i32) |
3013 | 3013 | ;; CHECK-NEXT: (drop
|
3014 | 3014 | ;; CHECK-NEXT: (ref.func $non-null-bottom-cast)
|
3015 | 3015 | ;; CHECK-NEXT: )
|
|
3079 | 3079 | )
|
3080 | 3080 | )
|
3081 | 3081 |
|
3082 |
| - ;; CHECK: (func $ref.test-then-optimizeAddedConstants (type $9) (result i32) |
| 3082 | + ;; CHECK: (func $ref.test-then-optimizeAddedConstants (type $8) (result i32) |
3083 | 3083 | ;; CHECK-NEXT: (i32.add
|
3084 | 3084 | ;; CHECK-NEXT: (block
|
3085 | 3085 | ;; CHECK-NEXT: (drop
|
|
3691 | 3691 | )
|
3692 | 3692 | )
|
3693 | 3693 | )
|
| 3694 | + |
| 3695 | + ;; Regression test for UB when analyzing bits. |
| 3696 | + ;; CHECK: (func $unreachable-bits (type $8) (result i32) |
| 3697 | + ;; CHECK-NEXT: (drop |
| 3698 | + ;; CHECK-NEXT: (block |
| 3699 | + ;; CHECK-NEXT: (drop |
| 3700 | + ;; CHECK-NEXT: (unreachable) |
| 3701 | + ;; CHECK-NEXT: ) |
| 3702 | + ;; CHECK-NEXT: (unreachable) |
| 3703 | + ;; CHECK-NEXT: ) |
| 3704 | + ;; CHECK-NEXT: ) |
| 3705 | + ;; CHECK-NEXT: (i32.const 0) |
| 3706 | + ;; CHECK-NEXT: ) |
| 3707 | + (func $unreachable-bits (result i32) |
| 3708 | + ;; When this is optimized, the unreachable left hand side is arbitrarily |
| 3709 | + ;; considered to have 64 bits. This should not lead to UB. |
| 3710 | + (i32.and |
| 3711 | + ;; This will be optimized to an unreachable block. |
| 3712 | + (ref.test (ref none) |
| 3713 | + (ref.as_non_null |
| 3714 | + (ref.null none) |
| 3715 | + ) |
| 3716 | + ) |
| 3717 | + (i32.const 0) |
| 3718 | + ) |
| 3719 | + ) |
3694 | 3720 | )
|
0 commit comments