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 = \
201 'vasilache -f 8 -l 9' \
203 'equality -f -1 -l 2 -override' \
204 'equality2 -f -1 -l 4 -esp 1 -override' \
205 'otl -block 1 -esp 0 -otl 0' \
206 'param-split -f -1' \
207 'stride -f -1 -strides 1' \
208 'stride2 -f -1 -strides 1' \
212 $(CLOOGTEST_C:%=%.cloog) \
213 $(CLOOGTEST_C:%=%.c) \
214 $(FINITE_CLOOGTEST_C:%=%.good.c) \
215 $(CLOOGTEST_FORTRAN:%=%.cloog) \
216 $(CLOOGTEST_FORTRAN:%=%.f) \
217 $(CLOOGTEST_STRIDED:%=%.cloog) \
218 $(CLOOGTEST_STRIDED:%=%.c) \
219 $(SPECIAL_TESTS:%=%.cloog) \
220 $(SPECIAL_TESTS:%=%.c) \
221 $(SPECIAL_TESTS:%=%.good.c)
224 @echo " /*-----------------------------------------------*"
225 @echo " * Generate files *"
226 @echo " *-----------------------------------------------*/"
227 @for x in $(CLOOGTEST_C) ; do \
228 echo "Generate $$x.c" ; \
229 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
231 for x in $(CLOOGTEST_FORTRAN) ; do \
232 echo "Generate $$x.f" ; \
233 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
235 for x in $(CLOOGTEST_STRIDED) ; do \
236 echo "Generate $$x.c" ; \
237 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
238 -strides 1 -o $(srcdir)/$$x.c ; \
240 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
241 echo "Generate file $$x ($$options)" ; \
242 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
243 $$options > $(srcdir)/$$x.c ; \
247 @for x in $(FINITE_CLOOGTEST_C) ; do \
248 echo "Generate $$x.good.c" ; \
249 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
251 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
252 echo "Generate $$x.good.c ($$options)" ; \
253 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
257 @echo " /*-----------------------------------------------*"
258 @echo " * Checking files by Valgrind *"
259 @echo " *-----------------------------------------------*/"
260 for x in $(CLOOGTEST_C) ; do \
261 echo "Valgrinding $$x.c" ; \
262 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
264 for x in $(CLOOGTEST_FORTRAN) ; do \
265 echo "Valgrinding $$x.f" ; \
266 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
269 test_run: generate_test$(EXEEXT)
270 @echo " /*-----------------------------------------------*"
271 @echo " * Testing CLooG *"
272 @echo " *-----------------------------------------------*/"
274 echo "--- Testing C files... (correct output)" ; \
275 for x in $(FINITE_CLOOGTEST_C) ; do \
276 echo -n "Verify file $$x... " ; \
277 echo -n "generating... " ; \
278 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
279 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
280 echo -n "compiling... " ; \
281 $(COMPILE) -c test_test.c; \
282 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
283 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
284 echo -n "comparing... " ; \
285 ./test_run$(EXEEXT); \
287 if test "$$result" -ne "0" ; then \
288 failedtest=`expr $$failedtest + 1` ; \
293 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
294 echo -n "Verify file $$x ($$options)... " ; \
295 echo -n "generating... " ; \
296 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(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 -sh 1)... " ; \
313 echo -n "generating... " ; \
314 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(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 if [ $$failedtest != 0 ] ; then \
330 echo "$$failedtest tests failed" ; \
332 echo "CLooG works correctly :-) !" ; \
335 @echo " /*-----------------------------------------------*"
336 @echo " * Testing CLooG *"
337 @echo " *-----------------------------------------------*/"
339 echo "--- Testing C files... (expected output)" ; \
340 for x in $(CLOOGTEST_C) ; do \
341 echo "Verify file $$x" ; \
342 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
343 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
345 if [ "$$result" -ne "0" ] ; then \
346 echo "!!! Error: $$x is not the same" ; \
347 failedtest=`expr $$failedtest + 1` ; \
349 echo "$$x passed" ; \
352 echo "--- Testing FORTRAN files..." ; \
353 for x in $(CLOOGTEST_FORTRAN) ; 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.f ; \
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 STRIDED files..." ; \
366 for x in $(CLOOGTEST_STRIDED) ; do \
367 echo "Verify file $$x" ; \
368 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
369 -strides 1 > ttemp ; \
370 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
372 if [ "$$result" -ne "0" ] ; then \
373 echo "!!! Error: $$x is not the same" ; \
374 failedtest=`expr $$failedtest + 1` ; \
376 echo "$$x passed" ; \
379 echo "--- Testing SPECIAL OPTIONS files..." ; \
380 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
381 echo "Verify file $$x ($$options)" ; \
382 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
383 $$options > ttemp ; \
384 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
386 if [ "$$result" -ne "0" ] ; then \
387 echo "!!! Error: $$x is not the same" ; \
388 failedtest=`expr $$failedtest + 1` ; \
390 echo "$$x passed" ; \
394 if [ $$failedtest != 0 ] ; then \
395 echo "$$failedtest tests failed" ; \
397 echo "CLooG works correctly :-) !" ; \