Skip to content

Commit

Permalink
Fix even more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 30, 2024
1 parent fb9571f commit 520c15e
Show file tree
Hide file tree
Showing 32 changed files with 228 additions and 227 deletions.
2 changes: 1 addition & 1 deletion cranelift/filetests/filetests/cfg/traps_early.clif
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function %nonsense(i32) {
; check: digraph "%nonsense" {

block0(v1: i32):
trap user0 ; error: terminator instruction was encountered before the end
trap user1 ; error: terminator instruction was encountered before the end
brif v1, block2, block1 ; unordered: block0:inst1 -> block2
; unordered: block0:inst1 -> block1

Expand Down
4 changes: 2 additions & 2 deletions cranelift/filetests/filetests/cfg/unused_node.clif
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function %not_reached(i32) -> i32 {
; check: | <inst4>return v0
; check: }"]
; check: block3 [shape=record, label="{block3:
; check: | <inst5>trap user0
; check: | <inst5>trap user1
; check: }"]
block0(v0: i32):
brif v0, block2, block3 ; unordered: block0:inst0 -> block2
Expand All @@ -27,5 +27,5 @@ block2:
return v0

block3:
trap user0
trap user1
}
2 changes: 1 addition & 1 deletion cranelift/filetests/filetests/domtree/loops.clif
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function %loop2(i32) system_v {
block5:
brif v0, block9, block4 ; dominates: block9
block9:
trap user0
trap user1
block6:
jump block7 ; dominates: block7
block7:
Expand Down
2 changes: 1 addition & 1 deletion cranelift/filetests/filetests/egraph/issue-5437.clif
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function u0:0(i64 vmctx, i64) fast {
@001d brif v3, block3, block2 ; v3 = 0

block3:
@001f trap unreachable
@001f trap user1

block2:
@0025 v4 = bitcast.i16x8 little v2 ; v2 = const0
Expand Down
6 changes: 3 additions & 3 deletions cranelift/filetests/filetests/egraph/issue-5716.clif
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ block0:
v97 = iadd v238, v96 ; v96 = 0
br_table v80, block37, [block36, block38] ; v80 = 0
block36:
trap user0
trap user1
block37:
trap unreachable
trap user2
block38:
v98 = load.i8 notrap v97
v99 = fcvt_from_uint.f64 v98
stack_store v99, ss0
trap user0
trap user1
}
2 changes: 1 addition & 1 deletion cranelift/filetests/filetests/egraph/issue-7875.clif
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ block4(v10: f32):
v12 = select.f32 v11, v4, v10
v13 = bitcast.i32 v12
store v13, v0
trap user0
trap user1

block3:
v15 = bitcast.i32 v4
Expand Down
34 changes: 17 additions & 17 deletions cranelift/filetests/filetests/isa/aarch64/traps.clif
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ target aarch64

function %trap() {
block0:
trap user0
trap user1
}

; VCode:
Expand All @@ -12,95 +12,95 @@ block0:
;
; Disassembled:
; block0: ; offset 0x0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %trap_iadd_ifcout(i64, i64) {
block0(v0: i64, v1: i64):
v2 = uadd_overflow_trap v0, v1, user0
v2 = uadd_overflow_trap v0, v1, user1
return
}

; VCode:
; block0:
; adds x3, x0, x1
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; adds x3, x0, x1
; b.hs #0xc
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %trapz(i64) {
block0(v0: i64):
trapz v0, user0
trapz v0, user1
return
}

; VCode:
; block0:
; cbz x0, #trap=user0
; cbz x0, #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; cbz x0, #8
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %trapnz(i64) {
block0(v0: i64):
trapnz v0, user0
trapnz v0, user1
return
}

; VCode:
; block0:
; cbnz x0, #trap=user0
; cbnz x0, #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; cbnz x0, #8
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %trapz_i128(i128) {
block0(v0: i128):
trapz v0, user0
trapz v0, user1
return
}

; VCode:
; block0:
; orr x3, x0, x1
; cbz x3, #trap=user0
; cbz x3, #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; orr x3, x0, x1
; cbz x3, #0xc
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %trapnz_i128(i128) {
block0(v0: i128):
trapnz v0, user0
trapnz v0, user1
return
}

; VCode:
; block0:
; orr x3, x0, x1
; cbnz x3, #trap=user0
; cbnz x3, #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; orr x3, x0, x1
; cbnz x3, #0xc
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1
36 changes: 18 additions & 18 deletions cranelift/filetests/filetests/isa/aarch64/uadd_overflow_trap.clif
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ target aarch64
function %f0(i32) -> i32 {
block0(v0: i32):
v1 = iconst.i32 127
v2 = uadd_overflow_trap v0, v1, user0
v2 = uadd_overflow_trap v0, v1, user1
return v2
}

; VCode:
; block0:
; movz w3, #127
; adds w0, w0, w3
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
Expand All @@ -21,20 +21,20 @@ block0(v0: i32):
; adds w0, w0, w3
; b.hs #0x10
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %f1(i32) -> i32 {
block0(v0: i32):
v1 = iconst.i32 127
v2 = uadd_overflow_trap v1, v0, user0
v2 = uadd_overflow_trap v1, v0, user1
return v2
}

; VCode:
; block0:
; movz w3, #127
; adds w0, w3, w0
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
Expand All @@ -43,39 +43,39 @@ block0(v0: i32):
; adds w0, w3, w0
; b.hs #0x10
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %f2(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v2 = uadd_overflow_trap v0, v1, user0
v2 = uadd_overflow_trap v0, v1, user1
return v2
}

; VCode:
; block0:
; adds w0, w0, w1
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; adds w0, w0, w1
; b.hs #0xc
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %f3(i64) -> i64 {
block0(v0: i64):
v1 = iconst.i64 127
v2 = uadd_overflow_trap v0, v1, user0
v2 = uadd_overflow_trap v0, v1, user1
return v2
}

; VCode:
; block0:
; movz x3, #127
; adds x0, x0, x3
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
Expand All @@ -84,20 +84,20 @@ block0(v0: i64):
; adds x0, x0, x3
; b.hs #0x10
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %f3(i64) -> i64 {
block0(v0: i64):
v1 = iconst.i64 127
v2 = uadd_overflow_trap v1, v0, user0
v2 = uadd_overflow_trap v1, v0, user1
return v2
}

; VCode:
; block0:
; movz x3, #127
; adds x0, x3, x0
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
Expand All @@ -106,24 +106,24 @@ block0(v0: i64):
; adds x0, x3, x0
; b.hs #0x10
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

function %f4(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
v2 = uadd_overflow_trap v0, v1, user0
v2 = uadd_overflow_trap v0, v1, user1
return v2
}

; VCode:
; block0:
; adds x0, x0, x1
; b.hs #trap=user0
; b.hs #trap=user1
; ret
;
; Disassembled:
; block0: ; offset 0x0
; adds x0, x0, x1
; b.hs #0xc
; ret
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user0
; .byte 0x1f, 0xc1, 0x00, 0x00 ; trap: user1

Loading

0 comments on commit 520c15e

Please sign in to comment.