Skip to content

Commit 458b0df

Browse files
author
Daniel Kroening
committed
bug: functions without body generate incorrect trace
We see a return from main, but wanted to see a return from function_without_body.
1 parent 30a8a70 commit 458b0df

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

regression/cbmc/trace_show_function_calls/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ int function_to_call(int a)
44
return a + local;
55
}
66

7+
int function_without_body(int p);
8+
79
int main()
810
{
911
int a;
@@ -15,6 +17,7 @@ int main()
1517
a = -2147483647;
1618
a = function_to_call(a);
1719
b = function_to_call(b);
20+
a = function_without_body(123);
1821

1922
__CPROVER_assert(0, "");
2023
}

regression/cbmc/trace_show_function_calls/test.desc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
CORE broken-smt-backend
1+
KNOWNBUG broken-smt-backend
22
main.c
33
--trace --trace-show-function-calls
44
^EXIT=10$
55
^SIGNAL=0$
66
Function call: function_to_call\(-2147483647\) \(depth 2\)
77
Function return from function_to_call \(depth 1\)
88
Function call: function_to_call\(-2\) \(depth 2\)
9+
Function call: function_without_body\(123\) \(depth 2\)
10+
Function return from function_without_body \(depth 1\)
911
^VERIFICATION FAILED$
1012
--
1113
^warning: ignoring

0 commit comments

Comments
 (0)