Skip to content
Snippets Groups Projects
Commit 8d0d7174 authored by Patrick Baudin's avatar Patrick Baudin
Browse files

[Test] adding EXIT directives

parent 81fbd5b4
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 32 deletions
/* run.config
EXIT: 1
STDOPT:
*/
int f(int x) { return x++; }
int g(int y) { return y++; }
/* run.config
EXIT: 1
STDOPT:
*/
/* run.config*
EXIT: 1
STDOPT:
*/
void f(...) // f must have at least one argument
{
return;
......
/* run.config*
EXIT: 1
STDOPT:
*/
int f(int a, int, int c,...);
int main(){
......
[kernel] not-enough-par.i:4: User Error: Too few arguments in call to f.
[kernel] not-enough-par.i:8: User Error: Too few arguments in call to f.
[kernel] User Error: stopping on file "not-enough-par.i" that has errors.
[kernel] Frama-C aborted: invalid user input.
/* run.config
EXIT: 3
STDOPT:
*/
extern void Frama_C_show_each_warning(char const * , ...);
void main(void)
......
[kernel] Parsing watch.c (with preprocessing)
[kernel:typing:implicit-function-declaration] watch.c:5: Warning:
[kernel:typing:implicit-function-declaration] watch.c:10: Warning:
Calling undeclared function Frama_C_watch_value. Old style K&R code?
[kernel:typing:implicit-function-declaration] watch.c:11: Warning:
[kernel:typing:implicit-function-declaration] watch.c:16: Warning:
Calling undeclared function u. Old style K&R code?
[kernel:annot:missing-spec] watch.c:3: Warning:
[kernel:annot:missing-spec] watch.c:8: Warning:
Neither code nor specification for function Frama_C_watch_value, generating default assigns from the prototype
[eva] Analyzing a complete application starting at main
[eva] Computing initial state
......@@ -12,18 +12,18 @@
x ∈ {0}
y ∈ {0}
z ∈ {0}
[eva] watch.c:5: Call to builtin Frama_C_watch_value
[eva] watch.c:8: Watchpoint: & c [--..--]
[eva] watch.c:9: Watchpoint: & c [--..--]
[eva] watch.c:10: Call to builtin Frama_C_watch_value
[eva] watch.c:13: Watchpoint: & c [--..--]
[eva] watch.c:14: Watchpoint: & c [--..--]
[eva] computing for function u <- main.
Called from watch.c:11.
[kernel:annot:missing-spec] watch.c:11: Warning:
Called from watch.c:16.
[kernel:annot:missing-spec] watch.c:16: Warning:
Neither code nor specification for function u, generating default assigns from the prototype
[eva] using specification for function u
[eva] Done for function u
[eva] watch.c:12: Watchpoint: & c [--..--]
[eva] watch.c:13: Watchpoint: & c [--..--]
[eva] watch.c:14: Watchpoint: & c [--..--]
[eva] watch.c:17: Watchpoint: & c [--..--]
[eva] watch.c:18: Watchpoint: & c [--..--]
[eva] watch.c:19: Watchpoint: & c [--..--]
[eva] User Error: Degeneration occurred:
results are not correct for lines of code that can be reached from the degeneration point.
[from] Computing for function main
......
/* run.config*
EXIT: 1
STDOPT:
*/
int x,y,z;
int main(int c){
......
/* run.config*
EXIT: 1
STDOPT:
*/
/*@ ensures /* FOO */ \false; */
void job(void) { }
/* run.config*
EXIT: 1
STDOPT:
*/
int tab[16];
void* main(void)
{
void* main(void){
int i;
static const int* t[] = {
&tab[1],
&tab[3],
......
/* run.config
EXIT: 1
OPT: -cpp-extra-args="-DCAN_CHECK"
OPT: -cpp-extra-args="-DCANT_CHECK"
*/
#ifdef CAN_CHECK
int first_stmt(void){
......
[kernel] Parsing acsl-comments.i (no preprocessing)
[kernel:annot-error] acsl-comments.i:1: Warning:
[kernel:annot-error] acsl-comments.i:6: Warning:
lexical error, unexpected block-comment opening
[kernel] User Error: warning annot-error treated as fatal error.
[kernel] User Error: stopping on file "acsl-comments.i" that has errors.
......
[kernel] Parsing bts892.i (no preprocessing)
[kernel] bts892.i:11: User Error:
[kernel] bts892.i:15: User Error:
Forbidden access to local variable i in static initializer
[kernel] User Error: stopping on file "bts892.i" that has errors.
[kernel] Frama-C aborted: invalid user input.
......@@ -7,8 +7,8 @@
y {0}
c {0}
d {0}
[eva] control2.c:15: starting to merge loop iterations
[eva:alarm] control2.c:18: Warning:
[eva] control2.c:14: starting to merge loop iterations
[eva:alarm] control2.c:17: Warning:
signed overflow. assert x + 1 2147483647;
[eva] done for function f
[eva] ====== VALUES COMPUTED ======
......@@ -38,11 +38,11 @@
y [--..--]
c [--..--]
d [--..--]
[eva:alarm] control2.c:16: Warning:
[eva:alarm] control2.c:15: Warning:
signed overflow. assert y + 1 2147483647;
[eva:alarm] control2.c:16: Warning:
[eva:alarm] control2.c:15: Warning:
signed overflow. assert x + 1 2147483647;
[eva:alarm] control2.c:18: Warning:
[eva:alarm] control2.c:17: Warning:
signed overflow. assert x + 1 2147483647;
[eva] done for function f
[eva] ====== VALUES COMPUTED ======
......
/* run.config
EXIT: 1
OPT: -metrics-locals-size f,g,level3,level2,level1,main
OPT: -metrics-locals-size recurse2
*/
// locals size without temps: 0
int f() {
static int count = 0; // not a local
......
[kernel] User Error: source file 'tests/metrics/used-files1.i' does not exist
[kernel] User Error: source file 'used-files1.i' does not exist
[kernel] Frama-C aborted: invalid user input.
[kernel] User Error: source file 'tests/metrics/used-files1.i' does not exist
[kernel] User Error: source file 'used-files1.i' does not exist
[kernel] Frama-C aborted: invalid user input.
/* run.config
OPT: -metrics-used-files @PTEST_DIR@/@PTEST_NAME@1.i @PTEST_DIR@/@PTEST_NAME@2.i @PTEST_DIR@/@PTEST_NAME@3.i @PTEST_DIR@/@PTEST_NAME@4.i @PTEST_DIR@/@PTEST_NAME@5.i @PTEST_DIR@/@PTEST_NAME@6.i @PTEST_DIR@/@PTEST_NAME@7.i @PTEST_DIR@/@PTEST_NAME@8.i @PTEST_DIR@/@PTEST_NAME@9.c @PTEST_DIR@/@PTEST_NAME@1.h @PTEST_DIR@/@PTEST_NAME@2.h
OPT: -metrics-used-files -main g @PTEST_DIR@/@PTEST_NAME@1.i @PTEST_DIR@/@PTEST_NAME@2.i @PTEST_DIR@/@PTEST_NAME@3.i @PTEST_DIR@/@PTEST_NAME@4.i @PTEST_DIR@/@PTEST_NAME@5.i @PTEST_DIR@/@PTEST_NAME@6.i @PTEST_DIR@/@PTEST_NAME@7.i @PTEST_DIR@/@PTEST_NAME@8.i @PTEST_DIR@/@PTEST_NAME@9.c @PTEST_DIR@/@PTEST_NAME@1.h @PTEST_DIR@/@PTEST_NAME@2.h
EXIT: 1
OPT: -metrics-used-files @PTEST_NAME@1.i @PTEST_NAME@2.i @PTEST_NAME@3.i @PTEST_NAME@4.i @PTEST_NAME@5.i @PTEST_NAME@6.i @PTEST_NAME@7.i @PTEST_NAME@8.i @PTEST_NAME@9.c @PTEST_NAME@1.h @PTEST_NAME@2.h
OPT: -metrics-used-files -main g @PTEST_NAME@1.i @PTEST_NAME@2.i @PTEST_NAME@3.i @PTEST_NAME@4.i @PTEST_NAME@5.i @PTEST_NAME@6.i @PTEST_NAME@7.i @PTEST_NAME@8.i @PTEST_NAME@9.c @PTEST_NAME@1.h @PTEST_NAME@2.h
*/
int h(void);
int glob;
......
/* run.config
COMMENT: running this test fails on purpose
EXIT: 1
OPT: -simplify-cfg -typecheck
*/
/* small test cases to verify that break is accepted in while and switch */
int f () {
while (1) {
if (0) {
while (1) break;
......
/* run.config
EXIT: 1
OPT: %{dep:bts0990_link_1.i}
*/
// NB: This test is meant to return an error, as s is declared as an array in
// bts0990_link_1.i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment