summaryrefslogtreecommitdiffstats
path: root/src/test/ui/test-attrs/decl-macro-test.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/test-attrs/decl-macro-test.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/test-attrs/decl-macro-test.rs b/src/test/ui/test-attrs/decl-macro-test.rs
new file mode 100644
index 000000000..fcbe9f49e
--- /dev/null
+++ b/src/test/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!();