File tree 3 files changed +46
-0
lines changed
regression/cbmc/xml-trace
3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdint.h>
3
+
4
+ union myunion {
5
+ int64_t i ;
6
+ double d ;
7
+ };
8
+
9
+ void test (union myunion u )
10
+ {
11
+ u .i += 1 ;
12
+ double d = u .d ;
13
+ assert (d != 5 );
14
+ }
Original file line number Diff line number Diff line change
1
+ CORE broken-smt-backend
2
+ main.c
3
+ --xml-ui --function test --little-endian
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ VERIFICATION FAILED
7
+ <assignment assignment_type="state" base_name="u" display_name="test::u" hidden="false" identifier="test::u" mode="C" step_nr="\d+" thread="0">
8
+ <location file=".*" function="test" line="\d+" working-directory=".*"/>
9
+ <type>union myunion</type>
10
+ <full_lhs>byte_extract_little_endian\(u, 0ll?, .*int.*\)</full_lhs>
11
+ <full_lhs_value>\d+ll?</full_lhs_value>
12
+ <value>\{ \.i=\d+ll? \}</value>
13
+ <value_expression>
14
+ <union>
15
+ <member member_name="i">
16
+ <integer binary="\d+" c_type=".*int.*" width="\d+">\d+</integer>
17
+ </member>
18
+ </union>
19
+ </value_expression>
20
+ </assignment>
21
+ --
22
+ ^warning: ignoring
23
+ --
24
+ Tests whether the assignment XML output contains all the required elements
25
+ such as identifier, full_lhs, full_lhs_value and value.
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Author: Daniel Kroening
16
16
#include < ostream>
17
17
18
18
#include < util/arith_tools.h>
19
+ #include < util/byte_operators.h>
19
20
#include < util/format_expr.h>
20
21
#include < util/range.h>
21
22
#include < util/string_utils.h>
@@ -35,6 +36,12 @@ static optionalt<symbol_exprt> get_object_rec(const exprt &src)
35
36
return get_object_rec (to_index_expr (src).array ());
36
37
else if (src.id ()==ID_typecast)
37
38
return get_object_rec (to_typecast_expr (src).op ());
39
+ else if (
40
+ src.id () == ID_byte_extract_little_endian ||
41
+ src.id () == ID_byte_extract_big_endian)
42
+ {
43
+ return get_object_rec (to_byte_extract_expr (src).op ());
44
+ }
38
45
else
39
46
return {}; // give up
40
47
}
You can’t perform that action at this time.
0 commit comments