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)
219 'vasilache -f 8 -l 9' \
221 'equality -f -1 -l 2 -override' \
222 'equality2 -f -1 -l 4 -esp 1 -override' \
223 'otl -block 1 -esp 0 -otl 0' \
224 'param-split -f -1' \
225 'stride -f -1 -strides 1' \
226 'stride2 -f -1 -strides 1' \
230 $(CLOOGTEST_C:%=%.cloog) \
231 $(CLOOGTEST_C:%=%.c) \
232 $(FINITE_CLOOGTEST_C:%=%.good.c) \
233 $(CLOOGTEST_FORTRAN:%=%.cloog) \
234 $(CLOOGTEST_FORTRAN:%=%.f) \
235 $(CLOOGTEST_STRIDED:%=%.cloog) \
236 $(CLOOGTEST_STRIDED:%=%.c) \
237 $(SPECIAL_TESTS:%=%.cloog) \
238 $(SPECIAL_TESTS:%=%.c) \
239 $(SPECIAL_TESTS:%=%.good.c)
242 @echo " /*-----------------------------------------------*"
243 @echo " * Generate files *"
244 @echo " *-----------------------------------------------*/"
245 @for x in $(CLOOGTEST_C) ; do \
246 echo "Generate $$x.c" ; \
247 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
249 for x in $(CLOOGTEST_FORTRAN) ; do \
250 echo "Generate $$x.f" ; \
251 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
253 for x in $(CLOOGTEST_STRIDED) ; do \
254 echo "Generate $$x.c" ; \
255 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
256 -strides 1 -o $(srcdir)/$$x.c ; \
258 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
259 echo "Generate file $$x ($$options)" ; \
260 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
261 $$options > $(srcdir)/$$x.c ; \
265 @for x in $(FINITE_CLOOGTEST_C) ; do \
266 echo "Generate $$x.good.c" ; \
267 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
269 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
270 echo "Generate $$x.good.c ($$options)" ; \
271 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
275 @echo " /*-----------------------------------------------*"
276 @echo " * Checking files by Valgrind *"
277 @echo " *-----------------------------------------------*/"
278 for x in $(CLOOGTEST_C) ; do \
279 echo "Valgrinding $$x.c" ; \
280 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
282 for x in $(CLOOGTEST_FORTRAN) ; do \
283 echo "Valgrinding $$x.f" ; \
284 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
287 test_run: generate_test$(EXEEXT)
288 @echo " /*-----------------------------------------------*"
289 @echo " * Testing CLooG *"
290 @echo " *-----------------------------------------------*/"
292 echo "--- Testing C files... (correct output)" ; \
293 for x in $(FINITE_CLOOGTEST_C) ; do \
294 echo -n "Verify file $$x... " ; \
295 echo -n "generating... " ; \
296 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
297 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
298 echo -n "compiling... " ; \
299 $(COMPILE) -c test_test.c; \
300 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
301 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
302 echo -n "comparing... " ; \
303 ./test_run$(EXEEXT); \
305 if test "$$result" -ne "0" ; then \
306 failedtest=`expr $$failedtest + 1` ; \
311 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
312 echo -n "Verify file $$x ($$options)... " ; \
313 echo -n "generating... " ; \
314 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
315 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
316 echo -n "compiling... " ; \
317 $(COMPILE) -c test_test.c; \
318 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
319 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
320 echo -n "comparing... " ; \
321 ./test_run$(EXEEXT); \
323 if test "$$result" -ne "0" ; then \
324 failedtest=`expr $$failedtest + 1` ; \
329 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
330 echo -n "Verify file $$x ($$options -sh 1)... " ; \
331 echo -n "generating... " ; \
332 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
333 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
334 echo -n "compiling... " ; \
335 $(COMPILE) -c test_test.c; \
336 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
337 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
338 echo -n "comparing... " ; \
339 ./test_run$(EXEEXT); \
341 if test "$$result" -ne "0" ; then \
342 failedtest=`expr $$failedtest + 1` ; \
347 if [ $$failedtest != 0 ] ; then \
348 echo "$$failedtest tests failed" ; \
350 echo "CLooG works correctly :-) !" ; \
353 @echo " /*-----------------------------------------------*"
354 @echo " * Testing CLooG *"
355 @echo " *-----------------------------------------------*/"
357 echo "--- Testing C files... (expected output)" ; \
358 for x in $(CLOOGTEST_C) ; do \
359 echo "Verify file $$x" ; \
360 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
361 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
363 if [ "$$result" -ne "0" ] ; then \
364 echo "!!! Error: $$x is not the same" ; \
365 failedtest=`expr $$failedtest + 1` ; \
367 echo "$$x passed" ; \
370 echo "--- Testing FORTRAN files..." ; \
371 for x in $(CLOOGTEST_FORTRAN) ; do \
372 echo "Verify file $$x" ; \
373 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
374 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
376 if [ "$$result" -ne "0" ] ; then \
377 echo "!!! Error: $$x is not the same" ; \
378 failedtest=`expr $$failedtest + 1` ; \
380 echo "$$x passed" ; \
383 echo "--- Testing STRIDED files..." ; \
384 for x in $(CLOOGTEST_STRIDED) ; do \
385 echo "Verify file $$x" ; \
386 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
387 -strides 1 > ttemp ; \
388 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
390 if [ "$$result" -ne "0" ] ; then \
391 echo "!!! Error: $$x is not the same" ; \
392 failedtest=`expr $$failedtest + 1` ; \
394 echo "$$x passed" ; \
397 echo "--- Testing SPECIAL OPTIONS files..." ; \
398 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
399 echo "Verify file $$x ($$options)" ; \
400 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
401 $$options > ttemp ; \
402 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
404 if [ "$$result" -ne "0" ] ; then \
405 echo "!!! Error: $$x is not the same" ; \
406 failedtest=`expr $$failedtest + 1` ; \
408 echo "$$x passed" ; \
412 if [ $$failedtest != 0 ] ; then \
413 echo "$$failedtest tests failed" ; \
415 echo "CLooG works correctly :-) !" ; \