summary refs log tree commit diff stats
path: root/tests/objects
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-07-17 09:28:03 +0200
committerAraq <rumpf_a@web.de>2017-07-17 09:28:03 +0200
commit91eba77b96bf6040063abe6b7551021f15685f83 (patch)
treec56ea1051779a5a1546de91bb992afafabc4c464 /tests/objects
parent9cbb4c3f85d26f371f853c157bff6d7db0b532d5 (diff)
downloadNim-91eba77b96bf6040063abe6b7551021f15685f83.tar.gz
fixes #4763
Diffstat (limited to 'tests/objects')
-rw-r--r--tests/objects/tobject3.nim32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/objects/tobject3.nim b/tests/objects/tobject3.nim
index 15dd8ea24..f3713ce22 100644
--- a/tests/objects/tobject3.nim
+++ b/tests/objects/tobject3.nim
@@ -1,3 +1,13 @@
+discard """
+  ouptut: '''TBar2
+TFoo
+16
+12
+16
+12'''
+"""
+
+## XXX this output needs to be adapated for VCC which produces different results.
 
 # It turned out that it's hard to generate correct for these two test cases at
 # the same time.
@@ -57,3 +67,25 @@ var aa = makeWindow()
 
 thisCausesError(dd, aa)
 
+# bug #4763
+type
+  testObject_1 = object
+    size: int32
+    value: int64
+
+  testObject_2 {.packed.} = object
+    size: int32
+    value: int64
+
+  testObject_3[T] = object
+    size: int32
+    value: T
+
+  testObject_4 {.packed.} [T] = object
+    size: int32
+    value: T
+
+echo sizeof(testObject_1)
+echo sizeof(testObject_2)
+echo sizeof(testObject_3[int64])
+echo sizeof(testObject_4[int64])