about summary refs log tree commit diff
path: root/tests/ui/test-attrs/decl-macro-test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/test-attrs/decl-macro-test.rs')
-rw-r--r--tests/ui/test-attrs/decl-macro-test.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/test-attrs/decl-macro-test.rs b/tests/ui/test-attrs/decl-macro-test.rs
new file mode 100644
index 00000000000..fcbe9f49e55
--- /dev/null
+++ b/tests/ui/test-attrs/decl-macro-test.rs
@@ -0,0 +1,22 @@
+// Check that declarative macros can declare tests
+
+// check-pass
+// compile-flags: --test
+
+#![feature(decl_macro)]
+
+macro create_test() {
+    #[test]
+    fn test() {}
+}
+
+macro create_module_test() {
+    mod x {
+        #[test]
+        fn test() {}
+    }
+}
+
+create_test!();
+create_test!();
+create_module_test!();