Skip to content

Commit 9384b91

Browse files
author
Thomas Kiley
committed
Add additional tests for more types
1 parent 7e5b37e commit 9384b91

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

regression/cbmc/float-trace/test.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#include <assert.h>
2+
#include <math.h>
23
#include <stdbool.h>
34

45
int main()
56
{
67
float zero = 0.0f;
78
float one = 1.0f;
8-
double dzero = 0.0;
99
float complex = 0x1p+37f;
10+
float inf = INFINITY;
11+
float nan = NAN;
12+
13+
double dzero = 0.0;
14+
double done = 1.0;
15+
double dinf = INFINITY;
16+
double dnan = NAN;
17+
double dcomplex = -5.56268e-309;
1018

1119
assert(false);
1220

regression/cbmc/float-trace/test.desc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,28 @@ test.c
44
^EXIT=10$
55
^SIGNAL=0$
66
VERIFICATION FAILED
7-
<full_lhs_value binary="00000000000000000000000000000000">0.0f</full_lhs_value>
7+
<full_lhs>zero</full_lhs>
8+
<full_lhs_value binary="0{32}">0.0f</full_lhs_value>
9+
<full_lhs>one</full_lhs>
810
<full_lhs_value binary="00111111100000000000000000000000">1.0f</full_lhs_value>
9-
<full_lhs_value binary="0000000000000000000000000000000000000000000000000000000000000000">0.0</full_lhs_value>
11+
<full_lhs>complex</full_lhs>
1012
<full_lhs_value binary="01010010000000000000000000000000">1\.374390e\+11f</full_lhs_value>
13+
<full_lhs>inf</full_lhs>
14+
<full_lhs_value binary="01{8}0{23}">\+INFINITY</full_lhs_value>
15+
<full_lhs>nan</full_lhs>
16+
<full_lhs_value binary="01{8}[01]*1[01]*">\+NAN</full_lhs_value>
17+
<full_lhs_value binary="[01]{32}">\+NAN</full_lhs_value>
18+
<full_lhs>dzero</full_lhs>
19+
<full_lhs_value binary="0{64}">0.0</full_lhs_value>
20+
<full_lhs>done</full_lhs>
21+
<full_lhs_value binary="001{10}0{52}">1.0</full_lhs_value>
22+
<full_lhs>dcomplex</full_lhs>
23+
<full_lhs_value binary="1000000000000011111111111111111111000111111100100110011101110111">-5\.562680e-309</full_lhs_value>
24+
<full_lhs>inf</full_lhs>
25+
<full_lhs_value binary="01{11}0{52}">\+INFINITY</full_lhs_value>
26+
<full_lhs>nan</full_lhs>
27+
<full_lhs_value binary="01{11}[01]*1[01]*">\+NAN</full_lhs_value>
28+
<full_lhs_value binary="[01]{64}">\+NAN</full_lhs_value>
1129
--
1230
--
1331
Checks that the binary value is printed for floating point types

0 commit comments

Comments
 (0)