File tree Expand file tree Collapse file tree
c2rust-transpile/tests/snapshots Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ char static_char_array[] = "mystring";
44char * static_char_ptr = "mystring" ;
55void * static_void_ptr = (void * ) static_char_array ;
66
7+ typedef int int_t ;
8+
79void entry (void ) {
810 int int_2d [1 ][1 ] = { 1 };
911 int_2d [0 ][0 ] += 9 ;
@@ -14,6 +16,9 @@ void entry(void) {
1416 int int_too_short [16 ] = {0 };
1517 int_too_short [15 ] += 9 ;
1618
19+ int_t override_ty [] = { 1 };
20+ int_t override_ty_neg [] = { -1 };
21+
1722 struct {char * x ; int y ;} struct_init_too_short [1 ] = {};
1823 struct_init_too_short [0 ].y += 9 ;
1924 struct {short ; int y ;} struct_init_too_long [1 ] = { { 1 , 2 } };
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ expression: cat tests/snapshots/arrays.2021.clang15.rs
1212 unused_mut
1313)]
1414#! [feature (raw_ref_op )]
15+ pub type int_t = ::core ::ffi ::c_int ;
1516#[derive (Copy , Clone )]
1617#[repr (C )]
1718pub struct C2Rust_Unnamed {
@@ -56,6 +57,8 @@ pub unsafe extern "C" fn entry() {
5657 let mut int_zero: [::core ::ffi ::c_int ; 0 ] = [0 ; 0 ];
5758 let mut int_too_short: [::core ::ffi ::c_int ; 16 ] = [0 as ::core ::ffi ::c_int ; 16 ];
5859 int_too_short [15 as ::core ::ffi ::c_int as usize ] += 9 as ::core ::ffi ::c_int ;
60+ let mut override_ty: [int_t ; 1 ] = [1 as ::core ::ffi ::c_int ];
61+ let mut override_ty_neg: [int_t ; 1 ] = [- 1 as ::core ::ffi ::c_int ];
5962 let mut struct_init_too_short: [C2Rust_Unnamed_0 ; 1 ] = [C2Rust_Unnamed_0 {
6063 x: ::core ::ptr ::null_mut ::< ::core ::ffi ::c_char > (),
6164 y: 0 ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ expression: cat tests/snapshots/arrays.2024.clang15.rs
1212 unused_assignments ,
1313 unused_mut
1414)]
15+ pub type int_t = ::core ::ffi ::c_int ;
1516#[derive (Copy , Clone )]
1617#[repr (C )]
1718pub struct C2Rust_Unnamed {
@@ -56,6 +57,8 @@ pub unsafe extern "C" fn entry() {
5657 let mut int_zero: [::core ::ffi ::c_int ; 0 ] = [0 ; 0 ];
5758 let mut int_too_short: [::core ::ffi ::c_int ; 16 ] = [0 as ::core ::ffi ::c_int ; 16 ];
5859 int_too_short [15 as ::core ::ffi ::c_int as usize ] += 9 as ::core ::ffi ::c_int ;
60+ let mut override_ty: [int_t ; 1 ] = [1 as ::core ::ffi ::c_int ];
61+ let mut override_ty_neg: [int_t ; 1 ] = [- 1 as ::core ::ffi ::c_int ];
5962 let mut struct_init_too_short: [C2Rust_Unnamed_0 ; 1 ] = [C2Rust_Unnamed_0 {
6063 x: ::core ::ptr ::null_mut ::< ::core ::ffi ::c_char > (),
6164 y: 0 ,
You can’t perform that action at this time.
0 commit comments