Skip to content

Commit c7150c5

Browse files
author
Thomas Kiley
committed
Add test for printing different float values in the trace
1 parent c79f93f commit c7150c5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

regression/cbmc/float-trace/test.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <assert.h>
2+
#include <stdbool.h>
3+
4+
int main()
5+
{
6+
float zero = 0.0f;
7+
float one = 1.0f;
8+
double dzero = 0.0;
9+
float complex = 0x1p+37f;
10+
11+
assert(false);
12+
13+
return 0;
14+
}
15+
16+
void test(float value)
17+
{
18+
assert(value == 1.0f);
19+
assert(value == 0.0f);
20+
}

regression/cbmc/float-trace/test.desc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
test.c
3+
--trace --xml-ui
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
VERIFICATION FAILED
7+
<full_lhs_value binary="00000000000000000000000000000000">0.0f</full_lhs_value>
8+
<full_lhs_value binary="00111111100000000000000000000000">1.0f</full_lhs_value>
9+
<full_lhs_value binary="0000000000000000000000000000000000000000000000000000000000000000">0.0</full_lhs_value>
10+
<full_lhs_value binary="01010010000000000000000000000000">1\.374390e\+11f</full_lhs_value>
11+
--
12+
--

0 commit comments

Comments
 (0)