Skip to content

Commit 510b73d

Browse files
committed
testsuite: Add more testcases for cfg() in core
gcc/testsuite/ChangeLog: * rust/compile/cfg-core1.rs: New test. * rust/compile/cfg-core2.rs: New test.
1 parent 75ef9fd commit 510b73d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// { dg-additional-options "-frust-cfg=A -frust-cfg=B" }
2+
3+
#[cfg_attr(A, cfg(B))]
4+
struct Foo0;
5+
6+
#[cfg_attr(A, cfg(C))]
7+
struct Bar0;
8+
9+
fn main() {
10+
let a = Foo0;
11+
let a = Bar0; // { dg-error "cannot find value" }
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// { dg-additional-options "-frust-cfg=B" }
2+
3+
#[cfg(not(any(A, B)))]
4+
struct Foo0;
5+
6+
#[cfg(not(any(A, C)))]
7+
struct Bar0;
8+
9+
fn main() {
10+
let a = Foo0; // { dg-error "cannot find value" }
11+
let a = Bar0;
12+
}

0 commit comments

Comments
 (0)