Skip to content

Commit 17231c8

Browse files
VillosseP-E-P
authored andcommitted
gccrs: Adds test of issue 1210
Adds new test. Fixes #1210 gcc/testsuite/ChangeLog: * rust/compile/issue-1210.rs: New test. Signed-off-by: lenny.chiadmi-delage <[email protected]>
1 parent eef385b commit 17231c8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
enum E {
2+
One,
3+
Two,
4+
Other
5+
}
6+
7+
fn foo (x: E) -> i32 {
8+
let mut y = 0;
9+
10+
match x {
11+
E::One => {
12+
y = 1, // { dg-error "expected .;. or .\}. after expression, found .,." "" {target *-*-*} 0 }
13+
}
14+
E::Two => {
15+
y = 2;
16+
}
17+
_ => {}
18+
}
19+
20+
return y;
21+
}
22+
23+
fn main () {
24+
let x = E::One;
25+
let y = foo (x);
26+
}

0 commit comments

Comments
 (0)