Debian Codegraph @

scripts/test1_wrong_code_kcc.sh

raw symbols SCIP
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 >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 RunSafely.sh 3 1 /dev/nullscip-shell filesystem . . `/dev/null`. out1.txt ./small1 >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 &&\
50 XXOPT2 small.c -o small2 > cc_out2.txt 2>&1 &&\
51 RunSafely.sh 3 1 /dev/nullscip-shell filesystem . . `/dev/null`. out2.txt ./small2 >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1 &&\
52 ! diffscip-shell system . . diff. out1.txt out2.txt &&\
53 kcc -s small.c >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1
54 then
55 if
56 RunSafely.sh 125 1 /dev/nullscip-shell filesystem . . `/dev/null`. out_kcc.txt ./a.out >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1
57 then
58 exit 0
59 else
60 catscip-shell system . . cat. out_kcc.txt
61 TMPF="undefined_$$.c"
62 echoscip-shell system . . echo. copying C file to $TMPF
63 cpscip-shell system . . cp. small.c $TMPF
64 exit 1
65 fi
66 else
67 exit 1
68 fi