include conditionally ppl_c.h
[cloog-ppl.git] / test / Makefile.am
blob2b4fa40bb2b5e6875b99dcf2011122e67176f0cb
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 is free software; you can redistribute it and/or modify it under the *
19 # * terms of the GNU General Public License as published by the Free Software *
20 # * Foundation; either version 2 of the License, or (at your option) any      *
21 # * later version.                                                            *
22 # *                                                                           *
23 # * This software is distributed in the hope that it will be useful, but      *
24 # * WITHOUT ANY WARRANTY; without even the implied warranty of                *
25 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General *
26 # * Public License for more details.                                          *
27 # *                                                                           *
28 # * You should have received a copy of the GNU General Public License along   *
29 # * with software; if not, write to the Free Software Foundation, Inc.,       *
30 # * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA                    *
31 # *                                                                           *
32 # * CLooG, the Chunky Loop Generator                                          *
33 # * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                        *
34 # * This file has been written with the help of the Bart Kienhuis's checking  *
35 # * makefile for PipLib.                                                      *
36 # *                                                                           *
37 # *****************************************************************************/
39 ROOT = ..
41 CLOOGTEST_C =                          \
42         1point-1                       \
43         1point-2                       \
44         4-param                        \
45         basic-bounds-1                 \
46         basic-bounds-2                 \
47         basic-bounds-3                 \
48         basic-bounds-4                 \
49         basic-bounds-5                 \
50         basic-bounds-6                 \
51         byu98-1-2-3                    \
52         cholesky                       \
53         cholesky2                      \
54         classen                        \
55         darte                          \
56         donotsimp                      \
57         dot                            \
58         dot2                           \
59         double                         \
60         durbin_e_s                     \
61         emploi                         \
62         esced                          \
63         escedk                         \
64         ex1                            \
65         forwardsub-1-1-2               \
66         forwardsub-2-1-2-3             \
67         forwardsub-3-1-2               \
68         gauss                          \
69         gesced                         \
70         gesced2                        \
71         gesced3                        \
72         guide                          \
73         iftest                         \
74         iftest2                        \
75         infinite                       \
76         infinite2                      \
77         infinite3                      \
78         infinite4                      \
79         largeur                        \
80         levenshtein-1-2-3              \
81         lineality-1-2                  \
82         lineality-2-1-2                \
83         logo                           \
84         logopar                        \
85         lu                             \
86         lu2                            \
87         lub                            \
88         lux                            \
89         min-1-1                        \
90         min-2-1                        \
91         min-3-1                        \
92         min-4-1                        \
93         mode                           \
94         multi-mm-1                     \
95         no_lindep                      \
96         orc                            \
97         rectangle                      \
98         square+triangle-1-1-2-3        \
99         swim                           \
100         test                           \
101         thomasset                      \
102         tiling                         \
103         uday_scalars                   \
104         vivien                         \
105         vivien2                        \
106         wavefront                      \
107         yosr                           \
108         yosr2                          \
109         ./non_optimal/nul_complex1     \
110         ./non_optimal/usvd_e_t         \
111         ./non_optimal/youcef           \
112         ./reservoir/cholesky2          \
113         ./reservoir/fusion1            \
114         ./reservoir/fusion2            \
115         ./reservoir/jacobi2            \
116         ./reservoir/jacobi3            \
117         ./reservoir/lim-lam1           \
118         ./reservoir/lim-lam2           \
119         ./reservoir/lim-lam3           \
120         ./reservoir/lim-lam4           \
121         ./reservoir/lim-lam5           \
122         ./reservoir/lim-lam6           \
123         ./reservoir/liu-zhuge1         \
124         ./reservoir/loechner3          \
125         ./reservoir/loechner4          \
126         ./reservoir/loechner5          \
127         ./reservoir/mg-interp2         \
128         ./reservoir/mg-interp          \
129         ./reservoir/mg-psinv           \
130         ./reservoir/mg-resid           \
131         ./reservoir/mg-rprj3           \
132         ./reservoir/pingali1           \
133         ./reservoir/pingali2           \
134         ./reservoir/pingali3           \
135         ./reservoir/pingali4           \
136         ./reservoir/pingali5           \
137         ./reservoir/pingali6           \
138         ./reservoir/QR                 \
139         ./reservoir/tang-xue1          \
140         ./reservoir/two   
142 #       ./reservoir/long               \
143 #       faber
145 CLOOGTEST_FORTRAN =                    \
146         dartef                         \
147         iftestf                        \
148         levenshtein-1-2-3f             \
149         yosrf
151 CLOOGTEST_STRIDED =                    \
152         nul_basic1                     \
153         nul_basic2                     \
154         nul_lcpc                       \
155         multi-stride                   \
156         multi-stride2                  \
157         reservoir/bastoul3             \
158         reservoir/stride               \
159         reservoir/stride2
161 generate:
162         @echo "             /*-----------------------------------------------*"
163         @echo "              *                 Generate files                *"
164         @echo "              *-----------------------------------------------*/"
165         for x in $(CLOOGTEST_C) ; do \
166                 echo "Generate $$x.c" ; \
167                 cloog $$x.cloog -o $$x.c ; \
168         done ; \
169         for x in $(CLOOGTEST_FORTRAN) ; do \
170                 echo "Generate $$x.f" ; \
171                 cloog $$x.cloog -o $$x.f ; \
172         done
174 valgrind:
175         @echo "             /*-----------------------------------------------*"
176         @echo "              *            Checking files by Valgrind         *"
177         @echo "              *-----------------------------------------------*/"
178         for x in $(CLOOGTEST_C) ; do \
179                 echo "Valgrinding $$x.c" ; \
180                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
181         done ; \
182         for x in $(CLOOGTEST_FORTRAN) ; do \
183                 echo "Valgrinding $$x.f" ; \
184                 valgrind $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog ; \
185         done
187 test:
188         @echo "             /*-----------------------------------------------*"
189         @echo "              *                 Testing CLooG                 *"
190         @echo "              *-----------------------------------------------*/"
191         failedtest=0 ; \
192         echo "--- Testing C files..." ; \
193         for x in $(CLOOGTEST_C) ; do \
194                 echo "Verify file $$x" ; \
195                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
196                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
197                 result=$$?; \
198                 if [ "$$result" -ne "0" ] ; then \
199                         echo "!!! Error: $$x is not the same" ; \
200                         failedtest=`expr $$failedtest + 1` ; \
201                 else \
202                         echo "$$x passed" ; \
203                 fi ; \
204         done ; \
205         echo "--- Testing FORTRAN files..." ; \
206         for x in $(CLOOGTEST_FORTRAN) ; do \
207                 echo "Verify file $$x" ; \
208                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog > ttemp ; \
209                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.f ; \
210                 result=$$?; \
211                 if [ "$$result" -ne "0" ] ; then \
212                         echo "!!! Error: $$x is not the same" ; \
213                         failedtest=`expr $$failedtest + 1` ; \
214                 else \
215                         echo "$$x passed" ; \
216                 fi ; \
217         done ; \
218         echo "--- Testing STRIDED files..." ; \
219         for x in $(CLOOGTEST_STRIDED) ; do \
220                 echo "Verify file $$x" ; \
221                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
222                 -strides 1 > ttemp ; \
223                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
224                 result=$$?; \
225                 if [ "$$result" -ne "0" ] ; then \
226                         echo "!!! Error: $$x is not the same" ; \
227                         failedtest=`expr $$failedtest + 1` ; \
228                 else \
229                         echo "$$x passed" ; \
230                 fi ; \
231         done ; \
232         echo "--- Testing SPECIAL OPTIONS files..." ; \
233                 echo "Verify file vasilache (-f 8 -l 9)" ; \
234                 x=vasilache ; \
235                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
236                 -f 8 -l 9 > ttemp ; \
237                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
238                 result=$$?; \
239                 if [ "$$result" -ne "0" ] ; then \
240                         echo "!!! Error: $$x is not the same" ; \
241                         failedtest=`expr $$failedtest + 1` ; \
242                 else \
243                         echo "$$x passed" ; \
244                 fi ; \
245                 echo "Verify file merge (-f -1)" ; \
246                 x=merge ; \
247                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
248                 -f -1  > ttemp ; \
249                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
250                 result=$$?; \
251                 if [ "$$result" -ne "0" ] ; then \
252                         echo "!!! Error: $$x is not the same" ; \
253                         failedtest=`expr $$failedtest + 1` ; \
254                 else \
255                         echo "$$x passed" ; \
256                 fi ; \
257                 echo "Verify file equality (-f -1 -l 2 -override)" ; \
258                 x=equality ; \
259                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
260                 -f -1 -l 2 -override  > ttemp ; \
261                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
262                 result=$$?; \
263                 if [ "$$result" -ne "0" ] ; then \
264                         echo "!!! Error: $$x is not the same" ; \
265                         failedtest=`expr $$failedtest + 1` ; \
266                 else \
267                         echo "$$x passed" ; \
268                 fi ; \
269                 echo "Verify file equality (-f -1 -l 4 -esp 1 -override)" ; \
270                 x=equality2; \
271                 $(top_builddir)/cloog$(EXEEXT) $(srcdir)/$$x.cloog \
272                 -f -1 -l 4 -esp 1 -override > ttemp ; \
273                 diff -w --ignore-matching-lines='CLooG' ttemp $(srcdir)/$$x.c ; \
274                 result=$$?; \
275                 if [ "$$result" -ne "0" ] ; then \
276                         echo "!!! Error: $$x is not the same" ; \
277                         failedtest=`expr $$failedtest + 1` ; \
278                 else \
279                         echo "$$x passed" ; \
280                 fi ; \
281         rm ttemp ; \
282         if [ $$failedtest != 0 ] ; then \
283                 echo "$$failedtest tests failed" ; \
284         else \
285                 echo "CLooG works correctly :-) !" ; \
286         fi