Move kraken,scheme,python,cpp fib tests over to koka_bench, add WAVM as a tested compiler backend for the Kraken benchmarks
This commit is contained in:
22
koka_bench/scheme/CMakeLists.txt
Normal file
22
koka_bench/scheme/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
set(copy_wrapper "../../copy_wrapper.sh")
|
||||
|
||||
set(sources scheme-fib.scm scheme-fib-let.scm)
|
||||
foreach (source IN LISTS sources)
|
||||
|
||||
get_filename_component(name "${source}" NAME_WE)
|
||||
|
||||
set(out_dir "${CMAKE_CURRENT_BINARY_DIR}/out/bench")
|
||||
set(out_path "${out_dir}/${name}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${out_path}
|
||||
COMMAND ${copy_wrapper} "${CMAKE_CURRENT_SOURCE_DIR}/${source}" ${out_dir} ${name}
|
||||
DEPENDS ${source}
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(update-${name} ALL DEPENDS "${out_path}")
|
||||
add_executable(${name}-exe IMPORTED)
|
||||
set_target_properties(${name}-exe PROPERTIES IMPORTED_LOCATION "${out_path}")
|
||||
endforeach ()
|
||||
|
||||
8
koka_bench/scheme/scheme-fib-let.scm
Executable file
8
koka_bench/scheme/scheme-fib-let.scm
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env -S scheme --script
|
||||
(pretty-print ((letrec ((fib (lambda (n) (cond ((equal? n 0) 1)
|
||||
((equal? n 1) 1)
|
||||
(#t (let (
|
||||
(r1 (fib (- n 1)))
|
||||
(r2 (fib (- n 2)))
|
||||
) (+ r1 r2)))))))
|
||||
fib) (read (open-input-string (list-ref (command-line) 1)))))
|
||||
5
koka_bench/scheme/scheme-fib.scm
Executable file
5
koka_bench/scheme/scheme-fib.scm
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env -S scheme --script
|
||||
(pretty-print ((letrec ((fib (lambda (n) (cond ((equal? n 0) 1)
|
||||
((equal? n 1) 1)
|
||||
(#t (+ (fib (- n 1)) (fib (- n 2))))))))
|
||||
fib) (read (open-input-string (list-ref (command-line) 1)))))
|
||||
Reference in New Issue
Block a user