about summary refs log tree commit diff
path: root/tests/ui/macros/macro-with-attrs1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/macros/macro-with-attrs1.rs')
-rw-r--r--tests/ui/macros/macro-with-attrs1.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-with-attrs1.rs b/tests/ui/macros/macro-with-attrs1.rs
new file mode 100644
index 00000000000..4e943b224cd
--- /dev/null
+++ b/tests/ui/macros/macro-with-attrs1.rs
@@ -0,0 +1,13 @@
+// run-pass
+// compile-flags: --cfg foo
+
+
+#[cfg(foo)]
+macro_rules! foo { () => (1) }
+
+#[cfg(not(foo))]
+macro_rules! foo { () => (2) }
+
+pub fn main() {
+    assert_eq!(foo!(), 1);
+}