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 CLOOGTEST_STRIDED = \
214 'vasilache -f 8 -l 9' \
216 'equality -f -1 -l 2 -override' \
217 'equality2 -f -1 -l 4 -esp 1 -override' \
218 'otl -block 1 -esp 0 -otl 0' \
219 'param-split -f -1' \
220 'stride -f -1 -strides 1' \
221 'stride2 -f -1 -strides 1' \
225 $(CLOOGTEST_C:%=%.cloog) \
226 $(CLOOGTEST_C:%=%.c) \
227 $(FINITE_CLOOGTEST_C:%=%.good.c) \
228 $(CLOOGTEST_FORTRAN:%=%.cloog) \
229 $(CLOOGTEST_FORTRAN:%=%.f) \
230 $(CLOOGTEST_STRIDED:%=%.cloog) \
231 $(CLOOGTEST_STRIDED:%=%.c) \
232 $(SPECIAL_TESTS:%=%.cloog) \
233 $(SPECIAL_TESTS:%=%.c) \
234 $(SPECIAL_TESTS:%=%.good.c)
237 @echo " /*-----------------------------------------------*"
238 @echo " * Generate files *"
239 @echo " *-----------------------------------------------*/"
240 @for x in $(CLOOGTEST_C) ; do \
241 echo "Generate $$x.c" ; \
242 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
244 for x in $(CLOOGTEST_FORTRAN) ; do \
245 echo "Generate $$x.f" ; \
246 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
248 for x in $(CLOOGTEST_STRIDED) ; do \
249 echo "Generate $$x.c" ; \
250 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
251 -strides 1 -o $(srcdir)/$$x.c ; \
253 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
254 echo "Generate file $$x ($$options)" ; \
255 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
256 $$options > $(srcdir)/$$x.c ; \
260 @for x in $(FINITE_CLOOGTEST_C) ; do \
261 echo "Generate $$x.good.c" ; \
262 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
264 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
265 echo "Generate $$x.good.c ($$options)" ; \
266 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
270 @echo " /*-----------------------------------------------*"
271 @echo " * Checking files by Valgrind *"
272 @echo " *-----------------------------------------------*/"
273 for x in $(CLOOGTEST_C) ; do \
274 echo "Valgrinding $$x.c" ; \
275 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
277 for x in $(CLOOGTEST_FORTRAN) ; do \
278 echo "Valgrinding $$x.f" ; \
279 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
282 test_run: generate_test$(EXEEXT)
283 @echo " /*-----------------------------------------------*"
284 @echo " * Testing CLooG *"
285 @echo " *-----------------------------------------------*/"
287 echo "--- Testing C files... (correct output)" ; \
288 for x in $(FINITE_CLOOGTEST_C) ; do \
289 echo -n "Verify file $$x... " ; \
290 echo -n "generating... " ; \
291 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(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)... " ; \
308 echo -n "generating... " ; \
309 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(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 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
325 echo -n "Verify file $$x ($$options -sh 1)... " ; \
326 echo -n "generating... " ; \
327 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
328 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
329 echo -n "compiling... " ; \
330 $(COMPILE) -c test_test.c; \
331 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
332 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
333 echo -n "comparing... " ; \
334 ./test_run$(EXEEXT); \
336 if test "$$result" -ne "0" ; then \
337 failedtest=`expr $$failedtest + 1` ; \
342 if [ $$failedtest != 0 ] ; then \
343 echo "$$failedtest tests failed" ; \
345 echo "CLooG works correctly :-) !" ; \
348 @echo " /*-----------------------------------------------*"
349 @echo " * Testing CLooG *"
350 @echo " *-----------------------------------------------*/"
352 echo "--- Testing C files... (expected output)" ; \
353 for x in $(CLOOGTEST_C) ; do \
354 echo "Verify file $$x" ; \
355 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
356 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
358 if [ "$$result" -ne "0" ] ; then \
359 echo "!!! Error: $$x is not the same" ; \
360 failedtest=`expr $$failedtest + 1` ; \
362 echo "$$x passed" ; \
365 echo "--- Testing FORTRAN files..." ; \
366 for x in $(CLOOGTEST_FORTRAN) ; do \
367 echo "Verify file $$x" ; \
368 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
369 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
371 if [ "$$result" -ne "0" ] ; then \
372 echo "!!! Error: $$x is not the same" ; \
373 failedtest=`expr $$failedtest + 1` ; \
375 echo "$$x passed" ; \
378 echo "--- Testing STRIDED files..." ; \
379 for x in $(CLOOGTEST_STRIDED) ; do \
380 echo "Verify file $$x" ; \
381 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
382 -strides 1 > ttemp ; \
383 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
385 if [ "$$result" -ne "0" ] ; then \
386 echo "!!! Error: $$x is not the same" ; \
387 failedtest=`expr $$failedtest + 1` ; \
389 echo "$$x passed" ; \
392 echo "--- Testing SPECIAL OPTIONS files..." ; \
393 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
394 echo "Verify file $$x ($$options)" ; \
395 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
396 $$options > ttemp ; \
397 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
399 if [ "$$result" -ne "0" ] ; then \
400 echo "!!! Error: $$x is not the same" ; \
401 failedtest=`expr $$failedtest + 1` ; \
403 echo "$$x passed" ; \
407 if [ $$failedtest != 0 ] ; then \
408 echo "$$failedtest tests failed" ; \
410 echo "CLooG works correctly :-) !" ; \