From 1c87877944fac0e8d9e32cc916bd8093a5e0a1a3 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Wed, 27 May 2015 20:25:33 +1200 Subject: [PATCH] Add test case that triggers clustering --- tests/clustering-tests.scm | 7 +++++++ tests/runtests.bat | 6 ++++++ tests/runtests.sh | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 tests/clustering-tests.scm diff --git a/tests/clustering-tests.scm b/tests/clustering-tests.scm new file mode 100644 index 0000000..92fec92 --- /dev/null +++ b/tests/clustering-tests.scm @@ -0,0 +1,7 @@ +;;; clustering-tests.scm + +;; triggers `determine-loop-and-dispatch` +(let () + (define (a x) (if (= x 0) x (b (sub1 x)))) + (define (b x) (if (= x 0) x (a (sub1 x)))) + (a 10)) diff --git a/tests/runtests.bat b/tests/runtests.bat index e94fd10..1405b0e 100644 --- a/tests/runtests.bat +++ b/tests/runtests.bat @@ -36,6 +36,12 @@ if errorlevel 1 exit /b 1 a.out if errorlevel 1 exit /b 1 +echo ======================================== optimizer tests ... +%compile% clustering-tests.scm -clustering +if errorlevel 1 exit /b 1 +a.out +if errorlevel 1 exit /b 1 + echo ======================================== scrutiny tests ... %compile% typematch-tests.scm -specialize -w if errorlevel 1 exit /b 1 diff --git a/tests/runtests.sh b/tests/runtests.sh index 7bf282e..1af8155 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -81,6 +81,10 @@ echo "======================================== compiler inlining tests ..." $compile inlining-tests.scm -optimize-level 3 ./a.out +echo "======================================== optimizer tests ..." +$compile clustering-tests.scm -clustering +./a.out + echo "======================================== scrutiny tests ..." $compile typematch-tests.scm -specialize -w ./a.out -- 2.1.4