From 5e4a2e08c88a1d4aec5d128d87ec5505aa50fc56 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 --- distribution/manifest | 1 + tests/clustering-tests.scm | 7 +++++++ tests/runtests.bat | 6 ++++++ tests/runtests.sh | 4 ++++ 4 files changed, 18 insertions(+) create mode 100644 tests/clustering-tests.scm diff --git a/distribution/manifest b/distribution/manifest index 6e1dcc5..1493bda 100644 --- a/distribution/manifest +++ b/distribution/manifest @@ -94,6 +94,7 @@ build-version.scm build-version.c buildid buildtag.h +tests/clustering-tests.scm tests/data-structures-tests.scm tests/environment-tests.scm tests/gobble.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