modernc.org/cc@v1.0.1/v2/testdata/tcc-0.9.26/tests/gcctestsuite.sh (about)

     1  #!/bin/sh
     2  
     3  TESTSUITE_PATH=$HOME/gcc/gcc-3.2/gcc/testsuite/gcc.c-torture
     4  TCC="./tcc -B. -I. -DNO_TRAMPOLINES" 
     5  rm -f tcc.sum tcc.log
     6  nb_failed="0"
     7  
     8  for src in $TESTSUITE_PATH/compile/*.c ; do
     9    echo $TCC -o /tmp/test.o -c $src 
    10    $TCC -o /tmp/test.o -c $src >> tcc.log 2>&1
    11    if [ "$?" = "0" ] ; then
    12       result="PASS"
    13    else
    14       result="FAIL"
    15       nb_failed=$(( $nb_failed + 1 ))
    16    fi
    17    echo "$result: $src"  >> tcc.sum
    18  done
    19  
    20  for src in $TESTSUITE_PATH/execute/*.c ; do
    21    echo $TCC $src 
    22    $TCC $src >> tcc.log 2>&1
    23    if [ "$?" = "0" ] ; then
    24       result="PASS"
    25    else
    26       result="FAIL"
    27       nb_failed=$(( $nb_failed + 1 ))
    28    fi
    29    echo "$result: $src"  >> tcc.sum
    30  done
    31  
    32  echo "$nb_failed test(s) failed." >> tcc.sum
    33  echo "$nb_failed test(s) failed."