propagate updated lower bounds on strided loops to outer levels
[cloog/uuh.git] / test / Makefile.am
blob9011eec4da0831c72e9ab73a102440706dadc1e5
2 #   /**-------------------------------------------------------------------**
3 #    **                              CLooG                                **
4 #    **-------------------------------------------------------------------**
5 #    **                            makefile                               **
6 #    **-------------------------------------------------------------------**
7 #    **                   First version: march 6th 2003                   **
8 #    **-------------------------------------------------------------------**/
10 # makefile for checking.
12 #/*****************************************************************************
13 # *               CLooG : the Chunky Loop Generator (experimental)            *
14 # *****************************************************************************
15 # *                                                                           *
16 # * Copyright (C) 2003 Cedric Bastoul                                         *
17 # *                                                                           *
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.        *
22 # *                                                                           *
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.                           *
27 # *                                                                           *
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                                               *
32 # *                                                                           *
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.                                                      *
37 # *                                                                           *
38 # *****************************************************************************/
40 if NO_ISL
41 GENERATE_TEST =
42 else
43 GENERATE_TEST = generate_test
44 endif
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
50 FORCE:
51 ../libcloog-isl.la: FORCE
52         cd ..; $(MAKE) $(AM_MAKEFLAGS) libcloog-isl.la
54 ROOT = ..
56 FINITE_CLOOGTEST_C =                   \
57         0D-1                           \
58         0D-2                           \
59         0D-3                           \
60         1point-1                       \
61         1point-2                       \
62         4-param                        \
63         basic-bounds-1                 \
64         basic-bounds-2                 \
65         basic-bounds-3                 \
66         basic-bounds-4                 \
67         basic-bounds-5                 \
68         basic-bounds-6                 \
69         block                          \
70         block2                         \
71         byu98-1-2-3                    \
72         cholesky                       \
73         cholesky2                      \
74         classen                        \
75         classen2                       \
76         constant                       \
77         constbound                     \
78         darte                          \
79         dealII                         \
80         donotsimp                      \
81         dot                            \
82         dot2                           \
83         double                         \
84         durbin_e_s                     \
85         emploi                         \
86         esced                          \
87         ex1                            \
88         forwardsub-1-1-2               \
89         forwardsub-2-1-2-3             \
90         forwardsub-3-1-2               \
91         gauss                          \
92         gesced                         \
93         gesced2                        \
94         gesced3                        \
95         guide                          \
96         iftest                         \
97         iftest2                        \
98         largeur                        \
99         levenshtein-1-2-3              \
100         lex                            \
101         lineality-1-2                  \
102         lineality-2-1-2                \
103         logo                           \
104         logopar                        \
105         lu                             \
106         lu2                            \
107         lub                            \
108         lux                            \
109         min-1-1                        \
110         min-2-1                        \
111         min-3-1                        \
112         min-4-1                        \
113         mode                           \
114         multi-mm-1                     \
115         no_lindep                      \
116         orc                            \
117         rectangle                      \
118         singleton                      \
119         square+triangle-1-1-2-3        \
120         swim                           \
121         test                           \
122         thomasset                      \
123         tiling                         \
124         uday_scalars                   \
125         union                          \
126         vivien                         \
127         vivien2                        \
128         walters                        \
129         walters2                       \
130         walters3                       \
131         wavefront                      \
132         yosr                           \
133         yosr2                          \
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           \
163         ./reservoir/QR                 \
164         ./reservoir/tang-xue1          \
165         ./reservoir/two   
167 CLOOG_ISL_TEST_C =                      \
168         isl/mod                         \
169         isl/mod2                        \
170         isl/mod3                        \
171         isl/mod4
173 CLOOGTEST_C =                          \
174         infinite                       \
175         infinite2                      \
176         infinite3                      \
177         infinite4                      \
178         $(FINITE_CLOOGTEST_C)          \
179         $(CLOOG_ISL_TEST_C)
181 #       ./reservoir/long               \
182 #       faber
184 CLOOGTEST_FORTRAN =                    \
185         dartef                         \
186         iftestf                        \
187         levenshtein-1-2-3f             \
188         yosrf
190 CLOOG_ISL_TEST_STRIDED =                \
191         isl/mxm-shared
193 CLOOGTEST_STRIDED =                    \
194         basic-bounds-2                 \
195         mod4                           \
196         nul_basic1                     \
197         nul_basic2                     \
198         nul_lcpc                       \
199         multi-stride                   \
200         multi-stride2                  \
201         stride3                        \
202         stride4                        \
203         reservoir/bastoul3             \
204         reservoir/stride               \
205         reservoir/stride2              \
206         $(CLOOG_ISL_TEST_STRIDED)
208 SPECIAL_TESTS = \
209         vasilache \
210         merge \
211         equality \
212         equality2 \
213         otl \
214         param-split \
215         stride \
216         stride2 \
217         sor1d
218 SPECIAL_OPTIONS = \
219         'vasilache -f 8 -l 9' \
220         'merge -f -1' \
221         'equality -f -1 -l 2 -override' \
222         'equality2 -f -1 -l 4 -esp 1 -override' \
223         'otl -block 1 -esp 0 -otl 0' \
224         'param-split -f -1' \
225         'stride -f -1 -strides 1' \
226         'stride2 -f -1 -strides 1' \
227         'sor1d -f -1'
229 EXTRA_DIST = \
230         $(CLOOGTEST_C:%=%.cloog) \
231         $(CLOOGTEST_C:%=%.c) \
232         $(FINITE_CLOOGTEST_C:%=%.good.c) \
233         $(CLOOGTEST_FORTRAN:%=%.cloog) \
234         $(CLOOGTEST_FORTRAN:%=%.f) \
235         $(CLOOGTEST_STRIDED:%=%.cloog) \
236         $(CLOOGTEST_STRIDED:%=%.c) \
237         $(SPECIAL_TESTS:%=%.cloog) \
238         $(SPECIAL_TESTS:%=%.c) \
239         $(SPECIAL_TESTS:%=%.good.c)
241 generate:
242         @echo "             /*-----------------------------------------------*"
243         @echo "              *                 Generate files                *"
244         @echo "              *-----------------------------------------------*/"
245         @for x in $(CLOOGTEST_C) ; do \
246                 echo "Generate $$x.c" ; \
247                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
248         done ; \
249         for x in $(CLOOGTEST_FORTRAN) ; do \
250                 echo "Generate $$x.f" ; \
251                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
252         done ; \
253         for x in $(CLOOGTEST_STRIDED) ; do \
254                 echo "Generate $$x.c" ; \
255                 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
256                         -strides 1 -o $(srcdir)/$$x.c ; \
257         done ; \
258         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
259                 echo "Generate file $$x ($$options)" ; \
260                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
261                     $$options > $(srcdir)/$$x.c ; \
262         done; done
264 generate_good:
265         @for x in $(FINITE_CLOOGTEST_C) ; do \
266                 echo "Generate $$x.good.c" ; \
267                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
268         done; \
269         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
270                 echo "Generate $$x.good.c ($$options)" ; \
271                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
272         done; done
274 valgrind:
275         @echo "             /*-----------------------------------------------*"
276         @echo "              *            Checking files by Valgrind         *"
277         @echo "              *-----------------------------------------------*/"
278         for x in $(CLOOGTEST_C) ; do \
279                 echo "Valgrinding $$x.c" ; \
280                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
281         done ; \
282         for x in $(CLOOGTEST_FORTRAN) ; do \
283                 echo "Valgrinding $$x.f" ; \
284                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
285         done
287 test_run: generate_test$(EXEEXT)
288         @echo "             /*-----------------------------------------------*"
289         @echo "              *                 Testing CLooG                 *"
290         @echo "              *-----------------------------------------------*/"
291         @failedtest=0 ; \
292         echo "--- Testing C files... (correct output)" ; \
293         for x in $(FINITE_CLOOGTEST_C) ; do \
294                 echo -n "Verify file $$x... " ; \
295                 echo -n "generating... " ; \
296                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(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); \
304                 result=$$?; \
305                 if test "$$result" -ne "0" ; then \
306                         failedtest=`expr $$failedtest + 1` ; \
307                 fi; \
308                 $(RM) $@; \
309                 echo; \
310         done; \
311         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
312                 echo -n "Verify file $$x ($$options)... " ; \
313                 echo -n "generating... " ; \
314                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(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); \
322                 result=$$?; \
323                 if test "$$result" -ne "0" ; then \
324                         failedtest=`expr $$failedtest + 1` ; \
325                 fi; \
326                 $(RM) $@; \
327                 echo; \
328         done; done; \
329         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
330                 echo -n "Verify file $$x ($$options -sh 1)... " ; \
331                 echo -n "generating... " ; \
332                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
333                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
334                 echo -n "compiling... " ; \
335                 $(COMPILE) -c test_test.c; \
336                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
337                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
338                 echo -n "comparing... " ; \
339                 ./test_run$(EXEEXT); \
340                 result=$$?; \
341                 if test "$$result" -ne "0" ; then \
342                         failedtest=`expr $$failedtest + 1` ; \
343                 fi; \
344                 $(RM) $@; \
345                 echo; \
346         done; done; \
347         if [ $$failedtest != 0 ] ; then \
348                 echo "$$failedtest tests failed" ; \
349         else \
350                 echo "CLooG works correctly :-) !" ; \
351         fi
352 test:
353         @echo "             /*-----------------------------------------------*"
354         @echo "              *                 Testing CLooG                 *"
355         @echo "              *-----------------------------------------------*/"
356         @failedtest=0 ; \
357         echo "--- Testing C files... (expected output)" ; \
358         for x in $(CLOOGTEST_C) ; do \
359                 echo "Verify file $$x" ; \
360                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
361                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
362                 result=$$?; \
363                 if [ "$$result" -ne "0" ] ; then \
364                         echo "!!! Error: $$x is not the same" ; \
365                         failedtest=`expr $$failedtest + 1` ; \
366                 else \
367                         echo "$$x passed" ; \
368                 fi ; \
369         done ; \
370         echo "--- Testing FORTRAN files..." ; \
371         for x in $(CLOOGTEST_FORTRAN) ; do \
372                 echo "Verify file $$x" ; \
373                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
374                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
375                 result=$$?; \
376                 if [ "$$result" -ne "0" ] ; then \
377                         echo "!!! Error: $$x is not the same" ; \
378                         failedtest=`expr $$failedtest + 1` ; \
379                 else \
380                         echo "$$x passed" ; \
381                 fi ; \
382         done ; \
383         echo "--- Testing STRIDED files..." ; \
384         for x in $(CLOOGTEST_STRIDED) ; do \
385                 echo "Verify file $$x" ; \
386                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
387                 -strides 1 > ttemp ; \
388                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
389                 result=$$?; \
390                 if [ "$$result" -ne "0" ] ; then \
391                         echo "!!! Error: $$x is not the same" ; \
392                         failedtest=`expr $$failedtest + 1` ; \
393                 else \
394                         echo "$$x passed" ; \
395                 fi ; \
396         done ; \
397         echo "--- Testing SPECIAL OPTIONS files..." ; \
398         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
399                 echo "Verify file $$x ($$options)" ; \
400                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
401                         $$options > ttemp ; \
402                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
403                 result=$$?; \
404                 if [ "$$result" -ne "0" ] ; then \
405                         echo "!!! Error: $$x is not the same" ; \
406                         failedtest=`expr $$failedtest + 1` ; \
407                 else \
408                         echo "$$x passed" ; \
409                 fi ; \
410         done; done; \
411         rm ttemp ; \
412         if [ $$failedtest != 0 ] ; then \
413                 echo "$$failedtest tests failed" ; \
414         else \
415                 echo "CLooG works correctly :-) !" ; \
416         fi