File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,9 @@ pub fn classify_option_5(mut option: i32) -> i32 {
8686pub fn make_color_6 ( mut n : i32 ) -> Color {
8787 return ( ( n) as Color ) ;
8888}
89+ pub type Flag = bool ;
90+ pub const Flag_FLAG_OFF : Flag = false ;
91+ pub const Flag_FLAG_ON : Flag = true ;
8992pub fn main ( ) {
9093 __cpp2rust_init_globals ( ) ;
9194 std:: process:: exit ( main_0 ( ) ) ;
@@ -188,6 +191,11 @@ fn main_0() -> i32 {
188191 ( ( { ( * entries_3. with( Value :: clone) . borrow( ) ) [ ( 2 ) as usize ] . opt } as i32 )
189192 == ( Option_OPT_C as i32 ) )
190193 ) ;
194+ let mut flag: Flag = Flag_FLAG_ON ;
195+ assert ! ( flag) ;
196+ assert ! ( !( Flag_FLAG_OFF ) ) ;
197+ flag = Flag_FLAG_OFF ;
198+ assert ! ( ( ( flag as i32 ) == ( Flag_FLAG_OFF as i32 ) ) ) ;
191199 return 0 ;
192200}
193201pub fn __cpp2rust_init_globals ( ) {
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ pub unsafe fn classify_option_5(mut option: i32) -> i32 {
7979pub unsafe fn make_color_6 ( mut n : i32 ) -> Color {
8080 return ( ( n) as Color ) ;
8181}
82+ pub type Flag = bool ;
83+ pub const Flag_FLAG_OFF : Flag = false ;
84+ pub const Flag_FLAG_ON : Flag = true ;
8285pub fn main ( ) {
8386 unsafe {
8487 __cpp2rust_init_globals ( ) ;
@@ -192,6 +195,11 @@ unsafe fn main_0() -> i32 {
192195 ( ( ( * std:: cell:: LazyCell :: force_mut( & mut * & raw mut entries_3) ) [ ( 2 ) as usize ] . opt as i32 )
193196 == ( Option_OPT_C as i32 ) )
194197 ) ;
198+ let mut flag: Flag = Flag_FLAG_ON ;
199+ assert ! ( flag) ;
200+ assert ! ( !( Flag_FLAG_OFF ) ) ;
201+ flag = Flag_FLAG_OFF ;
202+ assert ! ( ( ( flag as i32 ) == ( Flag_FLAG_OFF as i32 ) ) ) ;
195203 return 0 ;
196204}
197205pub unsafe fn __cpp2rust_init_globals ( ) {
You can’t perform that action at this time.
0 commit comments