OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [ada/] [acats/] [run_all.sh] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
#!/bin/sh
2
# Run ACATS with the GNU Ada compiler
3
 
4
# The following functions are to be customized if you run in cross
5
# environment or want to change compilation flags.  Note that for
6
# tests requiring checks not turned on by default, this script
7
# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
8
 
9
# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
10
# gnatflags="-gnatN"
11
 
12
gccflags="-O2"
13
gnatflags="-gnatws"
14
 
15
target_run () {
16
$*
17
}
18
 
19
# End of customization section.
20
 
21
display_noeol () {
22
  printf "$@"
23
  printf "$@" >> $dir/acats.sum
24
  printf "$@" >> $dir/acats.log
25
}
26
 
27
display () {
28
  echo "$@"
29
  echo "$@" >> $dir/acats.sum
30
  echo "$@" >> $dir/acats.log
31
}
32
 
33
log () {
34
  echo "$@" >> $dir/acats.sum
35
  echo "$@" >> $dir/acats.log
36
}
37
 
38
dir=`${PWDCMD-pwd}`
39
 
40
if [ "$testdir" = "" ]; then
41
   echo You must use make check or make check-ada
42
   exit 1
43
fi
44
 
45
if [ "$dir" = "$testdir" ]; then
46
  echo "error: srcdir must be different than objdir, exiting."
47
  exit 1
48
fi
49
 
50
target_gnatchop () {
51
  gnatchop --GCC="$GCC_DRIVER" $*
52
}
53
 
54
target_gnatmake () {
55
  echo gnatmake --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\"
56
  gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
57
}
58
 
59
target_gcc () {
60
  $GCC $gccflags $*
61
}
62
 
63
clean_dir () {
64
  rm -f "$binmain" *.o *.ali > /dev/null 2>&1
65
}
66
 
67
EXTERNAL_OBJECTS=""
68
# Global variable to communicate external objects to link with.
69
 
70
rm -f $dir/acats.sum $dir/acats.log
71
 
72
display "               === acats configuration ==="
73
 
74
target=`$GCC -dumpmachine`
75
 
76
display target gcc is $GCC
77
display `$GCC -v 2>&1`
78
display host=`gcc -dumpmachine`
79
display target=$target
80
display `type gnatmake`
81
gnatls -v >> $dir/acats.log
82
display ""
83
 
84
display "               === acats support ==="
85
display_noeol "Generating support files..."
86
 
87
rm -rf $dir/support
88
mkdir -p $dir/support
89
cd $dir/support
90
 
91
cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
92
 
93
# Find out the size in bit of an address on the target
94
target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
95
target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
96
target_bit=`cat $dir/support/impbit.out`
97
echo target_bit="$target_bit" >> $dir/acats.log
98
 
99
# Find out a suitable asm statement
100
# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
101
case "$target" in
102
  ia64*-*-* | s390*-*-*)
103
    target_insn="nop 0"
104
    ;;
105
  mmix-*-*)
106
    target_insn="swym 0"
107
    ;;
108
  *)
109
    target_insn="nop"
110
    ;;
111
esac
112
echo target_insn="$target_insn" >> $dir/acats.log
113
 
114
sed -e "s,ACATS4GNATDIR,$dir,g" \
115
  < $testdir/support/impdef.a > $dir/support/impdef.a
116
sed -e "s,ACATS4GNATDIR,$dir,g" \
117
  -e "s,ACATS4GNATBIT,$target_bit,g" \
118
  -e "s,ACATS4GNATINSN,$target_insn,g" \
119
  < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
120
sed -e "s,ACATS4GNATDIR,$dir,g" \
121
  < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
122
 
123
cp $testdir/tests/cd/*.c $dir/support
124
cp $testdir/tests/cxb/*.c $dir/support
125
 
126
rm -rf $dir/run
127
mv $dir/tests $dir/tests.$$ 2> /dev/null
128
rm -rf $dir/tests.$$ &
129
mkdir -p $dir/run
130
 
131
cp -pr $testdir/tests $dir/
132
 
133
for i in $dir/support/*.ada $dir/support/*.a; do
134
   host_gnatchop $i >> $dir/acats.log 2>&1
135
done
136
 
137
# These tools are used to preprocess some ACATS sources
138
# they need to be compiled native on the host.
139
 
140
host_gnatmake -q -gnatws macrosub.adb
141
if [ $? -ne 0 ]; then
142
   display "**** Failed to compile macrosub"
143
   exit 1
144
fi
145
./macrosub > macrosub.out 2>&1
146
 
147
gcc -c cd300051.c
148
host_gnatmake -q -gnatws widechr.adb
149
if [ $? -ne 0 ]; then
150
   display "**** Failed to compile widechr"
151
   exit 1
152
fi
153
./widechr > widechr.out 2>&1
154
 
155
rm -f $dir/support/macrosub
156
rm -f $dir/support/widechr
157
rm -f $dir/support/*.ali
158
rm -f $dir/support/*.o
159
 
160
display " done."
161
 
162
# From here, all compilations will be made by the target compiler
163
 
164
display_noeol "Compiling support files..."
165
 
166
target_gcc -c *.c
167
if [ $? -ne 0 ]; then
168
   display "**** Failed to compile C code"
169
   exit 1
170
fi
171
 
172
target_gnatchop *.adt >> $dir/acats.log 2>&1
173
 
174
target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
175
target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
176
 
177
display " done."
178
display ""
179
display "               === acats tests ==="
180
 
181
if [ $# -eq 0 ]; then
182
   chapters=`cd $dir/tests; echo [a-z]*`
183
else
184
   chapters=$*
185
fi
186
 
187
glob_countn=0
188
glob_countok=0
189
glob_countu=0
190
 
191
for chapter in $chapters; do
192
   display Running chapter $chapter ...
193
 
194
   if [ ! -d $dir/tests/$chapter ]; then
195
      display "*** CHAPTER $chapter does not exist, skipping."
196
      display ""
197
      continue
198
   fi
199
 
200
   cd $dir/tests/$chapter
201
   ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
202
   cut -c1-7 | sort | uniq | comm -23 - $testdir/norun.lst \
203
     > $dir/tests/$chapter/${chapter}.lst
204
   countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
205
   glob_countn=`expr $glob_countn + $countn`
206
   counti=0
207
   for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
208
      counti=`expr $counti + 1`
209
      extraflags=""
210
      grep $i $testdir/overflow.lst > /dev/null 2>&1
211
      if [ $? -eq 0 ]; then
212
         extraflags="$extraflags -gnato"
213
      fi
214
      grep $i $testdir/elabd.lst > /dev/null 2>&1
215
      if [ $? -eq 0 ]; then
216
         extraflags="$extraflags -gnatE"
217
      fi
218
      grep $i $testdir/stackcheck.lst > /dev/null 2>&1
219
      if [ $? -eq 0 ]; then
220
         extraflags="$extraflags -fstack-check"
221
      fi
222
      test=$dir/tests/$chapter/$i
223
      mkdir $test && cd $test >> $dir/acats.log 2>&1
224
 
225
      if [ $? -ne 0 ]; then
226
         display "FAIL: $i"
227
         failed="${failed}${i} "
228
         clean_dir
229
         continue
230
      fi
231
 
232
      target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
233
      ls ${i}?.adb > ${i}.lst 2> /dev/null
234
      ls ${i}*m.adb >> ${i}.lst 2> /dev/null
235
      ls ${i}.adb >> ${i}.lst 2> /dev/null
236
      main=`tail -1 ${i}.lst`
237
      binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
238
      echo "BUILD $main" >> $dir/acats.log
239
      EXTERNAL_OBJECTS=""
240
      case $i in
241
        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
242
        ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
243
        ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
244
        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
245
      esac
246
      if [ "$main" = "" ]; then
247
         display "FAIL: $i"
248
         failed="${failed}${i} "
249
         clean_dir
250
         continue
251
      fi
252
 
253
      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
254
      if [ $? -ne 0 ]; then
255
         display "FAIL: $i"
256
         failed="${failed}${i} "
257
         clean_dir
258
         continue
259
      fi
260
 
261
      echo "RUN $binmain" >> $dir/acats.log
262
      cd $dir/run
263
      if [ ! -x $dir/tests/$chapter/$i/$binmain ]; then
264
         sync
265
      fi
266
      target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
267
      cd $dir/tests/$chapter/$i
268
      cat ${i}.log >> $dir/acats.log
269
      egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
270
      if [ $? -ne 0 ]; then
271
         grep 'Tasking not implemented' ${i}.log > /dev/null 2>&1
272
 
273
         if [ $? -ne 0 ]; then
274
            display "FAIL:      $i"
275
            failed="${failed}${i} "
276
         else
277
            log "UNSUPPORTED:   $i"
278
            glob_countn=`expr $glob_countn - 1`
279
            glob_countu=`expr $glob_countu + 1`
280
         fi
281
      else
282
         log "PASS:     $i"
283
         glob_countok=`expr $glob_countok + 1`
284
      fi
285
      clean_dir
286
   done
287
done
288
 
289
display "               === acats Summary ==="
290
display "# of expected passes           $glob_countok"
291
display "# of unexpected failures       `expr $glob_countn - $glob_countok`"
292
 
293
if [ $glob_countu -ne 0 ]; then
294
   display "# of unsupported tests              $glob_countu"
295
fi
296
 
297
if [ $glob_countok -ne $glob_countn ]; then
298
   display "*** FAILURES: $failed"
299
fi
300
 
301
exit 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.