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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [run_all.sh] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
#!/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
  eval $EXPECT -f $testdir/run_test.exp $*
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
find_main () {
68
  ls ${i}?.adb > ${i}.lst 2> /dev/null
69
  ls ${i}*m.adb >> ${i}.lst 2> /dev/null
70
  ls ${i}.adb >> ${i}.lst 2> /dev/null
71
  main=`tail -1 ${i}.lst`
72
}
73
 
74
EXTERNAL_OBJECTS=""
75
# Global variable to communicate external objects to link with.
76
 
77
rm -f $dir/acats.sum $dir/acats.log
78
 
79
display "Test Run By $USER on `date`"
80
 
81
display "               === acats configuration ==="
82
 
83
target=`$GCC -dumpmachine`
84
 
85
display target gcc is $GCC
86
display `$GCC -v 2>&1`
87
display host=`gcc -dumpmachine`
88
display target=$target
89
display `type gnatmake`
90
gnatls -v >> $dir/acats.log
91
display ""
92
 
93
display "               === acats support ==="
94
display_noeol "Generating support files..."
95
 
96
rm -rf $dir/support
97
mkdir -p $dir/support
98
cd $dir/support
99
 
100
cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
101
 
102
# Find out the size in bit of an address on the target
103
target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
104
target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
105
target_bit=`cat $dir/support/impbit.out`
106
echo target_bit="$target_bit" >> $dir/acats.log
107
 
108
# Find out a suitable asm statement
109
# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
110
case "$target" in
111
  ia64*-*-* | s390*-*-*)
112
    target_insn="nop 0"
113
    ;;
114
  mmix-*-*)
115
    target_insn="swym 0"
116
    ;;
117
  *)
118
    target_insn="nop"
119
    ;;
120
esac
121
echo target_insn="$target_insn" >> $dir/acats.log
122
 
123
sed -e "s,ACATS4GNATDIR,$dir,g" \
124
  < $testdir/support/impdef.a > $dir/support/impdef.a
125
sed -e "s,ACATS4GNATDIR,$dir,g" \
126
  -e "s,ACATS4GNATBIT,$target_bit,g" \
127
  -e "s,ACATS4GNATINSN,$target_insn,g" \
128
  < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
129
sed -e "s,ACATS4GNATDIR,$dir,g" \
130
  < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
131
 
132
cp $testdir/tests/cd/*.c $dir/support
133
cp $testdir/tests/cxb/*.c $dir/support
134
grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
135
 
136
rm -rf $dir/run
137
mv $dir/tests $dir/tests.$$ 2> /dev/null
138
rm -rf $dir/tests.$$ &
139
mkdir -p $dir/run
140
 
141
cp -pr $testdir/tests $dir/
142
 
143
for i in $dir/support/*.ada $dir/support/*.a; do
144
   host_gnatchop $i >> $dir/acats.log 2>&1
145
done
146
 
147
# These tools are used to preprocess some ACATS sources
148
# they need to be compiled native on the host.
149
 
150
host_gnatmake -q -gnatws macrosub.adb
151
if [ $? -ne 0 ]; then
152
   display "**** Failed to compile macrosub"
153
   exit 1
154
fi
155
./macrosub > macrosub.out 2>&1
156
 
157
gcc -c cd300051.c
158
host_gnatmake -q -gnatws widechr.adb
159
if [ $? -ne 0 ]; then
160
   display "**** Failed to compile widechr"
161
   exit 1
162
fi
163
./widechr > widechr.out 2>&1
164
 
165
rm -f $dir/support/macrosub
166
rm -f $dir/support/widechr
167
rm -f $dir/support/*.ali
168
rm -f $dir/support/*.o
169
 
170
display " done."
171
 
172
# From here, all compilations will be made by the target compiler
173
 
174
display_noeol "Compiling support files..."
175
 
176
target_gcc -c *.c
177
if [ $? -ne 0 ]; then
178
   display "**** Failed to compile C code"
179
   exit 1
180
fi
181
 
182
target_gnatchop *.adt >> $dir/acats.log 2>&1
183
 
184
target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
185
target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
186
 
187
display " done."
188
display ""
189
display "               === acats tests ==="
190
 
191
if [ $# -eq 0 ]; then
192
   chapters=`cd $dir/tests; echo [a-z]*`
193
else
194
   chapters=$*
195
fi
196
 
197
glob_countn=0
198
glob_countok=0
199
glob_countu=0
200
 
201
for chapter in $chapters; do
202
   display Running chapter $chapter ...
203
 
204
   if [ ! -d $dir/tests/$chapter ]; then
205
      display "*** CHAPTER $chapter does not exist, skipping."
206
      display ""
207
      continue
208
   fi
209
 
210
   cd $dir/tests/$chapter
211
   ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
212
   cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
213
     > $dir/tests/$chapter/${chapter}.lst
214
   countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
215
   glob_countn=`expr $glob_countn + $countn`
216
   counti=0
217
   for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
218
      counti=`expr $counti + 1`
219
      extraflags=""
220
      grep $i $testdir/overflow.lst > /dev/null 2>&1
221
      if [ $? -eq 0 ]; then
222
         extraflags="$extraflags -gnato"
223
      fi
224
      grep $i $testdir/elabd.lst > /dev/null 2>&1
225
      if [ $? -eq 0 ]; then
226
         extraflags="$extraflags -gnatE"
227
      fi
228
      grep $i $testdir/stackcheck.lst > /dev/null 2>&1
229
      if [ $? -eq 0 ]; then
230
         extraflags="$extraflags -fstack-check"
231
      fi
232
      grep $i $testdir/ada95.lst > /dev/null 2>&1
233
      if [ $? -eq 0 ]; then
234
         extraflags="$extraflags -gnat95"
235
      fi
236
      test=$dir/tests/$chapter/$i
237
      mkdir $test && cd $test >> $dir/acats.log 2>&1
238
 
239
      if [ $? -ne 0 ]; then
240
         display "FAIL: $i"
241
         failed="${failed}${i} "
242
         clean_dir
243
         continue
244
      fi
245
 
246
      target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
247
      main=""
248
      find_main
249
      if [ -z "$main" ]; then
250
         sync
251
         find_main
252
      fi
253
      binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
254
      echo "BUILD $main" >> $dir/acats.log
255
      EXTERNAL_OBJECTS=""
256
      case $i in
257
        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
258
        ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
259
        ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
260
        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
261
      esac
262
      if [ "$main" = "" ]; then
263
         display "FAIL: $i"
264
         failed="${failed}${i} "
265
         clean_dir
266
         continue
267
      fi
268
 
269
      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
270
      if [ $? -ne 0 ]; then
271
         display "FAIL: $i"
272
         failed="${failed}${i} "
273
         clean_dir
274
         continue
275
      fi
276
 
277
      echo "RUN $binmain" >> $dir/acats.log
278
      cd $dir/run
279
      if [ ! -x $dir/tests/$chapter/$i/$binmain ]; then
280
         sync
281
      fi
282
      target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
283
      cd $dir/tests/$chapter/$i
284
      cat ${i}.log >> $dir/acats.log
285
      egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
286
      if [ $? -ne 0 ]; then
287
         grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
288
 
289
         if [ $? -ne 0 ]; then
290
            display "FAIL:      $i"
291
            failed="${failed}${i} "
292
         else
293
            log "UNSUPPORTED:   $i"
294
            glob_countn=`expr $glob_countn - 1`
295
            glob_countu=`expr $glob_countu + 1`
296
         fi
297
      else
298
         log "PASS:     $i"
299
         glob_countok=`expr $glob_countok + 1`
300
      fi
301
      clean_dir
302
   done
303
done
304
 
305
display "               === acats Summary ==="
306
display "# of expected passes           $glob_countok"
307
display "# of unexpected failures       `expr $glob_countn - $glob_countok`"
308
 
309
if [ $glob_countu -ne 0 ]; then
310
   display "# of unsupported tests              $glob_countu"
311
fi
312
 
313
if [ $glob_countok -ne $glob_countn ]; then
314
   display "*** FAILURES: $failed"
315
fi
316
 
317
display "$0 completed at `date`"
318
 
319
exit 0

powered by: WebSVN 2.1.0

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