summary refs log tree commit diff stats
path: root/tests/pragmas
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pragmas')
-rw-r--r--tests/pragmas/treorder.nim5
-rw-r--r--tests/pragmas/treorderdeclared.nim12
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/pragmas/treorder.nim b/tests/pragmas/treorder.nim
index 1006af527..659a6f644 100644
--- a/tests/pragmas/treorder.nim
+++ b/tests/pragmas/treorder.nim
@@ -6,7 +6,8 @@ output:'''0
 """
 
 import macros
-{.reorder: on .}
+# {.reorder: on .}
+{.experimental: "codeReordering".}
 
 echo foo(-1)
 echo callWithFoo(0)
@@ -71,4 +72,4 @@ macro make(arg: untyped): untyped =
 proc first(i: int): void =
   make(second)
 
-var ss {.compileTime.}: string = ""
\ No newline at end of file
+var ss {.compileTime.}: string = ""
diff --git a/tests/pragmas/treorderdeclared.nim b/tests/pragmas/treorderdeclared.nim
new file mode 100644
index 000000000..67403471b
--- /dev/null
+++ b/tests/pragmas/treorderdeclared.nim
@@ -0,0 +1,12 @@
+discard """
+output:'''false'''
+"""
+
+{.experimental: "codeReordering".}
+
+proc x() =
+  echo(declared(foo))
+
+var foo = 4
+
+x() # "false", the same as it would be with code reordering OFF