Add check that double and long long (both 64 bit) have same alignment.

This commit is contained in:
David Brown 2016-09-21 11:56:21 +01:00
parent 0ea077814f
commit 20a97bb570
2 changed files with 84 additions and 81 deletions

View file

@ -1,6 +1,8 @@
(* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) (* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *)
MODULE oocLowLReal; MODULE oocLowLReal;
(* ToDo. support 64 bit builds *)
(* (*
LowLReal - Gives access to the underlying properties of the type LONGREAL LowLReal - Gives access to the underlying properties of the type LONGREAL
for IEEE double-precision numbers. for IEEE double-precision numbers.

View file

@ -351,6 +351,7 @@ void testSystemDotH() {
assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT.");
assert(((char*)&p.x - (char*)&p) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&p.x - (char*)&p) == addressSize, "Alignment of data pointer differs from address size.");
assert(((char*)&f.x - (char*)&f) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&f.x - (char*)&f) == addressSize, "Alignment of data pointer differs from address size.");
assert(((char*)&lr.x - (char*)&lr) == ((char*)&ll.x - (char*)&ll), "Alignment of LONGREAL differs from alignment of long long.");
assert(sizeof(rec0) == 1, "CHAR wrapped in record aligns differently to CHAR alone."); assert(sizeof(rec0) == 1, "CHAR wrapped in record aligns differently to CHAR alone.");
assert(sizeof(rec2) == 65, "CHAR array wrapped in record aligns differently to CHAR array alone."); assert(sizeof(rec2) == 65, "CHAR array wrapped in record aligns differently to CHAR array alone.");