summary refs log tree commit diff stats
path: root/tests/pragmas/tpush.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pragmas/tpush.nim')
-rw-r--r--tests/pragmas/tpush.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/pragmas/tpush.nim b/tests/pragmas/tpush.nim
index cb411714e..9c6b85c4e 100644
--- a/tests/pragmas/tpush.nim
+++ b/tests/pragmas/tpush.nim
@@ -124,3 +124,21 @@ foo31()
 foo41()
 
 {.pop.}
+
+import macros
+
+block:
+  {.push deprecated.}
+  template test() = discard
+  test()
+  {.pop.}
+  macro foo(): bool =
+    let ast = getImpl(bindSym"test")
+    var found = false
+    if ast[4].kind == nnkPragma:
+      for x in ast[4]:
+        if x.eqIdent"deprecated":
+          found = true
+          break
+    result = newLit(found)
+  doAssert foo()