diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-10-11 14:40:18 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-10-16 15:30:23 +0000 |
commit | 9ddb362bc0b6183c64332f853f6364fdd97cd605 (patch) | |
tree | 0ab5fb58ea4653ee77f29ccb26924b5a0b10ba3a /gcc | |
parent | abb2703e8fa3785e384672e2ce3d54bf3fb0a6cf (diff) | |
download | gcc-9ddb362bc0b6183c64332f853f6364fdd97cd605.zip gcc-9ddb362bc0b6183c64332f853f6364fdd97cd605.tar.gz gcc-9ddb362bc0b6183c64332f853f6364fdd97cd605.tar.bz2 |
Add regression test
This new test highlight the fix for issue #2657.
gcc/testsuite/ChangeLog:
* rust/compile/match_break.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/rust/compile/match_break.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/match_break.rs b/gcc/testsuite/rust/compile/match_break.rs new file mode 100644 index 0000000..d5aca86 --- /dev/null +++ b/gcc/testsuite/rust/compile/match_break.rs @@ -0,0 +1,14 @@ +// { dg-additional-options "-frust-compile-until=ast" } +enum Nat { + S(Box<Nat>), + Z, +} +fn test(x: &mut Nat) { + let mut p = &mut *x; + loop { + match p { + &mut Nat::Z => break, + &mut Nat::S(ref mut n) => p = &mut *n, + } + } +} |