forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cranelift: fix
heap_{load,store}
test generator script (bytecodeall…
…iance#5348) Was missing some '$' characters and so was comparing string literals against string literals instead of variable values against string literals. Regenerated tests to fix them and add missing tests.
- Loading branch information
Showing
13 changed files
with
330 additions
and
10 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_no_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=false | ||
|
||
function %do_store(i64 vmctx, i32, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i32, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 | ||
fn0 = %do_store(i64, i32, i32) | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
40 changes: 40 additions & 0 deletions
40
...elift/filetests/filetests/runtests/heap_load_store_dynamic_i32_no_guards_yes_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=true | ||
|
||
function %do_store(i64 vmctx, i32, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i32, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i32 | ||
fn0 = %do_store(i64, i32, i32) | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_no_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=false | ||
|
||
function %do_store(i64 vmctx, i64, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i64, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 | ||
fn0 = %do_store(i64, i64, i32) | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
40 changes: 40 additions & 0 deletions
40
...elift/filetests/filetests/runtests/heap_load_store_dynamic_i64_no_guards_yes_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=true | ||
|
||
function %do_store(i64 vmctx, i64, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i64, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
gv2 = load.i64 notrap aligned gv0+8 | ||
heap0 = dynamic gv1, min 0x1000, bound gv2, offset_guard 0, index_type i64 | ||
fn0 = %do_store(i64, i64, i32) | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: dynamic, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_no_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=false | ||
|
||
function %do_store(i64 vmctx, i32, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i32, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 | ||
fn0 = %do_store(i64, i32, i32) | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_static_i32_no_guards_yes_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=true | ||
|
||
function %do_store(i64 vmctx, i32, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i32, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i32 | ||
fn0 = %do_store(i64, i32, i32) | ||
|
||
block0(v0: i64, v1: i32, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_no_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=false | ||
|
||
function %do_store(i64 vmctx, i64, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i64, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 | ||
fn0 = %do_store(i64, i64, i32) | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
40 changes: 40 additions & 0 deletions
40
cranelift/filetests/filetests/runtests/heap_load_store_static_i64_no_guards_yes_spectre.clif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
;; !!! GENERATED BY 'make-heap-load-store-tests.sh' DO NOT EDIT !!! | ||
|
||
test interpret | ||
;; test run | ||
;; target x86_64 | ||
;; target s390x | ||
;; target aarch64 | ||
;; target riscv64 | ||
|
||
set enable_heap_access_spectre_mitigation=true | ||
|
||
function %do_store(i64 vmctx, i64, i32) { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
heap_store.i32 heap0 little v1+4, v2 | ||
return | ||
} | ||
|
||
function %test(i64 vmctx, i64, i32) -> i32 { | ||
gv0 = vmctx | ||
gv1 = load.i64 notrap aligned gv0+0 | ||
|
||
heap0 = static gv1, min 0x1000, bound 0x1000, offset_guard 0, index_type i64 | ||
fn0 = %do_store(i64, i64, i32) | ||
|
||
block0(v0: i64, v1: i64, v2: i32): | ||
call fn0(v0, v1, v2) | ||
v3 = heap_load.i32 heap0 little v1+4 | ||
return v3 | ||
} | ||
; heap: static, size=0x1000, ptr=vmctx+0, bound=vmctx+8 | ||
; run: %test(0, 0) == 0 | ||
; run: %test(0, -1) == -1 | ||
; run: %test(16, 1) == 1 | ||
; run: %test(16, -1) == -1 | ||
; run: %test(2049, 0xaabb_ccdd) == 0xaabb_ccdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters