clast.c: don't construct set for reduction for local variables
[cloog.git] / test / Makefile.am
blob2e770f23375e211df5535715b9ceb93f974662ad
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 CLOOGTEST_STRIDED =                    \
191         basic-bounds-2                 \
192         mod4                           \
193         nul_basic1                     \
194         nul_basic2                     \
195         nul_lcpc                       \
196         multi-stride                   \
197         multi-stride2                  \
198         stride3                        \
199         reservoir/bastoul3             \
200         reservoir/stride               \
201         reservoir/stride2
203 SPECIAL_TESTS = \
204         vasilache \
205         merge \
206         equality \
207         equality2 \
208         otl \
209         param-split \
210         stride \
211         stride2 \
212         sor1d
213 SPECIAL_OPTIONS = \
214         'vasilache -f 8 -l 9' \
215         'merge -f -1' \
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' \
222         'sor1d -f -1'
224 EXTRA_DIST = \
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)
236 generate:
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 ; \
243         done ; \
244         for x in $(CLOOGTEST_FORTRAN) ; do \
245                 echo "Generate $$x.f" ; \
246                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
247         done ; \
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 ; \
252         done ; \
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 ; \
257         done; done
259 generate_good:
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 ; \
263         done; \
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 ; \
267         done; done
269 valgrind:
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 ; \
276         done ; \
277         for x in $(CLOOGTEST_FORTRAN) ; do \
278                 echo "Valgrinding $$x.f" ; \
279                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
280         done
282 test_run: generate_test$(EXEEXT)
283         @echo "             /*-----------------------------------------------*"
284         @echo "              *                 Testing CLooG                 *"
285         @echo "              *-----------------------------------------------*/"
286         @failedtest=0 ; \
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); \
299                 result=$$?; \
300                 if test "$$result" -ne "0" ; then \
301                         failedtest=`expr $$failedtest + 1` ; \
302                 fi; \
303                 $(RM) $@; \
304                 echo; \
305         done; \
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); \
317                 result=$$?; \
318                 if test "$$result" -ne "0" ; then \
319                         failedtest=`expr $$failedtest + 1` ; \
320                 fi; \
321                 $(RM) $@; \
322                 echo; \
323         done; done; \
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); \
335                 result=$$?; \
336                 if test "$$result" -ne "0" ; then \
337                         failedtest=`expr $$failedtest + 1` ; \
338                 fi; \
339                 $(RM) $@; \
340                 echo; \
341         done; done; \
342         if [ $$failedtest != 0 ] ; then \
343                 echo "$$failedtest tests failed" ; \
344         else \
345                 echo "CLooG works correctly :-) !" ; \
346         fi
347 test:
348         @echo "             /*-----------------------------------------------*"
349         @echo "              *                 Testing CLooG                 *"
350         @echo "              *-----------------------------------------------*/"
351         @failedtest=0 ; \
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 ; \
357                 result=$$?; \
358                 if [ "$$result" -ne "0" ] ; then \
359                         echo "!!! Error: $$x is not the same" ; \
360                         failedtest=`expr $$failedtest + 1` ; \
361                 else \
362                         echo "$$x passed" ; \
363                 fi ; \
364         done ; \
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 ; \
370                 result=$$?; \
371                 if [ "$$result" -ne "0" ] ; then \
372                         echo "!!! Error: $$x is not the same" ; \
373                         failedtest=`expr $$failedtest + 1` ; \
374                 else \
375                         echo "$$x passed" ; \
376                 fi ; \
377         done ; \
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 ; \
384                 result=$$?; \
385                 if [ "$$result" -ne "0" ] ; then \
386                         echo "!!! Error: $$x is not the same" ; \
387                         failedtest=`expr $$failedtest + 1` ; \
388                 else \
389                         echo "$$x passed" ; \
390                 fi ; \
391         done ; \
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 ; \
398                 result=$$?; \
399                 if [ "$$result" -ne "0" ] ; then \
400                         echo "!!! Error: $$x is not the same" ; \
401                         failedtest=`expr $$failedtest + 1` ; \
402                 else \
403                         echo "$$x passed" ; \
404                 fi ; \
405         done; done; \
406         rm ttemp ; \
407         if [ $$failedtest != 0 ] ; then \
408                 echo "$$failedtest tests failed" ; \
409         else \
410                 echo "CLooG works correctly :-) !" ; \
411         fi