update isl for fix in convex hull computation
[cloog/uuh.git] / test / Makefile.am
blob10180baac149be31d47fa05dd4177b147f2774b6
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 noinst_PROGRAMS = generate_test
41 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
42 LDADD = ../libcloog-@BACKEND@.la
43 generate_test_SOURCES = generate_test.c
45 FORCE:
46 ../libcloog-@BACKEND@.la: FORCE
47         cd ..; $(MAKE) $(AM_MAKEFLAGS) libcloog-@BACKEND@.la
49 ROOT = ..
51 FINITE_CLOOGTEST_C =                   \
52         0D-1                           \
53         0D-2                           \
54         0D-3                           \
55         1point-1                       \
56         1point-2                       \
57         4-param                        \
58         basic-bounds-1                 \
59         basic-bounds-2                 \
60         basic-bounds-3                 \
61         basic-bounds-4                 \
62         basic-bounds-5                 \
63         basic-bounds-6                 \
64         block                          \
65         byu98-1-2-3                    \
66         cholesky                       \
67         cholesky2                      \
68         classen                        \
69         constbound                     \
70         darte                          \
71         donotsimp                      \
72         dot                            \
73         dot2                           \
74         double                         \
75         durbin_e_s                     \
76         emploi                         \
77         esced                          \
78         ex1                            \
79         forwardsub-1-1-2               \
80         forwardsub-2-1-2-3             \
81         forwardsub-3-1-2               \
82         gauss                          \
83         gesced                         \
84         gesced2                        \
85         gesced3                        \
86         guide                          \
87         iftest                         \
88         iftest2                        \
89         largeur                        \
90         levenshtein-1-2-3              \
91         lineality-1-2                  \
92         lineality-2-1-2                \
93         logo                           \
94         logopar                        \
95         lu                             \
96         lu2                            \
97         lub                            \
98         lux                            \
99         min-1-1                        \
100         min-2-1                        \
101         min-3-1                        \
102         min-4-1                        \
103         mode                           \
104         multi-mm-1                     \
105         no_lindep                      \
106         orc                            \
107         rectangle                      \
108         square+triangle-1-1-2-3        \
109         swim                           \
110         test                           \
111         thomasset                      \
112         tiling                         \
113         uday_scalars                   \
114         vivien                         \
115         vivien2                        \
116         walters                        \
117         wavefront                      \
118         yosr                           \
119         yosr2                          \
120         ./non_optimal/nul_complex1     \
121         ./non_optimal/usvd_e_t         \
122         ./non_optimal/youcef           \
123         ./reservoir/cholesky2          \
124         ./reservoir/fusion1            \
125         ./reservoir/fusion2            \
126         ./reservoir/jacobi2            \
127         ./reservoir/jacobi3            \
128         ./reservoir/lim-lam1           \
129         ./reservoir/lim-lam2           \
130         ./reservoir/lim-lam3           \
131         ./reservoir/lim-lam4           \
132         ./reservoir/lim-lam5           \
133         ./reservoir/lim-lam6           \
134         ./reservoir/liu-zhuge1         \
135         ./reservoir/loechner3          \
136         ./reservoir/loechner4          \
137         ./reservoir/loechner5          \
138         ./reservoir/mg-interp2         \
139         ./reservoir/mg-interp          \
140         ./reservoir/mg-psinv           \
141         ./reservoir/mg-resid           \
142         ./reservoir/mg-rprj3           \
143         ./reservoir/pingali1           \
144         ./reservoir/pingali2           \
145         ./reservoir/pingali3           \
146         ./reservoir/pingali4           \
147         ./reservoir/pingali5           \
148         ./reservoir/pingali6           \
149         ./reservoir/QR                 \
150         ./reservoir/tang-xue1          \
151         ./reservoir/two   
153 CLOOGTEST_C =                          \
154         infinite                       \
155         infinite2                      \
156         infinite3                      \
157         infinite4                      \
158         $(FINITE_CLOOGTEST_C)
160 #       ./reservoir/long               \
161 #       faber
163 CLOOGTEST_FORTRAN =                    \
164         dartef                         \
165         iftestf                        \
166         levenshtein-1-2-3f             \
167         yosrf
169 CLOOGTEST_STRIDED =                    \
170         basic-bounds-2                 \
171         mod4                           \
172         nul_basic1                     \
173         nul_basic2                     \
174         nul_lcpc                       \
175         multi-stride                   \
176         multi-stride2                  \
177         reservoir/bastoul3             \
178         reservoir/stride               \
179         reservoir/stride2
181 SPECIAL_TESTS = \
182         vasilache \
183         merge \
184         equality \
185         equality2 \
186         stride \
187         stride2
188 SPECIAL_OPTIONS = \
189         'vasilache -f 8 -l 9' \
190         'merge -f -1' \
191         'equality -f -1 -l 2 -override' \
192         'equality2 -f -1 -l 4 -esp 1 -override' \
193         'stride -f -1 -strides 1' \
194         'stride2 -f -1 -strides 1' \
195         'sor1d -f -1'
197 EXTRA_DIST = \
198         $(CLOOGTEST_C:%=%.cloog) \
199         $(CLOOGTEST_C:%=isl/%.c) \
200         $(CLOOGTEST_C:%=polylib/%.c) \
201         $(FINITE_CLOOGTEST_C:%=%.good.c) \
202         $(CLOOGTEST_FORTRAN:%=%.cloog) \
203         $(CLOOGTEST_FORTRAN:%=isl/%.f) \
204         $(CLOOGTEST_FORTRAN:%=polylib/%.f) \
205         $(CLOOGTEST_STRIDED:%=%.cloog) \
206         $(CLOOGTEST_STRIDED:%=isl/%.c) \
207         $(CLOOGTEST_STRIDED:%=polylib/%.c) \
208         $(SPECIAL_TESTS:%=%.cloog) \
209         $(SPECIAL_TESTS:%=isl/%.c) \
210         $(SPECIAL_TESTS:%=polylib/%.c) \
211         $(SPECIAL_TESTS:%=%.good.c)
213 generate:
214         @echo "             /*-----------------------------------------------*"
215         @echo "              *                 Generate files                *"
216         @echo "              *-----------------------------------------------*/"
217         @for x in $(CLOOGTEST_C) ; do \
218                 echo "Generate $$x.c" ; \
219                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/@BACKEND@/$$x.c ; \
220         done ; \
221         for x in $(CLOOGTEST_FORTRAN) ; do \
222                 echo "Generate $$x.f" ; \
223                 $(top_builddir)/cloog $(srcdir)/$$x.cloog -o $(srcdir)/@BACKEND@/$$x.f ; \
224         done ; \
225         for x in $(CLOOGTEST_STRIDED) ; do \
226                 echo "Generate $$x.c" ; \
227                 $(top_builddir)/cloog $(srcdir)/$$x.cloog \
228                         -strides 1 -o $(srcdir)/@BACKEND@/$$x.c ; \
229         done ; \
230         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
231                 echo "Generate file $$x ($$options)" ; \
232                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
233                     $$options > $(srcdir)/@BACKEND@/$$x.c ; \
234         done; done
236 generate_good:
237         @for x in $(FINITE_CLOOGTEST_C) ; do \
238                 echo "Generate $$x.good.c" ; \
239                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
240         done; \
241         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
242                 echo "Generate $$x.good.c ($$options)" ; \
243                 $(top_builddir)/cloog$(EXEEXT) -callable 1 $$options $(srcdir)/$$x.cloog -o $(srcdir)/$$x.good.c ; \
244         done; done
246 valgrind:
247         @echo "             /*-----------------------------------------------*"
248         @echo "              *            Checking files by Valgrind         *"
249         @echo "              *-----------------------------------------------*/"
250         for x in $(CLOOGTEST_C) ; do \
251                 echo "Valgrinding $$x.c" ; \
252                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
253         done ; \
254         for x in $(CLOOGTEST_FORTRAN) ; do \
255                 echo "Valgrinding $$x.f" ; \
256                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
257         done
259 test_run: generate_test$(EXEEXT)
260         @echo "             /*-----------------------------------------------*"
261         @echo "              *                 Testing CLooG                 *"
262         @echo "              *-----------------------------------------------*/"
263         @failedtest=0 ; \
264         echo "--- Testing C files... (correct output)" ; \
265         for x in $(FINITE_CLOOGTEST_C) ; do \
266                 echo -n "Verify file $$x... " ; \
267                 echo -n "generating... " ; \
268                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $(srcdir)/$$x.cloog > test_test.c ; \
269                 ./generate_test$(EXEEXT) < $(srcdir)/$$x.cloog > test_main.c; \
270                 echo -n "compiling... " ; \
271                 $(COMPILE) -c test_test.c; \
272                 $(COMPILE) -Dtest=good -c $(srcdir)/$$x.good.c -o test_good.o; \
273                 $(LINK) test_main.c test_test.o test_good.o > /dev/null; \
274                 echo -n "comparing... " ; \
275                 ./test_run$(EXEEXT); \
276                 result=$$?; \
277                 if test "$$result" -ne "0" ; then \
278                         failedtest=`expr $$failedtest + 1` ; \
279                 fi; \
280                 $(RM) $@; \
281                 echo; \
282         done; \
283         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
284                 echo -n "Verify file $$x ($$options)... " ; \
285                 echo -n "generating... " ; \
286                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options $(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; done; \
301         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
302                 echo -n "Verify file $$x ($$options -sh 1)... " ; \
303                 echo -n "generating... " ; \
304                 $(top_builddir)/cloog$(EXEEXT) -q -callable 1 $$options -sh 1 $(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         if [ $$failedtest != 0 ] ; then \
320                 echo "$$failedtest tests failed" ; \
321         else \
322                 echo "CLooG works correctly :-) !" ; \
323         fi
324 test:
325         @echo "             /*-----------------------------------------------*"
326         @echo "              *                 Testing CLooG                 *"
327         @echo "              *-----------------------------------------------*/"
328         @failedtest=0 ; \
329         echo "--- Testing C files... (expected output)" ; \
330         for x in $(CLOOGTEST_C) ; do \
331                 echo "Verify file $$x" ; \
332                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
333                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/@BACKEND@/$$x.c ; \
334                 result=$$?; \
335                 if [ "$$result" -ne "0" ] ; then \
336                         echo "!!! Error: $$x is not the same" ; \
337                         failedtest=`expr $$failedtest + 1` ; \
338                 else \
339                         echo "$$x passed" ; \
340                 fi ; \
341         done ; \
342         echo "--- Testing FORTRAN files..." ; \
343         for x in $(CLOOGTEST_FORTRAN) ; do \
344                 echo "Verify file $$x" ; \
345                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
346                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/@BACKEND@/$$x.f ; \
347                 result=$$?; \
348                 if [ "$$result" -ne "0" ] ; then \
349                         echo "!!! Error: $$x is not the same" ; \
350                         failedtest=`expr $$failedtest + 1` ; \
351                 else \
352                         echo "$$x passed" ; \
353                 fi ; \
354         done ; \
355         echo "--- Testing STRIDED files..." ; \
356         for x in $(CLOOGTEST_STRIDED) ; do \
357                 echo "Verify file $$x" ; \
358                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
359                 -strides 1 > ttemp ; \
360                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/@BACKEND@/$$x.c ; \
361                 result=$$?; \
362                 if [ "$$result" -ne "0" ] ; then \
363                         echo "!!! Error: $$x is not the same" ; \
364                         failedtest=`expr $$failedtest + 1` ; \
365                 else \
366                         echo "$$x passed" ; \
367                 fi ; \
368         done ; \
369         echo "--- Testing SPECIAL OPTIONS files..." ; \
370         for line in $(SPECIAL_OPTIONS); do echo $$line | while read x options; do \
371                 echo "Verify file $$x ($$options)" ; \
372                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
373                         $$options > ttemp ; \
374                 diff -u -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/@BACKEND@/$$x.c ; \
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; done; \
383         rm ttemp ; \
384         if [ $$failedtest != 0 ] ; then \
385                 echo "$$failedtest tests failed" ; \
386         else \
387                 echo "CLooG works correctly :-) !" ; \
388         fi