summary refs log tree commit diff stats
path: root/tests/misc/tsizeof4.nim
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2020-01-16 05:21:12 -0800
committerAndreas Rumpf <rumpf_a@web.de>2020-01-16 14:21:12 +0100
commitd245d4cf09e190ef0d64153437467713c5445c47 (patch)
treeff489019df0fd828e22e01e45436627567149359 /tests/misc/tsizeof4.nim
parent1b54be77799bd89de7b82746324833291a5f9d0c (diff)
downloadNim-d245d4cf09e190ef0d64153437467713c5445c47.tar.gz
fix tsizeof3 for aarch64 (#13169)
Diffstat (limited to 'tests/misc/tsizeof4.nim')
-rw-r--r--tests/misc/tsizeof4.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/misc/tsizeof4.nim b/tests/misc/tsizeof4.nim
new file mode 100644
index 000000000..94c08ba39
--- /dev/null
+++ b/tests/misc/tsizeof4.nim
@@ -0,0 +1,20 @@
+discard """
+disabled: "arm64"
+"""
+
+# bug #11792
+type
+  m256d {.importc: "__m256d", header: "immintrin.h".} = object
+
+  MyKind = enum
+    k1, k2, k3
+
+  MyTypeObj = object
+    kind: MyKind
+    x: int
+    amount: UncheckedArray[m256d]
+
+
+# The sizeof(MyTypeObj) is not equal to (sizeof(int) + sizeof(MyKind)) due to
+# alignment requirement of m256d, make sure Nim understands that
+doAssert(sizeof(MyTypeObj) > sizeof(int) + sizeof(MyKind))