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