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 = \
119 square+triangle-1-1-2-3 \
134 ./non_optimal/nul_complex1 \
135 ./non_optimal/usvd_e_t \
136 ./non_optimal/youcef \
137 ./reservoir/cholesky2 \
138 ./reservoir/fusion1 \
139 ./reservoir/fusion2 \
140 ./reservoir/jacobi2 \
141 ./reservoir/jacobi3 \
142 ./reservoir/lim-lam1 \
143 ./reservoir/lim-lam2 \
144 ./reservoir/lim-lam3 \
145 ./reservoir/lim-lam4 \
146 ./reservoir/lim-lam5 \
147 ./reservoir/lim-lam6 \
148 ./reservoir/liu-zhuge1 \
149 ./reservoir/loechner3 \
150 ./reservoir/loechner4 \
151 ./reservoir/loechner5 \
152 ./reservoir/mg-interp2 \
153 ./reservoir/mg-interp \
154 ./reservoir/mg-psinv \
155 ./reservoir/mg-resid \
156 ./reservoir/mg-rprj3 \
157 ./reservoir/pingali1 \
158 ./reservoir/pingali2 \
159 ./reservoir/pingali3 \
160 ./reservoir/pingali4 \
161 ./reservoir/pingali5 \
162 ./reservoir/pingali6 \
164 ./reservoir/tang-xue1 \
178 $(FINITE_CLOOGTEST_C) \
184 CLOOGTEST_FORTRAN = \
190 CLOOG_ISL_TEST_STRIDED = \
193 CLOOGTEST_STRIDED = \
206 $(CLOOG_ISL_TEST_STRIDED)
221 'backtrack -f 1 -backtrack' \
222 'vasilache -f 8 -l 9' \
224 'equality -f -1 -l 2 -override' \
225 'equality2 -f -1 -l 4 -esp 1 -override' \
226 'otl -block 1 -esp 0 -otl 0' \
227 'param-split -f -1' \
228 'pouchet -f 3 -l 7' \
229 'stride -f -1 -strides 1' \
230 'stride2 -f -1 -strides 1' \
234 $(CLOOGTEST_C:%=%.cloog) \
235 $(CLOOGTEST_C:%=%.c) \
236 $(FINITE_CLOOGTEST_C:%=%.good.c) \
237 $(CLOOGTEST_FORTRAN:%=%.cloog) \
238 $(CLOOGTEST_FORTRAN:%=%.f) \
239 $(CLOOGTEST_STRIDED:%=%.cloog) \
240 $(CLOOGTEST_STRIDED:%=%.c) \
241 $(SPECIAL_TESTS:%=%.cloog) \
242 $(SPECIAL_TESTS:%=%.c) \
243 $(SPECIAL_TESTS:%=%.good.c)
246 @echo " /*-----------------------------------------------*"
247 @echo " * Generate files *"
248 @echo " *-----------------------------------------------*/"
249 @for x in $(CLOOGTEST_C) ; do \
250 echo "Generate $$x.c" ; \
251 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
253 for x in $(CLOOGTEST_FORTRAN) ; do \
254 echo "Generate $$x.f" ; \
255 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
257 for x in $(CLOOGTEST_STRIDED) ; do \
258 echo "Generate $$x.c" ; \
259 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
260 -strides 1 -o $(srcdir)/$$x.c ; \
262 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
263 echo "Generate file $$x ($$options)" ; \
264 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
265 $$options > $(srcdir)/$$x.c ; \
269 @for x in $(FINITE_CLOOGTEST_C) ; do \
270 echo "Generate $$x.good.c" ; \
271 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
273 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
274 echo "Generate $$x.good.c ($$options)" ; \
275 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
279 @echo " /*-----------------------------------------------*"
280 @echo " * Checking files by Valgrind *"
281 @echo " *-----------------------------------------------*/"
282 for x in $(CLOOGTEST_C) ; do \
283 echo "Valgrinding $$x.c" ; \
284 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
286 for x in $(CLOOGTEST_FORTRAN) ; do \
287 echo "Valgrinding $$x.f" ; \
288 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
291 test_run: generate_test$(EXEEXT)
292 @echo " /*-----------------------------------------------*"
293 @echo " * Testing CLooG *"
294 @echo " *-----------------------------------------------*/"
296 echo "--- Testing C files... (correct output)" ; \
297 for x in $(FINITE_CLOOGTEST_C) ; do \
298 echo -n "Verify file $$x... " ; \
299 echo -n "generating... " ; \
300 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
301 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
302 echo -n "compiling... " ; \
303 $(COMPILE) -c test_test.c; \
304 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
305 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
306 echo -n "comparing... " ; \
307 ./test_run$(EXEEXT); \
309 if test "$$result" -ne "0" ; then \
310 failedtest=`expr $$failedtest + 1` ; \
315 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
316 echo -n "Verify file $$x ($$options)... " ; \
317 echo -n "generating... " ; \
318 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
319 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
320 echo -n "compiling... " ; \
321 $(COMPILE) -c test_test.c; \
322 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
323 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
324 echo -n "comparing... " ; \
325 ./test_run$(EXEEXT); \
327 if test "$$result" -ne "0" ; then \
328 failedtest=`expr $$failedtest + 1` ; \
333 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
334 echo -n "Verify file $$x ($$options -sh 1)... " ; \
335 echo -n "generating... " ; \
336 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
337 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
338 echo -n "compiling... " ; \
339 $(COMPILE) -c test_test.c; \
340 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
341 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
342 echo -n "comparing... " ; \
343 ./test_run$(EXEEXT); \
345 if test "$$result" -ne "0" ; then \
346 failedtest=`expr $$failedtest + 1` ; \
351 if [ $$failedtest != 0 ] ; then \
352 echo "$$failedtest tests failed" ; \
354 echo "CLooG works correctly :-) !" ; \
357 @echo " /*-----------------------------------------------*"
358 @echo " * Testing CLooG *"
359 @echo " *-----------------------------------------------*/"
361 echo "--- Testing C files... (expected output)" ; \
362 for x in $(CLOOGTEST_C) ; do \
363 echo "Verify file $$x" ; \
364 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
365 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
367 if [ "$$result" -ne "0" ] ; then \
368 echo "!!! Error: $$x is not the same" ; \
369 failedtest=`expr $$failedtest + 1` ; \
371 echo "$$x passed" ; \
374 echo "--- Testing FORTRAN files..." ; \
375 for x in $(CLOOGTEST_FORTRAN) ; do \
376 echo "Verify file $$x" ; \
377 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
378 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
380 if [ "$$result" -ne "0" ] ; then \
381 echo "!!! Error: $$x is not the same" ; \
382 failedtest=`expr $$failedtest + 1` ; \
384 echo "$$x passed" ; \
387 echo "--- Testing STRIDED files..." ; \
388 for x in $(CLOOGTEST_STRIDED) ; do \
389 echo "Verify file $$x" ; \
390 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
391 -strides 1 > ttemp ; \
392 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
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 SPECIAL OPTIONS files..." ; \
402 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
403 echo "Verify file $$x ($$options)" ; \
404 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
405 $$options > 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" ; \
416 if [ $$failedtest != 0 ] ; then \
417 echo "$$failedtest tests failed" ; \
419 echo "CLooG works correctly :-) !" ; \