summary refs log tree commit diff stats
path: root/tests/destructor/tglobaldestructor.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2019-05-13 08:28:33 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-05-13 08:28:33 +0200
commit0c869eaa475caab9558aaf5b39b8e3519388f811 (patch)
tree6a1ee425e34f811c6e82cd6e48145465dad3a7d5 /tests/destructor/tglobaldestructor.nim
parenta3e27ffa2c721b2ef3b0481d7db5c45039072050 (diff)
downloadNim-0c869eaa475caab9558aaf5b39b8e3519388f811.tar.gz
Fix destructor injections for global variables (#11230)
* attach global destructors at end of mainModule
* Add testcase
* Minor cleanup
* Inject topLevelVar temporaries' destructors early
* Fix megatest
Diffstat (limited to 'tests/destructor/tglobaldestructor.nim')
-rw-r--r--tests/destructor/tglobaldestructor.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/destructor/tglobaldestructor.nim b/tests/destructor/tglobaldestructor.nim
new file mode 100644
index 000000000..403f670a0
--- /dev/null
+++ b/tests/destructor/tglobaldestructor.nim
@@ -0,0 +1,9 @@
+discard """
+  cmd: '''nim c --newruntime $file'''
+  output: '''(v: 42)
+igotdestroyed'''
+"""
+
+import objFile
+
+echo test