summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-10-30 17:00:25 +0800
committerGitHub <noreply@github.com>2020-10-30 10:00:25 +0100
commit4374c638cd328b8cf9b72ff756cfe0564d6d9c78 (patch)
treed1af234ba281e73e22915c4599867aee7e8d2291 /tests
parent1725db9295b037ac410f0e6d48952c01218aee89 (diff)
downloadNim-4374c638cd328b8cf9b72ff756cfe0564d6d9c78.tar.gz
closes #6036 (#15779)
* add testcase for #6036

* try

* try again

* make it work
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tcompile_time_var_at_runtime.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ccgbugs/tcompile_time_var_at_runtime.nim b/tests/ccgbugs/tcompile_time_var_at_runtime.nim
new file mode 100644
index 000000000..c0de0390b
--- /dev/null
+++ b/tests/ccgbugs/tcompile_time_var_at_runtime.nim
@@ -0,0 +1,11 @@
+discard """
+  output: "1\n2\n2\n3"
+"""
+var a {.compileTime.} = 1
+
+echo a
+a = 2
+echo a
+echo a
+a = 3
+echo a 
\ No newline at end of file