2 # /**-------------------------------------------------------------------**
4 # **-------------------------------------------------------------------**
6 # **-------------------------------------------------------------------**
7 # ** First version: march 6th 2003 **
8 # **-------------------------------------------------------------------**/
10 # makefile for checking.
12 #/*****************************************************************************
13 # * CLooG : the Chunky Loop Generator (experimental) *
14 # *****************************************************************************
16 # * Copyright (C) 2003 Cedric Bastoul *
18 # * This library is free software; you can redistribute it and/or *
19 # * modify it under the terms of the GNU Lesser General Public *
20 # * License as published by the Free Software Foundation; either *
21 # * version 2.1 of the License, or (at your option) any later version. *
23 # * This library is distributed in the hope that it will be useful, *
24 # * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
26 # * Lesser General Public License for more details. *
28 # * You should have received a copy of the GNU Lesser General Public *
29 # * License along with this library; if not, write to the Free Software *
30 # * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
31 # * Boston, MA 02110-1301 USA *
33 # * CLooG, the Chunky Loop Generator *
34 # * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
35 # * This file has been written with the help of the Bart Kienhuis's checking *
36 # * makefile for PipLib. *
38 # *****************************************************************************/
43 GENERATE_TEST = generate_test
45 noinst_PROGRAMS = $(GENERATE_TEST)
46 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
47 LDADD = ../libcloog-isl.la
48 generate_test_SOURCES = generate_test.c
51 ../libcloog-isl.la: FORCE
52 cd ..; $(MAKE) $(AM_MAKEFLAGS) libcloog-isl.la
56 FINITE_CLOOGTEST_C = \
121 square+triangle-1-1-2-3 \
136 ./non_optimal/nul_complex1 \
137 ./non_optimal/usvd_e_t \
138 ./non_optimal/youcef \
139 ./reservoir/cholesky2 \
140 ./reservoir/fusion1 \
141 ./reservoir/fusion2 \
142 ./reservoir/jacobi2 \
143 ./reservoir/jacobi3 \
144 ./reservoir/lim-lam1 \
145 ./reservoir/lim-lam2 \
146 ./reservoir/lim-lam3 \
147 ./reservoir/lim-lam4 \
148 ./reservoir/lim-lam5 \
149 ./reservoir/lim-lam6 \
150 ./reservoir/liu-zhuge1 \
151 ./reservoir/loechner3 \
152 ./reservoir/loechner4 \
153 ./reservoir/loechner5 \
154 ./reservoir/mg-interp2 \
155 ./reservoir/mg-interp \
156 ./reservoir/mg-psinv \
157 ./reservoir/mg-resid \
158 ./reservoir/mg-rprj3 \
159 ./reservoir/pingali1 \
160 ./reservoir/pingali2 \
161 ./reservoir/pingali3 \
162 ./reservoir/pingali4 \
163 ./reservoir/pingali5 \
164 ./reservoir/pingali6 \
166 ./reservoir/tang-xue1 \
180 $(FINITE_CLOOGTEST_C) \
186 CLOOGTEST_FORTRAN = \
192 CLOOG_ISL_TEST_STRIDED = \
195 CLOOGTEST_STRIDED = \
208 $(CLOOG_ISL_TEST_STRIDED)
226 'isl/unroll -first-unroll 1' \
227 'isl/jacobi-shared -f 4 -l -1 -override -strides 1 -sh 1' \
228 'isl/unroll2 -first-unroll 1' \
229 'backtrack -f 1 -backtrack' \
230 'vasilache -f 8 -l 9' \
232 'equality -f -1 -l 2 -override' \
233 'equality2 -f -1 -l 4 -esp 1 -override' \
234 'otl -block 1 -esp 0 -otl 0' \
235 'param-split -f -1' \
236 'pouchet -f 3 -l 7' \
237 'stride -f -1 -strides 1' \
238 'stride2 -f -1 -strides 1' \
242 $(CLOOGTEST_C:%=%.cloog) \
243 $(CLOOGTEST_C:%=%.c) \
244 $(FINITE_CLOOGTEST_C:%=%.good.c) \
245 $(CLOOGTEST_FORTRAN:%=%.cloog) \
246 $(CLOOGTEST_FORTRAN:%=%.f) \
247 $(CLOOGTEST_STRIDED:%=%.cloog) \
248 $(CLOOGTEST_STRIDED:%=%.c) \
249 $(SPECIAL_TESTS:%=%.cloog) \
250 $(SPECIAL_TESTS:%=%.c) \
251 $(SPECIAL_TESTS:%=%.good.c)
254 @echo " /*-----------------------------------------------*"
255 @echo " * Generate files *"
256 @echo " *-----------------------------------------------*/"
257 @for x in $(CLOOGTEST_C) ; do \
258 echo "Generate $$x.c" ; \
259 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
261 for x in $(CLOOGTEST_FORTRAN) ; do \
262 echo "Generate $$x.f" ; \
263 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
265 for x in $(CLOOGTEST_STRIDED) ; do \
266 echo "Generate $$x.c" ; \
267 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
268 -strides 1 -o $(srcdir)/$$x.c ; \
270 for line in $(SPECIAL_OPTIONS); do \
271 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
272 x=`echo $$line | sed -e 's/ .*//'`; \
273 echo "Generate file $$x ($$options)" ; \
274 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
275 $$options > $(srcdir)/$$x.c ; \
279 @for x in $(FINITE_CLOOGTEST_C) ; do \
280 echo "Generate $$x.good.c" ; \
281 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
283 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
284 echo "Generate $$x.good.c ($$options)" ; \
285 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
289 @echo " /*-----------------------------------------------*"
290 @echo " * Checking files by Valgrind *"
291 @echo " *-----------------------------------------------*/"
292 for x in $(CLOOGTEST_C) ; do \
293 echo "Valgrinding $$x.c" ; \
294 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
296 for x in $(CLOOGTEST_FORTRAN) ; do \
297 echo "Valgrinding $$x.f" ; \
298 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
301 test_run: generate_test$(EXEEXT)
302 @echo " /*-----------------------------------------------*"
303 @echo " * Testing CLooG *"
304 @echo " *-----------------------------------------------*/"
306 echo "--- Testing C files... (correct output)" ; \
307 for x in $(FINITE_CLOOGTEST_C) ; do \
308 echo -n "Verify file $$x... " ; \
309 echo -n "generating... " ; \
310 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
311 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
312 echo -n "compiling... " ; \
313 $(COMPILE) -c test_test.c; \
314 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
315 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
316 echo -n "comparing... " ; \
317 ./test_run$(EXEEXT); \
319 if test "$$result" -ne "0" ; then \
320 failedtest=`expr $$failedtest + 1` ; \
325 for line in $(SPECIAL_OPTIONS); do \
326 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
327 x=`echo $$line | sed -e 's/ .*//'`; \
328 echo -n "Verify file $$x ($$options)... " ; \
329 echo -n "generating... " ; \
330 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
331 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
332 echo -n "compiling... " ; \
333 $(COMPILE) -c test_test.c; \
334 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
335 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
336 echo -n "comparing... " ; \
337 ./test_run$(EXEEXT); \
339 if test "$$result" -ne "0" ; then \
340 failedtest=`expr $$failedtest + 1` ; \
345 for line in $(SPECIAL_OPTIONS); do \
346 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
347 x=`echo $$line | sed -e 's/ .*//'`; \
348 echo -n "Verify file $$x ($$options -sh 1)... " ; \
349 echo -n "generating... " ; \
350 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
351 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
352 echo -n "compiling... " ; \
353 $(COMPILE) -c test_test.c; \
354 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
355 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
356 echo -n "comparing... " ; \
357 ./test_run$(EXEEXT); \
359 if test "$$result" -ne "0" ; then \
360 failedtest=`expr $$failedtest + 1` ; \
365 if [ $$failedtest != 0 ] ; then \
366 echo "$$failedtest tests failed" ; \
368 echo "CLooG works correctly :-) !" ; \
371 @echo " /*-----------------------------------------------*"
372 @echo " * Testing CLooG *"
373 @echo " *-----------------------------------------------*/"
375 echo "--- Testing C files... (expected output)" ; \
376 for x in $(CLOOGTEST_C) ; do \
377 echo "Verify file $$x" ; \
378 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
379 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
381 if [ "$$result" -ne "0" ] ; then \
382 echo "!!! Error: $$x is not the same" ; \
383 failedtest=`expr $$failedtest + 1` ; \
385 echo "$$x passed" ; \
388 echo "--- Testing FORTRAN files..." ; \
389 for x in $(CLOOGTEST_FORTRAN) ; do \
390 echo "Verify file $$x" ; \
391 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
392 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
394 if [ "$$result" -ne "0" ] ; then \
395 echo "!!! Error: $$x is not the same" ; \
396 failedtest=`expr $$failedtest + 1` ; \
398 echo "$$x passed" ; \
401 echo "--- Testing STRIDED files..." ; \
402 for x in $(CLOOGTEST_STRIDED) ; do \
403 echo "Verify file $$x" ; \
404 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
405 -strides 1 > ttemp ; \
406 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
408 if [ "$$result" -ne "0" ] ; then \
409 echo "!!! Error: $$x is not the same" ; \
410 failedtest=`expr $$failedtest + 1` ; \
412 echo "$$x passed" ; \
415 echo "--- Testing SPECIAL OPTIONS files..." ; \
416 for line in $(SPECIAL_OPTIONS); do \
417 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
418 x=`echo $$line | sed -e 's/ .*//'`; \
419 echo "Verify file $$x ($$options)" ; \
420 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
421 $$options > ttemp ; \
422 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
424 if [ "$$result" -ne "0" ] ; then \
425 echo "!!! Error: $$x is not the same" ; \
426 failedtest=`expr $$failedtest + 1` ; \
428 echo "$$x passed" ; \
432 if [ $$failedtest != 0 ] ; then \
433 echo "$$failedtest tests failed" ; \
435 echo "CLooG works correctly :-) !" ; \