Skip to content

Commit 47ad91a

Browse files
committed
Add regression tests for invalid usage of --nondet-volatile-model
1 parent cc46483 commit 47ad91a

File tree

6 files changed

+75
-0
lines changed

6 files changed

+75
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <assert.h>
2+
3+
volatile int a;
4+
5+
float model()
6+
{
7+
return 1;
8+
}
9+
10+
void main()
11+
{
12+
a;
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
test.c
3+
--nondet-volatile-model a:model
4+
^Invalid User Input$
5+
return type of model .* is not compatible with the type of the modelled variable
6+
^EXIT=1$
7+
^SIGNAL=0$
8+
--
9+
--
10+
Check that the command line typechecking reports when a model with a return type
11+
that is incompatible with the type of the modelled variable is given
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
test.c
3+
--nondet-volatile-model a:non_existing_model
4+
^Invalid User Input$
5+
given model name .* not found in symbol table
6+
^EXIT=1$
7+
^SIGNAL=0$
8+
--
9+
--
10+
Check that the command line typechecking reports when a given model for a
11+
variable cannot be found
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <assert.h>
2+
3+
volatile int a;
4+
5+
int model_a()
6+
{
7+
return 1;
8+
}
9+
10+
int model_b()
11+
{
12+
return 2;
13+
}
14+
15+
void main()
16+
{
17+
a;
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
test.c
3+
--nondet-volatile-model a:model_a --nondet-volatile-model a:model_b
4+
^Invalid User Input$
5+
conflicting models for variable
6+
^EXIT=1$
7+
^SIGNAL=0$
8+
--
9+
--
10+
Check that the command line typechecking reports when two conflicting models are
11+
given for a variable
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
test.c
3+
--nondet-volatile-model a:model_a --nondet-volatile-variable a
4+
^Invalid User Input$
5+
conflicting options for variable
6+
^EXIT=1$
7+
^SIGNAL=0$
8+
--
9+
--
10+
Check that the command line typechecking reports when conflicting options are
11+
given for a variable

0 commit comments

Comments
 (0)