summaryrefslogtreecommitdiffstats
path: root/tests/017/ffi-misc.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-19 18:21:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-19 18:21:07 -0700
commit79a67942651b7b1f15838fda053d72d17b3f2884 (patch)
treef1d52cae5c304aae37997172a6f5b2206e99250f /tests/017/ffi-misc.tl
parent446853ed69188bb6d3080eb852d07b240ddd0db2 (diff)
downloadtxr-79a67942651b7b1f15838fda053d72d17b3f2884.tar.gz
txr-79a67942651b7b1f15838fda053d72d17b3f2884.tar.bz2
txr-79a67942651b7b1f15838fda053d72d17b3f2884.zip
ffi: bugfix: empty structs/unions have alignment of 1.
* ffi.c (make_ffi_type_struct, make_ffi_type_union): Initialize most_align local variable to 1, so the lower bound of alignment is that, rather than zero. * tests/017/ffi-misc.tl: Tests added.
Diffstat (limited to 'tests/017/ffi-misc.tl')
-rw-r--r--tests/017/ffi-misc.tl4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/017/ffi-misc.tl b/tests/017/ffi-misc.tl
index 68f67b6f..4d7bffab 100644
--- a/tests/017/ffi-misc.tl
+++ b/tests/017/ffi-misc.tl
@@ -109,3 +109,7 @@
(mtest
(ffi-put (new foo x 1 y 1) (ffi foo)) #b'0100000000000100'
(ffi-put (new foo x #xABCDFFFFB00B y #x1234) (ffi foo)) #b'0BB0FFFFCDAB3412'))
+
+(mtest
+ (alignof (struct empty)) 1
+ (alignof (union empty)) 1)