update isl for fix in handling of existentially quantified variables
[cloog/uuh.git] / test / Makefile.am
blobcc2650c33739e3b4e0cbc7863b7fac61485fb60f
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         constbound                     \
77         darte                          \
78         dealII                         \
79         donotsimp                      \
80         dot                            \
81         dot2                           \
82         double                         \
83         durbin_e_s                     \
84         emploi                         \
85         esced                          \
86         ex1                            \
87         forwardsub-1-1-2               \
88         forwardsub-2-1-2-3             \
89         forwardsub-3-1-2               \
90         gauss                          \
91         gesced                         \
92         gesced2                        \
93         gesced3                        \
94         guide                          \
95         iftest                         \
96         iftest2                        \
97         largeur                        \
98         levenshtein-1-2-3              \
99         lex                            \
100         lineality-1-2                  \
101         lineality-2-1-2                \
102         logo                           \
103         logopar                        \
104         lu                             \
105         lu2                            \
106         lub                            \
107         lux                            \
108         min-1-1                        \
109         min-2-1                        \
110         min-3-1                        \
111         min-4-1                        \
112         mode                           \
113         multi-mm-1                     \
114         no_lindep                      \
115         orc                            \
116         rectangle                      \
117         singleton                      \
118         square+triangle-1-1-2-3        \
119         swim                           \
120         test                           \
121         thomasset                      \
122         tiling                         \
123         uday_scalars                   \
124         vivien                         \
125         vivien2                        \
126         walters                        \
127         walters2                       \
128         wavefront                      \
129         yosr                           \
130         yosr2                          \
131         ./non_optimal/nul_complex1     \
132         ./non_optimal/usvd_e_t         \
133         ./non_optimal/youcef           \
134         ./reservoir/cholesky2          \
135         ./reservoir/fusion1            \
136         ./reservoir/fusion2            \
137         ./reservoir/jacobi2            \
138         ./reservoir/jacobi3            \
139         ./reservoir/lim-lam1           \
140         ./reservoir/lim-lam2           \
141         ./reservoir/lim-lam3           \
142         ./reservoir/lim-lam4           \
143         ./reservoir/lim-lam5           \
144         ./reservoir/lim-lam6           \
145         ./reservoir/liu-zhuge1         \
146         ./reservoir/loechner3          \
147         ./reservoir/loechner4          \
148         ./reservoir/loechner5          \
149         ./reservoir/mg-interp2         \
150         ./reservoir/mg-interp          \
151         ./reservoir/mg-psinv           \
152         ./reservoir/mg-resid           \
153         ./reservoir/mg-rprj3           \
154         ./reservoir/pingali1           \
155         ./reservoir/pingali2           \
156         ./reservoir/pingali3           \
157         ./reservoir/pingali4           \
158         ./reservoir/pingali5           \
159         ./reservoir/pingali6           \
160         ./reservoir/QR                 \
161         ./reservoir/tang-xue1          \
162         ./reservoir/two   
164 CLOOG_ISL_TEST_C =                      \
165         isl/mod                         \
166         isl/mod2                        \
167         isl/mod3
169 CLOOGTEST_C =                          \
170         infinite                       \
171         infinite2                      \
172         infinite3                      \
173         infinite4                      \
174         $(FINITE_CLOOGTEST_C)          \
175         $(CLOOG_ISL_TEST_C)
177 #       ./reservoir/long               \
178 #       faber
180 CLOOGTEST_FORTRAN =                    \
181         dartef                         \
182         iftestf                        \
183         levenshtein-1-2-3f             \
184         yosrf
186 CLOOGTEST_STRIDED =                    \
187         basic-bounds-2                 \
188         mod4                           \
189         nul_basic1                     \
190         nul_basic2                     \
191         nul_lcpc                       \
192         multi-stride                   \
193         multi-stride2                  \
194         stride3                        \
195         reservoir/bastoul3             \
196         reservoir/stride               \
197         reservoir/stride2
199 SPECIAL_TESTS = \
200         vasilache \
201         merge \
202         equality \
203         equality2 \
204         param-split \
205         stride \
206         stride2 \
207         sor1d
208 SPECIAL_OPTIONS = \
209         'vasilache -f 8 -l 9' \
210         'merge -f -1' \
211         'equality -f -1 -l 2 -override' \
212         'equality2 -f -1 -l 4 -esp 1 -override' \
213         'otl -block 1 -esp 0 -otl 0' \
214         'param-split -f -1' \
215         'stride -f -1 -strides 1' \
216         'stride2 -f -1 -strides 1' \
217         'sor1d -f -1'
219 EXTRA_DIST = \
220         $(CLOOGTEST_C:%=%.cloog) \
221         $(CLOOGTEST_C:%=%.c) \
222         $(FINITE_CLOOGTEST_C:%=%.good.c) \
223         $(CLOOGTEST_FORTRAN:%=%.cloog) \
224         $(CLOOGTEST_FORTRAN:%=%.f) \
225         $(CLOOGTEST_STRIDED:%=%.cloog) \
226         $(CLOOGTEST_STRIDED:%=%.c) \
227         $(SPECIAL_TESTS:%=%.cloog) \
228         $(SPECIAL_TESTS:%=%.c) \
229         $(SPECIAL_TESTS:%=%.good.c)
231 generate:
232         @echo "             /*-----------------------------------------------*"
233         @echo "              *                 Generate files                *"
234         @echo "              *-----------------------------------------------*/"
235         @for x in $(CLOOGTEST_C) ; do \
236                 echo "Generate $$x.c" ; \
237                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.c ; \
238         done ; \
239         for x in $(CLOOGTEST_FORTRAN) ; do \
240                 echo "Generate $$x.f" ; \
241                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/$$x.f ; \
242         done ; \
243         for x in $(CLOOGTEST_STRIDED) ; do \
244                 echo "Generate $$x.c" ; \
245                 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
246                         -strides 1 -o $(srcdir)/$$x.c ; \
247         done ; \
248         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
249                 echo "Generate file $$x ($$options)" ; \
250                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
251                     $$options > $(srcdir)/$$x.c ; \
252         done; done
254 generate_good:
255         @for x in $(FINITE_CLOOGTEST_C) ; do \
256                 echo "Generate $$x.good.c" ; \
257                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
258         done; \
259         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
260                 echo "Generate $$x.good.c ($$options)" ; \
261                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
262         done; done
264 valgrind:
265         @echo "             /*-----------------------------------------------*"
266         @echo "              *            Checking files by Valgrind         *"
267         @echo "              *-----------------------------------------------*/"
268         for x in $(CLOOGTEST_C) ; do \
269                 echo "Valgrinding $$x.c" ; \
270                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
271         done ; \
272         for x in $(CLOOGTEST_FORTRAN) ; do \
273                 echo "Valgrinding $$x.f" ; \
274                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
275         done
277 test_run: generate_test$(EXEEXT)
278         @echo "             /*-----------------------------------------------*"
279         @echo "              *                 Testing CLooG                 *"
280         @echo "              *-----------------------------------------------*/"
281         @failedtest=0 ; \
282         echo "--- Testing C files... (correct output)" ; \
283         for x in $(FINITE_CLOOGTEST_C) ; do \
284                 echo -n "Verify file $$x... " ; \
285                 echo -n "generating... " ; \
286                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
287                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
288                 echo -n "compiling... " ; \
289                 $(COMPILE) -c test_test.c; \
290                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
291                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
292                 echo -n "comparing... " ; \
293                 ./test_run$(EXEEXT); \
294                 result=$$?; \
295                 if test "$$result" -ne "0" ; then \
296                         failedtest=`expr $$failedtest + 1` ; \
297                 fi; \
298                 $(RM) $@; \
299                 echo; \
300         done; \
301         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
302                 echo -n "Verify file $$x ($$options)... " ; \
303                 echo -n "generating... " ; \
304                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(srcdir)/$$x.cloog > test_test.c ; \
305                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
306                 echo -n "compiling... " ; \
307                 $(COMPILE) -c test_test.c; \
308                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
309                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
310                 echo -n "comparing... " ; \
311                 ./test_run$(EXEEXT); \
312                 result=$$?; \
313                 if test "$$result" -ne "0" ; then \
314                         failedtest=`expr $$failedtest + 1` ; \
315                 fi; \
316                 $(RM) $@; \
317                 echo; \
318         done; done; \
319         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
320                 echo -n "Verify file $$x ($$options -sh 1)... " ; \
321                 echo -n "generating... " ; \
322                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(srcdir)/$$x.cloog > test_test.c ; \
323                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
324                 echo -n "compiling... " ; \
325                 $(COMPILE) -c test_test.c; \
326                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
327                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
328                 echo -n "comparing... " ; \
329                 ./test_run$(EXEEXT); \
330                 result=$$?; \
331                 if test "$$result" -ne "0" ; then \
332                         failedtest=`expr $$failedtest + 1` ; \
333                 fi; \
334                 $(RM) $@; \
335                 echo; \
336         done; done; \
337         if [ $$failedtest != 0 ] ; then \
338                 echo "$$failedtest tests failed" ; \
339         else \
340                 echo "CLooG works correctly :-) !" ; \
341         fi
342 test:
343         @echo "             /*-----------------------------------------------*"
344         @echo "              *                 Testing CLooG                 *"
345         @echo "              *-----------------------------------------------*/"
346         @failedtest=0 ; \
347         echo "--- Testing C files... (expected output)" ; \
348         for x in $(CLOOGTEST_C) ; do \
349                 echo "Verify file $$x" ; \
350                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
351                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
352                 result=$$?; \
353                 if [ "$$result" -ne "0" ] ; then \
354                         echo "!!! Error: $$x is not the same" ; \
355                         failedtest=`expr $$failedtest + 1` ; \
356                 else \
357                         echo "$$x passed" ; \
358                 fi ; \
359         done ; \
360         echo "--- Testing FORTRAN files..." ; \
361         for x in $(CLOOGTEST_FORTRAN) ; do \
362                 echo "Verify file $$x" ; \
363                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
364                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
365                 result=$$?; \
366                 if [ "$$result" -ne "0" ] ; then \
367                         echo "!!! Error: $$x is not the same" ; \
368                         failedtest=`expr $$failedtest + 1` ; \
369                 else \
370                         echo "$$x passed" ; \
371                 fi ; \
372         done ; \
373         echo "--- Testing STRIDED files..." ; \
374         for x in $(CLOOGTEST_STRIDED) ; do \
375                 echo "Verify file $$x" ; \
376                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
377                 -strides 1 > ttemp ; \
378                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
379                 result=$$?; \
380                 if [ "$$result" -ne "0" ] ; then \
381                         echo "!!! Error: $$x is not the same" ; \
382                         failedtest=`expr $$failedtest + 1` ; \
383                 else \
384                         echo "$$x passed" ; \
385                 fi ; \
386         done ; \
387         echo "--- Testing SPECIAL OPTIONS files..." ; \
388         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
389                 echo "Verify file $$x ($$options)" ; \
390                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
391                         $$options > ttemp ; \
392                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
393                 result=$$?; \
394                 if [ "$$result" -ne "0" ] ; then \
395                         echo "!!! Error: $$x is not the same" ; \
396                         failedtest=`expr $$failedtest + 1` ; \
397                 else \
398                         echo "$$x passed" ; \
399                 fi ; \
400         done; done; \
401         rm ttemp ; \
402         if [ $$failedtest != 0 ] ; then \
403                 echo "$$failedtest tests failed" ; \
404         else \
405                 echo "CLooG works correctly :-) !" ; \
406         fi