- removed test that shortstring is aligned to a multiple of pointer size,

as the compiler does not guarantee any such thing

git-svn-id: trunk@42053 -
This commit is contained in:
Jonas Maebe 2019-05-12 21:08:42 +00:00
parent 0227c55b53
commit 883d1f2a79

View File

@ -3,9 +3,6 @@
{ This verifies if the strings are { This verifies if the strings are
correctly aligned, normally the generated assembler correctly aligned, normally the generated assembler
should be verified manually. should be verified manually.
I consider this test as flawed, or is there a reason, why a
shortstring should be aligned to pointer boundaries? (FK)
} }
program talign2; program talign2;
@ -78,16 +75,12 @@ const
{$ifdef haswidestring} {$ifdef haswidestring}
widestr : widestring = 'simple widestring'; widestr : widestring = 'simple widestring';
{$endif} {$endif}
shortstr :shortstring = 'simple shortstring';
begin begin
test(length(ansistr)=17); test(length(ansistr)=17);
{$ifdef haswidestring} {$ifdef haswidestring}
test(length(widestr)=17); test(length(widestr)=17);
{$endif} {$endif}
test(length(shortstr)=18);
{ verify if the address are correctly aligned! } { verify if the address are correctly aligned! }
pt:=@shortstr;
test((ptruint(pt) mod pointer_alignment)=0);
pt:=p; pt:=p;
test((ptruint(pt) mod pointer_alignment)=0); test((ptruint(pt) mod pointer_alignment)=0);
pt:=pchar(ansistr); pt:=pchar(ansistr);