tsizeof4.nim 436 B

123456789101112131415161718192021
  1. discard """
  2. disabled: "arm64"
  3. """
  4. # bug #11792
  5. type
  6. m256d {.importc: "__m256d", header: "immintrin.h".} = object
  7. MyKind = enum
  8. k1, k2, k3
  9. MyTypeObj = object
  10. kind: MyKind
  11. x: int
  12. amount: UncheckedArray[m256d]
  13. # The sizeof(MyTypeObj) is not equal to (sizeof(int) + sizeof(MyKind)) due to
  14. # alignment requirement of m256d, make sure Nim understands that
  15. doAssert(sizeof(MyTypeObj) > sizeof(int) + sizeof(MyKind))