summary refs log tree commit diff stats
path: root/tests/pragmas/treorderdeclared.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pragmas/treorderdeclared.nim')
-rw-r--r--tests/pragmas/treorderdeclared.nim12
1 files changed, 12 insertions, 0 deletions
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