Skip to content

Commit 2a2ce11

Browse files
committed
Added tests for goto after function.
1 parent 95cfeb5 commit 2a2ce11

File tree

2 files changed

+35
-0
lines changed
  • regression/goto-analyzer/variable-sensitivity-assign-aware-merge-goto-after-function

2 files changed

+35
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
void param_function(int *old_val, int new_val)
2+
{
3+
*old_val = new_val;
4+
}
5+
6+
void param_function_extra(int *old_val, int new_val)
7+
{
8+
*old_val = new_val;
9+
}
10+
11+
void test_param_function(int nondet)
12+
{
13+
int a = 5;
14+
int b;
15+
__CPROVER_assert(a==5, "a==5");
16+
if (nondet) {
17+
a = 6;
18+
b = 7;
19+
goto whatever;
20+
}
21+
param_function(&a, 10);
22+
param_function_extra(&b, 7);
23+
whatever:
24+
__CPROVER_assert(a==10, "a==10");
25+
__CPROVER_assert(b==7, "b==7");
26+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--function test_param_function --variable --pointers --arrays --structs --verify
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
[test_param_function.assertion.1] .* a==5: Success
7+
[test_param_function.assertion.2] .* a==10: Unknown
8+
[test_param_function.assertion.3] .* b==7: Success
9+
--

0 commit comments

Comments
 (0)