| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | ## |
| 3 | ## Copyright (c) 2012, 2016 The University of Utah |
| 4 | ## All rights reserved. |
| 5 | ## |
| 6 | ## This file is distributed under the University of Illinois Open Source |
| 7 | ## License. See the file COPYING for details. |
| 8 | |
| 9 | ############################################################################### |
| 10 | |
| 11 | rmscip-shell system . . rm. -f out*.txt |
| 12 | |
| 13 | ulimit -t 3 |
| 14 | ulimit -v 2000000 |
| 15 | |
| 16 | if |
| 17 | clangscip-shell system . . clang. -pedantic -Wall -O0 -c small.c >out.txt 2>&1 &&\ |
| 18 | ! grepscip-shell system . . grep. 'conversions than data arguments' out.txt &&\ |
| 19 | ! grepscip-shell system . . grep. 'incompatible redeclaration' out.txt &&\ |
| 20 | ! grepscip-shell system . . grep. 'ordered comparison between pointer' out.txt &&\ |
| 21 | ! grepscip-shell system . . grep. 'eliding middle term' out.txt &&\ |
| 22 | ! grepscip-shell system . . grep. 'end of non-void function' out.txt &&\ |
| 23 | ! grepscip-shell system . . grep. 'invalid in C99' out.txt &&\ |
| 24 | ! grepscip-shell system . . grep. 'specifies type' out.txt &&\ |
| 25 | ! grepscip-shell system . . grep. 'should return a value' out.txt &&\ |
| 26 | ! grepscip-shell system . . grep. 'uninitialized' out.txt &&\ |
| 27 | ! grepscip-shell system . . grep. 'incompatible pointer to' out.txt &&\ |
| 28 | ! grepscip-shell system . . grep. 'incompatible integer to' out.txt &&\ |
| 29 | ! grepscip-shell system . . grep. 'type specifier missing' out.txt &&\ |
| 30 | gcc -Wall -Wextra -O1 small.c -o smallz >outa.txt 2>&1 &&\ |
| 31 | ! grepscip-shell system . . grep. uninitialized outa.txt &&\ |
| 32 | ! grepscip-shell system . . grep. 'without a cast' outa.txt &&\ |
| 33 | ! grepscip-shell system . . grep. 'control reaches end' outa.txt &&\ |
| 34 | ! grepscip-shell system . . grep. 'return type defaults' outa.txt &&\ |
| 35 | ! grepscip-shell system . . grep. 'cast from pointer to integer' outa.txt &&\ |
| 36 | ! grepscip-shell system . . grep. 'useless type name in empty declaration' outa.txt &&\ |
| 37 | ! grepscip-shell system . . grep. 'no semicolon at end' outa.txt &&\ |
| 38 | ! grepscip-shell system . . grep. 'type defaults to' outa.txt &&\ |
| 39 | ! grepscip-shell system . . grep. 'too few arguments for format' outa.txt &&\ |
| 40 | ! grepscip-shell system . . grep. 'incompatible pointer' outa.txt &&\ |
| 41 | ! grepscip-shell system . . grep. 'ordered comparison of pointer with integer' outa.txt &&\ |
| 42 | ! grepscip-shell system . . grep. 'declaration does not declare anything' outa.txt &&\ |
| 43 | ! grepscip-shell system . . grep. 'expects type' outa.txt &&\ |
| 44 | ! grepscip-shell system . . grep. 'pointer from integer' outa.txt &&\ |
| 45 | ! grepscip-shell system . . grep. 'incompatible implicit' outa.txt &&\ |
| 46 | ! grepscip-shell system . . grep. 'excess elements in struct initializer' outa.txt &&\ |
| 47 | ! grepscip-shell system . . grep. 'comparison between pointer and integer' outa.txt &&\ |
| 48 | XXOPT1 small.c -o small1 > cc_out1.txt 2>&1 &&\ |
| 49 | ./small1 >out1.txt 2>&1 &&\ |
| 50 | XXOPT2 small.c -o small2 > cc_out2.txt 2>&1 &&\ |
| 51 | ./small2 >out2.txt 2>&1 &&\ |
| 52 | ! diffscip-shell system . . diff. out1.txt out2.txt &&\ |
| 53 | cp small.c small-framac.c &&\ |
| 54 | perl -pi.bak -e 's/int main \(int argc, char\* argv\[\]\)/int argc; char **argv; int main (void)/' small-framac.c &&\ |
| 55 | RunSafely.sh 125 1 /dev/nullscip-shell filesystem . . `/dev/null`. out_framac.txt frama-c -cpp-command \"gcc -C -Dvolatile= -E -I.\" -val-signed-overflow-alarms -val -stop-at-first-alarm -no-val-show-progress -machdep x86_64 -obviously-terminates -precise-unions small-framac.c &&\ |
| 56 | ! egrepscip-shell system . . egrep. -i '(user error|assert)' out_framac.txt >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 |
| 57 | then |
| 58 | exit 0 |
| 59 | else |
| 60 | exit 1 |
| 61 | fi |