File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,21 @@ fn test_definition(
72
72
s. extend_from_slice ( rest) ;
73
73
}
74
74
Some ( Str ( s) )
75
+ } else if expected == b"Cast" {
76
+ str:: from_utf8 ( value) . ok ( ) . and_then ( |s| {
77
+ let ( ty, value) = s. rsplit_once ( "_Int_" ) ?;
78
+
79
+ let ty = ty. split ( "_" ) . filter_map ( |t| {
80
+ if t == "const" || t == "signed" {
81
+ None
82
+ } else {
83
+ Some ( t. as_bytes ( ) . to_vec ( ) )
84
+ }
85
+ } ) . collect :: < Vec < Vec < u8 > > > ( ) ;
86
+ let int = bytes_to_int ( value. as_bytes ( ) ) ?;
87
+
88
+ Some ( Cast ( ty, Box :: new ( int) ) )
89
+ } )
75
90
} else if expected == b"Int" {
76
91
bytes_to_int ( value)
77
92
} else if expected == b"Float" {
Original file line number Diff line number Diff line change 3
3
#define Int_n9223372036854775808 -9223372036854775808
4
4
5
5
#define Fn_Int_n9 (_3 ) _3*-3
6
+
7
+ #define Cast_short_Int_n6 (short) -6
8
+ #define Cast_signed_short_Int_n6 (signed short) -6
9
+ #define Cast_const_short_Int_n6 (const short) -6
10
+ #define Cast_const_signed_short_Int_n6 (const signed short) -6
11
+
12
+ #define Cast_int_Int_n6 (int) -6
13
+ #define Cast_signed_int_Int_n6 (signed int) -6
14
+ #define Cast_const_int_Int_n6 (const int) -6
15
+ #define Cast_const_signed_int_Int_n6 (const signed int) -6
16
+
17
+ #define Cast_long_Int_n6 (long) -6
18
+ #define Cast_signed_long_Int_n6 (signed long) -6
19
+ #define Cast_const_long_Int_n6 (const long) -6
20
+ #define Cast_const_signed_long_Int_n6 (const signed long) -6
21
+
22
+ #define Cast_long_long_Int_n6 (long long) -6
23
+ #define Cast_signed_long_long_Int_n6 (signed long long) -6
24
+ #define Cast_const_long_long_Int_n6 (const long long) -6
25
+ #define Cast_const_signed_long_long_Int_n6 (const signed long long) -6
Original file line number Diff line number Diff line change 28
28
29
29
#define Fn_Int_9 (_3 ) _3*3
30
30
#define Fn_Int_unused_arg_3 (x_unused_0 ) 3
31
+
32
+ #define Cast_unsigned_short_Int_6 (unsigned short) 6
33
+ #define Cast_const_unsigned_short_Int_6 (const unsigned short) 6
34
+
35
+ #define Cast_unsigned_int_Int_6 (unsigned int) 6
36
+ #define Cast_const_unsigned_int_Int_6 (const unsigned int) 6
37
+
38
+ #define Cast_unsigned_long_Int_6 (unsigned long) 6
39
+ #define Cast_const_unsigned_long_Int_6 (const unsigned long) 6
40
+
41
+ #define Cast_unsigned_long_long_Int_6 (unsigned long long) 6
42
+ #define Cast_const_unsigned_long_long_Int_6 (const unsigned long long) 6
You can’t perform that action at this time.
0 commit comments