aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/cfg4.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/cfg4.rs')
-rw-r--r--gcc/testsuite/rust/compile/cfg4.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/cfg4.rs b/gcc/testsuite/rust/compile/cfg4.rs
new file mode 100644
index 0000000..2834c27
--- /dev/null
+++ b/gcc/testsuite/rust/compile/cfg4.rs
@@ -0,0 +1,11 @@
+// { dg-additional-options "-w -frust-cfg=A" }
+struct Foo;
+impl Foo {
+ #[cfg(any(A, B))]
+ fn test(&self) {}
+}
+
+fn main() {
+ let a = Foo;
+ a.test();
+}