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 = \
117 square+triangle-1-1-2-3 \
130 ./non_optimal/nul_complex1 \
131 ./non_optimal/usvd_e_t \
132 ./non_optimal/youcef \
133 ./reservoir/cholesky2 \
134 ./reservoir/fusion1 \
135 ./reservoir/fusion2 \
136 ./reservoir/jacobi2 \
137 ./reservoir/jacobi3 \
138 ./reservoir/lim-lam1 \
139 ./reservoir/lim-lam2 \
140 ./reservoir/lim-lam3 \
141 ./reservoir/lim-lam4 \
142 ./reservoir/lim-lam5 \
143 ./reservoir/lim-lam6 \
144 ./reservoir/liu-zhuge1 \
145 ./reservoir/loechner3 \
146 ./reservoir/loechner4 \
147 ./reservoir/loechner5 \
148 ./reservoir/mg-interp2 \
149 ./reservoir/mg-interp \
150 ./reservoir/mg-psinv \
151 ./reservoir/mg-resid \
152 ./reservoir/mg-rprj3 \
153 ./reservoir/pingali1 \
154 ./reservoir/pingali2 \
155 ./reservoir/pingali3 \
156 ./reservoir/pingali4 \
157 ./reservoir/pingali5 \
158 ./reservoir/pingali6 \
160 ./reservoir/tang-xue1 \
168 $(FINITE_CLOOGTEST_C)
173 CLOOGTEST_FORTRAN = \
179 CLOOGTEST_STRIDED = \
202 'vasilache -f 8 -l 9' \
204 'equality -f -1 -l 2 -override' \
205 'equality2 -f -1 -l 4 -esp 1 -override' \
206 'otl -block 1 -esp 0 -otl 0' \
207 'param-split -f -1' \
208 'stride -f -1 -strides 1' \
209 'stride2 -f -1 -strides 1' \
213 $(CLOOGTEST_C:%=%.cloog) \
214 $(CLOOGTEST_C:%=%.c) \
215 $(FINITE_CLOOGTEST_C:%=%.good.c) \
216 $(CLOOGTEST_FORTRAN:%=%.cloog) \
217 $(CLOOGTEST_FORTRAN:%=%.f) \
218 $(CLOOGTEST_STRIDED:%=%.cloog) \
219 $(CLOOGTEST_STRIDED:%=%.c) \
220 $(SPECIAL_TESTS:%=%.cloog) \
221 $(SPECIAL_TESTS:%=%.c) \
222 $(SPECIAL_TESTS:%=%.good.c)
225 @echo " /*-----------------------------------------------*"
226 @echo " * Generate files *"
227 @echo " *-----------------------------------------------*/"
228 @for x in $(CLOOGTEST_C) ; do \
229 echo "Generate $$x.c" ; \
230 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
232 for x in $(CLOOGTEST_FORTRAN) ; do \
233 echo "Generate $$x.f" ; \
234 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
236 for x in $(CLOOGTEST_STRIDED) ; do \
237 echo "Generate $$x.c" ; \
238 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
239 -strides 1 -o $(srcdir)/$$x.c ; \
241 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
242 echo "Generate file $$x ($$options)" ; \
243 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
244 $$options > $(srcdir)/$$x.c ; \
248 @for x in $(FINITE_CLOOGTEST_C) ; do \
249 echo "Generate $$x.good.c" ; \
250 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
252 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
253 echo "Generate $$x.good.c ($$options)" ; \
254 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
258 @echo " /*-----------------------------------------------*"
259 @echo " * Checking files by Valgrind *"
260 @echo " *-----------------------------------------------*/"
261 for x in $(CLOOGTEST_C) ; do \
262 echo "Valgrinding $$x.c" ; \
263 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
265 for x in $(CLOOGTEST_FORTRAN) ; do \
266 echo "Valgrinding $$x.f" ; \
267 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
270 test_run: generate_test$(EXEEXT)
271 @echo " /*-----------------------------------------------*"
272 @echo " * Testing CLooG *"
273 @echo " *-----------------------------------------------*/"
275 echo "--- Testing C files... (correct output)" ; \
276 for x in $(FINITE_CLOOGTEST_C) ; do \
277 echo -n "Verify file $$x... " ; \
278 echo -n "generating... " ; \
279 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
280 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
281 echo -n "compiling... " ; \
282 $(COMPILE) -c test_test.c; \
283 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
284 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
285 echo -n "comparing... " ; \
286 ./test_run$(EXEEXT); \
288 if test "$$result" -ne "0" ; then \
289 failedtest=`expr $$failedtest + 1` ; \
294 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
295 echo -n "Verify file $$x ($$options)... " ; \
296 echo -n "generating... " ; \
297 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
298 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
299 echo -n "compiling... " ; \
300 $(COMPILE) -c test_test.c; \
301 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
302 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
303 echo -n "comparing... " ; \
304 ./test_run$(EXEEXT); \
306 if test "$$result" -ne "0" ; then \
307 failedtest=`expr $$failedtest + 1` ; \
312 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
313 echo -n "Verify file $$x ($$options -sh 1)... " ; \
314 echo -n "generating... " ; \
315 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
316 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
317 echo -n "compiling... " ; \
318 $(COMPILE) -c test_test.c; \
319 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
320 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
321 echo -n "comparing... " ; \
322 ./test_run$(EXEEXT); \
324 if test "$$result" -ne "0" ; then \
325 failedtest=`expr $$failedtest + 1` ; \
330 if [ $$failedtest != 0 ] ; then \
331 echo "$$failedtest tests failed" ; \
333 echo "CLooG works correctly :-) !" ; \
336 @echo " /*-----------------------------------------------*"
337 @echo " * Testing CLooG *"
338 @echo " *-----------------------------------------------*/"
340 echo "--- Testing C files... (expected output)" ; \
341 for x in $(CLOOGTEST_C) ; do \
342 echo "Verify file $$x" ; \
343 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
344 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
346 if [ "$$result" -ne "0" ] ; then \
347 echo "!!! Error: $$x is not the same" ; \
348 failedtest=`expr $$failedtest + 1` ; \
350 echo "$$x passed" ; \
353 echo "--- Testing FORTRAN files..." ; \
354 for x in $(CLOOGTEST_FORTRAN) ; do \
355 echo "Verify file $$x" ; \
356 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
357 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
359 if [ "$$result" -ne "0" ] ; then \
360 echo "!!! Error: $$x is not the same" ; \
361 failedtest=`expr $$failedtest + 1` ; \
363 echo "$$x passed" ; \
366 echo "--- Testing STRIDED files..." ; \
367 for x in $(CLOOGTEST_STRIDED) ; do \
368 echo "Verify file $$x" ; \
369 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
370 -strides 1 > ttemp ; \
371 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
373 if [ "$$result" -ne "0" ] ; then \
374 echo "!!! Error: $$x is not the same" ; \
375 failedtest=`expr $$failedtest + 1` ; \
377 echo "$$x passed" ; \
380 echo "--- Testing SPECIAL OPTIONS files..." ; \
381 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
382 echo "Verify file $$x ($$options)" ; \
383 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
384 $$options > ttemp ; \
385 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
387 if [ "$$result" -ne "0" ] ; then \
388 echo "!!! Error: $$x is not the same" ; \
389 failedtest=`expr $$failedtest + 1` ; \
391 echo "$$x passed" ; \
395 if [ $$failedtest != 0 ] ; then \
396 echo "$$failedtest tests failed" ; \
398 echo "CLooG works correctly :-) !" ; \