File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
c2rust-transpile/tests/snapshots Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,12 @@ void compound_literal(){
3838 /// https://github.com/immunant/c2rust/issues/1234
3939 int i = (enum {A , B , C }){1 };
4040}
41+
42+ void statement_expr () {
43+ ({
44+ puts ("should execute" );
45+ return ;
46+ });
47+
48+ puts ("should be unreachable!" );
49+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ input_file: c2rust-transpile/tests/snapshots/exprs.c
1111 unused_assignments ,
1212 unused_mut
1313)]
14- #! [feature (raw_ref_op )]
14+ #! [feature (label_break_value , raw_ref_op )]
1515extern " C" {
1616 fn puts (str : * const ::core ::ffi ::c_char ) - > ::core ::ffi ::c_int ;
1717}
@@ -56,3 +56,8 @@ pub unsafe extern "C" fn unary_with_side_effect() {
5656pub unsafe extern " C" fn compound_literal () {
5757 let mut i: ::core ::ffi ::c_int = B as ::core ::ffi ::c_int ;
5858}
59+ #[no_mangle ]
60+ pub unsafe extern " C" fn statement_expr () {
61+ puts (b " should execute\0 " as *const u8 as *const ::core ::ffi ::c_char );
62+ puts (b " should be unreachable!\0 " as *const u8 as *const ::core ::ffi ::c_char );
63+ }
You can’t perform that action at this time.
0 commit comments