Skip to content

Commit 0a33f07

Browse files
committed
add test for enum discriminants
gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Exclude enum_discriminant2.rs due to ICE * rust/compile/enum_discriminant2.rs: New test. * rust/compile/enum_discriminant3.rs: New test. Signed-off-by: Ryutaro Okada <[email protected]>
1 parent 8639964 commit 0a33f07

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
let y = 3;
3+
enum Foo {
4+
Bar = y,
5+
// { dg-error "cannot find value .y. in this scope" "" { target *-*-* } .-1 }
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const x: isize = 1;
2+
// { dg-warning "unused name" "" { target *-*-* } .-1 }
3+
4+
fn main() {
5+
enum Foo {
6+
Bar = x,
7+
}
8+
}

gcc/testsuite/rust/compile/nr2/exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ torture/loop4.rs
2828
torture/loop8.rs
2929
torture/name_resolve1.rs
3030
issue-3568.rs
31+
enum_discriminant2.rs
3132
# please don't delete the trailing newline

0 commit comments

Comments
 (0)