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 AM_CPPFLAGS = -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 = \
121 square+triangle-1-1-2-3 \
136 non_optimal/nul_complex1 \
137 non_optimal/usvd_e_t \
139 reservoir/cholesky2 \
150 reservoir/liu-zhuge1 \
151 reservoir/loechner3 \
152 reservoir/loechner4 \
153 reservoir/loechner5 \
154 reservoir/mg-interp2 \
155 reservoir/mg-interp \
166 reservoir/tang-xue1 \
180 $(FINITE_CLOOGTEST_C) \
183 CLOOGTEST_FORTRAN = \
189 CLOOG_ISL_TEST_STRIDED = \
192 CLOOGTEST_STRIDED = \
205 $(CLOOG_ISL_TEST_STRIDED)
210 CLOOGTEST_OPENSCOP = \
215 openscop/coordinates \
236 'isl/unroll -first-unroll 1' \
237 'isl/jacobi-shared -f 4 -l -1 -override -strides 1 -sh 1' \
238 'isl/unroll2 -first-unroll 1' \
239 'backtrack -f 1 -backtrack' \
240 'vasilache -f 8 -l 9' \
242 'equality -f -1 -l 2 -override' \
243 'equality2 -f -1 -l 4 -esp 1 -override' \
244 'otl -block 1 -esp 0 -otl 0' \
245 'param-split -f -1' \
246 'pouchet -f 3 -l 7' \
247 'stride -f -1 -strides 1' \
248 'stride2 -f -1 -strides 1' \
252 @echo " /*-----------------------------------------------*"
253 @echo " * Generate files *"
254 @echo " *-----------------------------------------------*/"
255 @for x in $(CLOOGTEST_C) ; do \
256 echo "Generate $$x.c" ; \
257 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
259 for x in $(CLOOGTEST_FORTRAN) ; do \
260 echo "Generate $$x.f" ; \
261 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
263 for x in $(CLOOGTEST_STRIDED) ; do \
264 echo "Generate $$x.c" ; \
265 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
266 -strides 1 -o $(srcdir)/$$x.c ; \
268 for x in $(CLOOGTEST_OPENSCOP) ; do \
269 echo "Generate $$x.c" ; \
270 $(top_builddir)/cloog $(srcdir)/$$x.scop \
271 -openscop -o $(srcdir)/$$x.c ; \
273 for line in $(SPECIAL_OPTIONS); do \
274 options=`echo $$line | sed -e 's/^[^ ]* //'`; \
275 x=`echo $$line | sed -e 's/ .*//'`; \
276 echo "Generate file $$x ($$options)" ; \
277 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
278 $$options > $(srcdir)/$$x.c ; \
282 @for x in $(FINITE_CLOOGTEST_C) ; do \
283 echo "Generate $$x.good.c" ; \
284 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
286 for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
287 echo "Generate $$x.good.c ($$options)" ; \
288 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
291 valcheck: test_valgrind
293 CHECKER := "$(srcdir)/checker.sh"
295 TESTS_ENVIRONMENT = \
296 top_builddir=$(top_builddir) \
300 COMPILE="$(COMPILE)" \
302 FINITE_CLOOGTEST_C="$(FINITE_CLOOGTEST_C)" \
303 CLOOGTEST_C="$(CLOOGTEST_C)" \
304 CLOOGTEST_FORTRAN="$(CLOOGTEST_FORTRAN)" \
305 CLOOGTEST_STRIDED="$(CLOOGTEST_STRIDED)" \
306 CLOOGTEST_OPENSCOP="$(CLOOGTEST_OPENSCOP)" \
307 SPECIAL_OPTIONS="$(SPECIAL_OPTIONS)"
309 test_run: generate_test$(EXEEXT)
310 $(TESTS_ENVIRONMENT) $(srcdir)/check_run.sh
313 $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh valgrind ; \
314 $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh valgrind ; \
315 $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh valgrind ; \
316 $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh valgrind ; \
317 $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh valgrind
320 $(TESTS_ENVIRONMENT) $(srcdir)/check_c.sh regenerate ; \
321 $(TESTS_ENVIRONMENT) $(srcdir)/check_fortran.sh regenerate ; \
322 $(TESTS_ENVIRONMENT) $(srcdir)/check_strided.sh regenerate ; \
323 $(TESTS_ENVIRONMENT) $(srcdir)/check_openscop.sh regenerate ; \
324 $(TESTS_ENVIRONMENT) $(srcdir)/check_special.sh regenerate
333 TESTS = $(check_SCRIPTS)
337 $(srcdir)/checker.sh \
338 $(srcdir)/check_run.sh \
339 $(CLOOGTEST_C:%=%.cloog) \
340 $(CLOOGTEST_C:%=%.c) \
341 $(FINITE_CLOOGTEST_C:%=%.good.c) \
342 $(CLOOGTEST_FORTRAN:%=%.cloog) \
343 $(CLOOGTEST_FORTRAN:%=%.f) \
344 $(CLOOGTEST_STRIDED:%=%.cloog) \
345 $(CLOOGTEST_STRIDED:%=%.c) \
346 $(CLOOGTEST_OPENSCOP:%=%.scop) \
347 $(CLOOGTEST_OPENSCOP:%=%.c) \
348 $(SPECIAL_TESTS:%=%.cloog) \
349 $(SPECIAL_TESTS:%=%.c) \
350 $(SPECIAL_TESTS:%=%.good.c) \
351 openscop/clay_orig.c \
352 openscop/coordinates_orig.c