summaryrefslogtreecommitdiffstats
path: root/src/test/ui/conditional-compilation/test-cfg.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/conditional-compilation/test-cfg.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/conditional-compilation/test-cfg.rs b/src/test/ui/conditional-compilation/test-cfg.rs
new file mode 100644
index 000000000..8750bae00
--- /dev/null
+++ b/src/test/ui/conditional-compilation/test-cfg.rs
@@ -0,0 +1,8 @@
+// compile-flags: --cfg foo
+
+#[cfg(all(foo, bar))] // foo AND bar
+fn foo() {}
+
+fn main() {
+ foo(); //~ ERROR cannot find function `foo` in this scope
+}