File: set_test.sh

package info (click to toggle)
mcpp 2.7.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,024 kB
  • ctags: 29,151
  • sloc: ansic: 35,191; sh: 9,231; makefile: 176; cpp: 84; exp: 18
file content (52 lines) | stat: -rwxr-xr-x 1,062 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/sh
# script to set mcpp testsuite corresponding to the version of GCC 2 or 3, 4
# ./set_test.sh $CC $gcc_path $gcc_testsuite_dir $gcc_maj_ver $LN_S $cpp_call
#       $target_cc

CC=$1
gcc_path=`expr $2 : "\(.*\)/$CC"`
target_cc=$7
if test x$target_cc != x; then
    CC=$target_cc
fi
gcc_testsuite_dir=$3
gcc_maj_ver=$4
if test $gcc_maj_ver = 4; then
    gcc_maj_ver=3;
fi
LN_S=$5
cpp_name=`echo $6 | sed 's,.*/,,'`
cpp_path=`echo $6 | sed "s,/$cpp_name,,"`

echo "  cd $gcc_testsuite_dir/gcc.dg/cpp-test/test-t"
cd "$gcc_testsuite_dir/gcc.dg/cpp-test/test-t"
for i in *_run.c
do
    rm -f $i
    echo "  $LN_S $i.gcc$gcc_maj_ver $i"
    $LN_S $i.gcc$gcc_maj_ver $i
done

echo "  cd $cpp_path"
cd "$cpp_path"
echo "  appending '-23j' options to mcpp invocation"
for i in mcpp*.sh
do
    cat $i | sed 's/mcpp/mcpp -23j/' > tmp
    mv -f tmp $i
    chmod a+x $i
done

if test $CC = gcc; then
    exit 0
fi

echo "  cd $gcc_path"
cd "$gcc_path"
if test -f "gcc"; then
    echo "  mv gcc gcc.save"
    mv gcc gcc.save
fi
echo "  $LN_S $CC gcc"
$LN_S $CC gcc