wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

cranelift: Build a runtest case from fuzzer TestCase's

Open afonso360 opened this issue 3 years ago • 1 comments

👋 Hey,

This is a quality of life improvement for the fuzzer. With the custom Debug impl we build a runtest test case that automatically executes in the interpreter and in the compiler backend.

The test case needs some changes in order to be actually executable, since we don't know what the expected output of the function is. But an improvement in the future could be to run the interpreter in the Debug impl and print those results as the expected.

The big thing here is that it also formats floats correctly, which with the previous impl we a pain to get into a runtest since they were printed in integer format.

Here's an example output:

;; Fuzzgen test case          
                              
test interpret                
test run                      
set enable_llvm_abi_extensions
target aarch64
target s390x
target x86_64

function u0:0(f64, i8, i32) system_v {
... function body
}

; run: u0:0(-0x0.0ff7d7dff00ffp-1022, 32, 255) == TODO
; run: u0:0(0.0, 0, 0) == TODO

cc: @jameysharp

afonso360 avatar Aug 03 '22 08:08 afonso360

Now with a default expected output!

However the test case still doesn't execute by default, since we don't support u0:0 function names. But I can probably address that when we add multiple functions to the same testcase, shouldn't be too long now.

afonso360 avatar Aug 09 '22 19:08 afonso360