Skip to content

Commit a41ac17

Browse files
author
Thomas Kiley
committed
Add test for printing different float values in the trace
1 parent 75d4fac commit a41ac17

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

regression/cbmc/float-trace/test.c

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

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)