diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-03-01 11:36:42 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-03-01 21:31:47 +0000 |
commit | 9ec974b93e7442b5babbea91683de64bf1b02dbd (patch) | |
tree | 21bacd6ac5471af198712464c567cf0f3a829807 | |
parent | 0e41289aa52993a6d4844e7458dc4cb08e4618ad (diff) | |
download | gcc-9ec974b93e7442b5babbea91683de64bf1b02dbd.zip gcc-9ec974b93e7442b5babbea91683de64bf1b02dbd.tar.gz gcc-9ec974b93e7442b5babbea91683de64bf1b02dbd.tar.bz2 |
testsuite: Add a test for .. in slice patterns
Add a test to check wether the syntax of a RestPattern in a SlicePattern
parse correctly.
gcc/testsuite/ChangeLog:
* rust/compile/slice_rest_pattern.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r-- | gcc/testsuite/rust/compile/slice_rest_pattern.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/slice_rest_pattern.rs b/gcc/testsuite/rust/compile/slice_rest_pattern.rs new file mode 100644 index 0000000..c27a8dd --- /dev/null +++ b/gcc/testsuite/rust/compile/slice_rest_pattern.rs @@ -0,0 +1,8 @@ +// { dg-options "-fsyntax-only" } +fn foo(a: &[u32]) { + match a { + [first, ..] => {} + [.., last] => {} + _ => {} + } +} |