Skip to content

Commit 954d474

Browse files
Polygonalrpowerboat9
authored andcommitted
gccrs: Add new test cases for old issues
#3555, #3591, #3597, #3651, #3670 & #3672 were all fixed long ago by some of my older patches, adding test cases to conclude the issues properly. gcc/testsuite/ChangeLog: * rust/compile/issue-3555.rs: New test case. * rust/compile/issue-3591.rs: New test case. * rust/compile/issue-3597.rs: New test case. * rust/compile/issue-3651.rs: New test case. * rust/compile/issue-3670.rs: New test case. * rust/compile/issue-3672.rs: New test case. Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
1 parent 6e42e12 commit 954d474

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
4+
fn main() {
5+
match SomeStruct(2) {
6+
StructConst1(_) => {}
7+
8+
_ => {}
9+
}
10+
11+
struct SomeStruct(u8);
12+
13+
const StructConst1: SomeStruct = SomeStruct(1);
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
4+
fn main() {
5+
match (0, 92, 29) {
6+
(pat, ..) => {}
7+
}
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
4+
enum E {
5+
A = {
6+
enum F { }
7+
0
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
enum E {
4+
A = {
5+
enum F {
6+
Ai32 = -1,
7+
}
8+
0
9+
},
10+
}
11+
12+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![feature(no_core)]
2+
#![no_core]
3+
enum E {
4+
A = {
5+
enum Foo {
6+
Bar(isize),
7+
Baz,
8+
}
9+
0
10+
},
11+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// { dg-options "-w" }
2+
#![feature(no_core)]
3+
#![no_core]
4+
struct Y(usize, usize);
5+
6+
fn distinct_variant() {
7+
let y = Y(1, 2);
8+
9+
let a = match y {
10+
Y(a, _) => a,
11+
};
12+
}

0 commit comments

Comments
 (0)