summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-06-29 17:21:22 +0800
committerGitHub <noreply@github.com>2023-06-29 11:21:22 +0200
commit41ec894cb0aa0b0d233a0f62ff4929d64ddad3a7 (patch)
tree84a84ea78373780d1fa470ff2727bed03cf1d50f /tests
parentd139d99946c97dca9c864709726841855a089496 (diff)
downloadNim-41ec894cb0aa0b0d233a0f62ff4929d64ddad3a7.tar.gz
alternative to #22183; nimscript shares the same compileTime sym with VM (#22184)
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/mscriptcompiletime.nim7
-rw-r--r--tests/vm/tscriptcompiletime.nims9
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/vm/mscriptcompiletime.nim b/tests/vm/mscriptcompiletime.nim
new file mode 100644
index 000000000..ed7e7c029
--- /dev/null
+++ b/tests/vm/mscriptcompiletime.nim
@@ -0,0 +1,7 @@
+# bug.nim
+var bar* {.compileTime.} = 1
+
+proc dummy = discard
+
+static:
+  inc bar
\ No newline at end of file
diff --git a/tests/vm/tscriptcompiletime.nims b/tests/vm/tscriptcompiletime.nims
new file mode 100644
index 000000000..daec54bf7
--- /dev/null
+++ b/tests/vm/tscriptcompiletime.nims
@@ -0,0 +1,9 @@
+discard """
+  cmd: "nim e $file"
+"""
+
+import mscriptcompiletime
+
+macro foo =
+  doAssert bar == 2
+foo()