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 = \
115 square+triangle-1-1-2-3 \
128 ./non_optimal/nul_complex1 \
129 ./non_optimal/usvd_e_t \
130 ./non_optimal/youcef \
131 ./reservoir/cholesky2 \
132 ./reservoir/fusion1 \
133 ./reservoir/fusion2 \
134 ./reservoir/jacobi2 \
135 ./reservoir/jacobi3 \
136 ./reservoir/lim-lam1 \
137 ./reservoir/lim-lam2 \
138 ./reservoir/lim-lam3 \
139 ./reservoir/lim-lam4 \
140 ./reservoir/lim-lam5 \
141 ./reservoir/lim-lam6 \
142 ./reservoir/liu-zhuge1 \
143 ./reservoir/loechner3 \
144 ./reservoir/loechner4 \
145 ./reservoir/loechner5 \
146 ./reservoir/mg-interp2 \
147 ./reservoir/mg-interp \
148 ./reservoir/mg-psinv \
149 ./reservoir/mg-resid \
150 ./reservoir/mg-rprj3 \
151 ./reservoir/pingali1 \
152 ./reservoir/pingali2 \
153 ./reservoir/pingali3 \
154 ./reservoir/pingali4 \
155 ./reservoir/pingali5 \
156 ./reservoir/pingali6 \
158 ./reservoir/tang-xue1 \
166 $(FINITE_CLOOGTEST_C)
171 CLOOGTEST_FORTRAN = \
177 CLOOGTEST_STRIDED = \
198 'vasilache -f 8 -l 9' \
200 'equality -f -1 -l 2 -override' \
201 'equality2 -f -1 -l 4 -esp 1 -override' \
202 'stride -f -1 -strides 1' \
203 'stride2 -f -1 -strides 1' \
207 $(CLOOGTEST_C:%=%.cloog) \
208 $(CLOOGTEST_C:%=%.c) \
209 $(FINITE_CLOOGTEST_C:%=%.good.c) \
210 $(CLOOGTEST_FORTRAN:%=%.cloog) \
211 $(CLOOGTEST_FORTRAN:%=%.f) \
212 $(CLOOGTEST_STRIDED:%=%.cloog) \
213 $(CLOOGTEST_STRIDED:%=%.c) \
214 $(SPECIAL_TESTS:%=%.cloog) \
215 $(SPECIAL_TESTS:%=%.c) \
216 $(SPECIAL_TESTS:%=%.good.c)
219 @echo " /*-----------------------------------------------*"
220 @echo " * Generate files *"
221 @echo " *-----------------------------------------------*/"
222 @for x in $(CLOOGTEST_C) ; do \
223 echo "Generate $$x.c" ; \
224 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
226 for x in $(CLOOGTEST_FORTRAN) ; do \
227 echo "Generate $$x.f" ; \
228 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
230 for x in $(CLOOGTEST_STRIDED) ; do \
231 echo "Generate $$x.c" ; \
232 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
233 -strides 1 -o $(srcdir)/$$x.c ; \
235 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
236 echo "Generate file $$x ($$options)" ; \
237 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
238 $$options > $(srcdir)/$$x.c ; \
242 @for x in $(FINITE_CLOOGTEST_C) ; do \
243 echo "Generate $$x.good.c" ; \
244 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
246 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
247 echo "Generate $$x.good.c ($$options)" ; \
248 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
252 @echo " /*-----------------------------------------------*"
253 @echo " * Checking files by Valgrind *"
254 @echo " *-----------------------------------------------*/"
255 for x in $(CLOOGTEST_C) ; do \
256 echo "Valgrinding $$x.c" ; \
257 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
259 for x in $(CLOOGTEST_FORTRAN) ; do \
260 echo "Valgrinding $$x.f" ; \
261 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
264 test_run: generate_test$(EXEEXT)
265 @echo " /*-----------------------------------------------*"
266 @echo " * Testing CLooG *"
267 @echo " *-----------------------------------------------*/"
269 echo "--- Testing C files... (correct output)" ; \
270 for x in $(FINITE_CLOOGTEST_C) ; do \
271 echo -n "Verify file $$x... " ; \
272 echo -n "generating... " ; \
273 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
274 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
275 echo -n "compiling... " ; \
276 $(COMPILE) -c test_test.c; \
277 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
278 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
279 echo -n "comparing... " ; \
280 ./test_run$(EXEEXT); \
282 if test "$$result" -ne "0" ; then \
283 failedtest=`expr $$failedtest + 1` ; \
288 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
289 echo -n "Verify file $$x ($$options)... " ; \
290 echo -n "generating... " ; \
291 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
292 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
293 echo -n "compiling... " ; \
294 $(COMPILE) -c test_test.c; \
295 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
296 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
297 echo -n "comparing... " ; \
298 ./test_run$(EXEEXT); \
300 if test "$$result" -ne "0" ; then \
301 failedtest=`expr $$failedtest + 1` ; \
306 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
307 echo -n "Verify file $$x ($$options -sh 1)... " ; \
308 echo -n "generating... " ; \
309 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
310 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
311 echo -n "compiling... " ; \
312 $(COMPILE) -c test_test.c; \
313 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
314 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
315 echo -n "comparing... " ; \
316 ./test_run$(EXEEXT); \
318 if test "$$result" -ne "0" ; then \
319 failedtest=`expr $$failedtest + 1` ; \
324 if [ $$failedtest != 0 ] ; then \
325 echo "$$failedtest tests failed" ; \
327 echo "CLooG works correctly :-) !" ; \
330 @echo " /*-----------------------------------------------*"
331 @echo " * Testing CLooG *"
332 @echo " *-----------------------------------------------*/"
334 echo "--- Testing C files... (expected output)" ; \
335 for x in $(CLOOGTEST_C) ; do \
336 echo "Verify file $$x" ; \
337 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
338 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
340 if [ "$$result" -ne "0" ] ; then \
341 echo "!!! Error: $$x is not the same" ; \
342 failedtest=`expr $$failedtest + 1` ; \
344 echo "$$x passed" ; \
347 echo "--- Testing FORTRAN files..." ; \
348 for x in $(CLOOGTEST_FORTRAN) ; do \
349 echo "Verify file $$x" ; \
350 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
351 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
353 if [ "$$result" -ne "0" ] ; then \
354 echo "!!! Error: $$x is not the same" ; \
355 failedtest=`expr $$failedtest + 1` ; \
357 echo "$$x passed" ; \
360 echo "--- Testing STRIDED files..." ; \
361 for x in $(CLOOGTEST_STRIDED) ; do \
362 echo "Verify file $$x" ; \
363 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
364 -strides 1 > 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 SPECIAL OPTIONS files..." ; \
375 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
376 echo "Verify file $$x ($$options)" ; \
377 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
378 $$options > 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" ; \
389 if [ $$failedtest != 0 ] ; then \
390 echo "$$failedtest tests failed" ; \
392 echo "CLooG works correctly :-) !" ; \