diff options
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-4148.rs')
| -rw-r--r-- | gcc/testsuite/rust/compile/issue-4148.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-4148.rs b/gcc/testsuite/rust/compile/issue-4148.rs new file mode 100644 index 0000000..599d739 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4148.rs @@ -0,0 +1,26 @@ +// { dg-excess-errors "warnings" } + +// TODO: all `xfail` conditions should be changed to `target` once the ICE in #4148 is resolved + +pub fn ret_parens(x: i32) -> i32 { + // { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 } + ((x+1)) +} + +// { dg-warning "unnecessary parentheses around type" "#4148" { xfail *-*-* } .+1 } +// { dg-warning "unnecessary parentheses around pattern" "#4148" { xfail *-*-* } .+1 } +pub fn arg_ret_parens((x): (i32)) -> (i32) { + // { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 } + ((x+1)) +} + +// { dg-warning "unnecessary parentheses around type" "#4148" { xfail *-*-* } .+1 } +pub fn ret_rpit_parens2(x: i32) -> (i32) { + // { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 } + ((x+1)) +} + +pub fn ret_parens3(x: i32) -> i32 { + // { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 } + ((x+1)) +} |
