Debian Codegraph @

tests/test7.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2 ##
3 ## Copyright (c) 2012, 2013, 2015, 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 file="file3.c"
12
13 CLANG="${CLANG:-clang}"
14 GCC="${GCC:-gcc}"
15
16 if [scip-shell system . . `[`. $# -ne 0 ]; then
17 echoscip-shell system . . echo. "usage: $0" 1>&2
18 exit 1
19 fi
20
21 rmscip-shell system . . rm. -f out*.txt
22
23 if
24 "$CLANG" -pedantic -Wall -O0 "$file" >out.txt 2>&1 &&\
25 ! grepscip-shell system . . grep. 'incompatible redeclaration' out.txt &&\
26 ! grepscip-shell system . . grep. 'ordered comparison between pointer' out.txt &&\
27 ! grepscip-shell system . . grep. 'eliding middle term' out.txt &&\
28 ! grepscip-shell system . . grep. 'end of non-void function' out.txt &&\
29 ! grepscip-shell system . . grep. 'invalid in C99' out.txt &&\
30 ! grepscip-shell system . . grep. 'specifies type' out.txt &&\
31 ! grepscip-shell system . . grep. 'should return a value' out.txt &&\
32 ! grepscip-shell system . . grep. 'too few argument' out.txt &&\
33 ! grepscip-shell system . . grep. 'too many argument' out.txt &&\
34 ! grepscip-shell system . . grep. "return type of 'main" out.txt &&\
35 ! grepscip-shell system . . grep. 'uninitialized' out.txt &&\
36 ! grepscip-shell system . . grep. 'incompatible pointer to' out.txt &&\
37 ! grepscip-shell system . . grep. 'incompatible integer to' out.txt &&\
38 ! grepscip-shell system . . grep. 'type specifier missing' out.txt &&\
39 "$GCC" -c -Wall -Wextra -O "$file" >outa.txt 2>&1 &&\
40 ! grepscip-shell system . . grep. uninitialized outa.txt &&\
41 ! grepscip-shell system . . grep. 'control reaches end' outa.txt &&\
42 ! grepscip-shell system . . grep. 'no semicolon at end' outa.txt &&\
43 ! grepscip-shell system . . grep. 'incompatible pointer' outa.txt &&\
44 ! grepscip-shell system . . grep. 'cast from pointer to integer' outa.txt &&\
45 ! grepscip-shell system . . grep. 'ordered comparison of pointer with integer' outa.txt &&\
46 ! grepscip-shell system . . grep. 'declaration does not declare anything' outa.txt &&\
47 ! grepscip-shell system . . grep. 'expects type' outa.txt &&\
48 ! grepscip-shell system . . grep. 'assumed to have one element' outa.txt &&\
49 ! grepscip-shell system . . grep. 'division by zero' outa.txt &&\
50 ! grepscip-shell system . . grep. 'pointer from integer' outa.txt &&\
51 ! grepscip-shell system . . grep. 'incompatible implicit' outa.txt &&\
52 ! grepscip-shell system . . grep. 'excess elements in struct initializer' outa.txt &&\
53 ! grepscip-shell system . . grep. 'comparison between pointer and integer' outa.txt &&\
54 "$GCC" -O3 -w -S -o small.s "$file" &&\
55 grep xmm small.s
56 then
57 exit 0
58 else
59 exit 1
60 fi
61
62 # "$CLANG" --analyze "$file" > out_analyze.txt 2>&1 &&\
63 # ! grep garbage out_analyze.txt &&\
64 # ! grep undefined out_analyze.txt &&\