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:
Nathan Braswell
2022-06-28 00:38:37 -04:00
parent 999d21746e
commit 4663982f1b
18 changed files with 248 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
foreach (source IN ITEMS rbtree.cpp nqueens.cpp cfold.cpp deriv.cpp)
foreach (source IN ITEMS rbtree.cpp nqueens.cpp cfold.cpp deriv.cpp fib.cpp)
get_filename_component(name "${source}" NAME_WE)
set(name "cpp-${name}")

17
koka_bench/cpp/fib.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <math.h>
#include <string.h>
#include <iostream>
int fib(int n) {
if (n == 0) {
return 1;
} else if (n == 1) {
return 1;
} else {
return fib(n-1) + fib(n-2);
}
}
int main(int argc, char **argv) {
printf("%d\n", fib(atoi(argv[1])));
return 0;
}