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 \
132 ./non_optimal/nul_complex1 \
133 ./non_optimal/usvd_e_t \
134 ./non_optimal/youcef \
135 ./reservoir/cholesky2 \
136 ./reservoir/fusion1 \
137 ./reservoir/fusion2 \
138 ./reservoir/jacobi2 \
139 ./reservoir/jacobi3 \
140 ./reservoir/lim-lam1 \
141 ./reservoir/lim-lam2 \
142 ./reservoir/lim-lam3 \
143 ./reservoir/lim-lam4 \
144 ./reservoir/lim-lam5 \
145 ./reservoir/lim-lam6 \
146 ./reservoir/liu-zhuge1 \
147 ./reservoir/loechner3 \
148 ./reservoir/loechner4 \
149 ./reservoir/loechner5 \
150 ./reservoir/mg-interp2 \
151 ./reservoir/mg-interp \
152 ./reservoir/mg-psinv \
153 ./reservoir/mg-resid \
154 ./reservoir/mg-rprj3 \
155 ./reservoir/pingali1 \
156 ./reservoir/pingali2 \
157 ./reservoir/pingali3 \
158 ./reservoir/pingali4 \
159 ./reservoir/pingali5 \
160 ./reservoir/pingali6 \
162 ./reservoir/tang-xue1 \
175 $(FINITE_CLOOGTEST_C) \
181 CLOOGTEST_FORTRAN = \
187 CLOOGTEST_STRIDED = \
210 'vasilache -f 8 -l 9' \
212 'equality -f -1 -l 2 -override' \
213 'equality2 -f -1 -l 4 -esp 1 -override' \
214 'otl -block 1 -esp 0 -otl 0' \
215 'param-split -f -1' \
216 'stride -f -1 -strides 1' \
217 'stride2 -f -1 -strides 1' \
221 $(CLOOGTEST_C:%=%.cloog) \
222 $(CLOOGTEST_C:%=%.c) \
223 $(FINITE_CLOOGTEST_C:%=%.good.c) \
224 $(CLOOGTEST_FORTRAN:%=%.cloog) \
225 $(CLOOGTEST_FORTRAN:%=%.f) \
226 $(CLOOGTEST_STRIDED:%=%.cloog) \
227 $(CLOOGTEST_STRIDED:%=%.c) \
228 $(SPECIAL_TESTS:%=%.cloog) \
229 $(SPECIAL_TESTS:%=%.c) \
230 $(SPECIAL_TESTS:%=%.good.c)
233 @echo " /*-----------------------------------------------*"
234 @echo " * Generate files *"
235 @echo " *-----------------------------------------------*/"
236 @for x in $(CLOOGTEST_C) ; do \
237 echo "Generate $$x.c" ; \
238 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
240 for x in $(CLOOGTEST_FORTRAN) ; do \
241 echo "Generate $$x.f" ; \
242 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
244 for x in $(CLOOGTEST_STRIDED) ; do \
245 echo "Generate $$x.c" ; \
246 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
247 -strides 1 -o $(srcdir)/$$x.c ; \
249 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
250 echo "Generate file $$x ($$options)" ; \
251 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
252 $$options > $(srcdir)/$$x.c ; \
256 @for x in $(FINITE_CLOOGTEST_C) ; do \
257 echo "Generate $$x.good.c" ; \
258 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
260 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
261 echo "Generate $$x.good.c ($$options)" ; \
262 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
266 @echo " /*-----------------------------------------------*"
267 @echo " * Checking files by Valgrind *"
268 @echo " *-----------------------------------------------*/"
269 for x in $(CLOOGTEST_C) ; do \
270 echo "Valgrinding $$x.c" ; \
271 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
273 for x in $(CLOOGTEST_FORTRAN) ; do \
274 echo "Valgrinding $$x.f" ; \
275 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
278 test_run: generate_test$(EXEEXT)
279 @echo " /*-----------------------------------------------*"
280 @echo " * Testing CLooG *"
281 @echo " *-----------------------------------------------*/"
283 echo "--- Testing C files... (correct output)" ; \
284 for x in $(FINITE_CLOOGTEST_C) ; do \
285 echo -n "Verify file $$x... " ; \
286 echo -n "generating... " ; \
287 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
288 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
289 echo -n "compiling... " ; \
290 $(COMPILE) -c test_test.c; \
291 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
292 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
293 echo -n "comparing... " ; \
294 ./test_run$(EXEEXT); \
296 if test "$$result" -ne "0" ; then \
297 failedtest=`expr $$failedtest + 1` ; \
302 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
303 echo -n "Verify file $$x ($$options)... " ; \
304 echo -n "generating... " ; \
305 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
306 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
307 echo -n "compiling... " ; \
308 $(COMPILE) -c test_test.c; \
309 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
310 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
311 echo -n "comparing... " ; \
312 ./test_run$(EXEEXT); \
314 if test "$$result" -ne "0" ; then \
315 failedtest=`expr $$failedtest + 1` ; \
320 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
321 echo -n "Verify file $$x ($$options -sh 1)... " ; \
322 echo -n "generating... " ; \
323 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
324 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
325 echo -n "compiling... " ; \
326 $(COMPILE) -c test_test.c; \
327 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
328 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
329 echo -n "comparing... " ; \
330 ./test_run$(EXEEXT); \
332 if test "$$result" -ne "0" ; then \
333 failedtest=`expr $$failedtest + 1` ; \
338 if [ $$failedtest != 0 ] ; then \
339 echo "$$failedtest tests failed" ; \
341 echo "CLooG works correctly :-) !" ; \
344 @echo " /*-----------------------------------------------*"
345 @echo " * Testing CLooG *"
346 @echo " *-----------------------------------------------*/"
348 echo "--- Testing C files... (expected output)" ; \
349 for x in $(CLOOGTEST_C) ; do \
350 echo "Verify file $$x" ; \
351 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
352 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
354 if [ "$$result" -ne "0" ] ; then \
355 echo "!!! Error: $$x is not the same" ; \
356 failedtest=`expr $$failedtest + 1` ; \
358 echo "$$x passed" ; \
361 echo "--- Testing FORTRAN files..." ; \
362 for x in $(CLOOGTEST_FORTRAN) ; 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.f ; \
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 STRIDED files..." ; \
375 for x in $(CLOOGTEST_STRIDED) ; do \
376 echo "Verify file $$x" ; \
377 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
378 -strides 1 > 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 SPECIAL OPTIONS files..." ; \
389 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
390 echo "Verify file $$x ($$options)" ; \
391 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
392 $$options > ttemp ; \
393 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
395 if [ "$$result" -ne "0" ] ; then \
396 echo "!!! Error: $$x is not the same" ; \
397 failedtest=`expr $$failedtest + 1` ; \
399 echo "$$x passed" ; \
403 if [ $$failedtest != 0 ] ; then \
404 echo "$$failedtest tests failed" ; \
406 echo "CLooG works correctly :-) !" ; \