diff --git a/.gitattributes b/.gitattributes index 2ba4f5bce4..30ca228894 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5559,6 +5559,7 @@ tests/test/cg/tnot.pp svneol=native#text/plain tests/test/cg/tobjsiz2.pp svneol=native#text/plain tests/test/cg/tobjsize.pp svneol=native#text/plain tests/test/cg/tpara1.pp svneol=native#text/plain +tests/test/cg/tpara2.pp svneol=native#text/plain tests/test/cg/tprintf.pp svneol=native#text/plain tests/test/cg/traise1.pp svneol=native#text/plain tests/test/cg/traise2.pp svneol=native#text/plain diff --git a/compiler/cgbase.pas b/compiler/cgbase.pas index 63e8e4b3a5..01fe26633e 100644 --- a/compiler/cgbase.pas +++ b/compiler/cgbase.pas @@ -562,7 +562,7 @@ implementation function int_cgsize(const a: aint): tcgsize;{$ifdef USEINLINE}inline;{$endif} const size2cgsize : array[0..8] of tcgsize = ( - OS_NO,OS_8,OS_16,OS_32,OS_32,OS_64,OS_64,OS_64,OS_64 + OS_NO,OS_8,OS_16,OS_NO,OS_32,OS_NO,OS_NO,OS_NO,OS_64 ); begin if a>8 then diff --git a/tests/test/cg/tpara2.pp b/tests/test/cg/tpara2.pp new file mode 100644 index 0000000000..7f9c54066f --- /dev/null +++ b/tests/test/cg/tpara2.pp @@ -0,0 +1,49 @@ +type + sint16 = smallint; + uint16 = word; + + Point = record + case SInt16 of + 0: ( + v: SInt16; + h: SInt16; + ); + 1: ( + vh: array [0..1] of SInt16; + ); + end; + + Rect = record + case SInt16 of + 0: ( + top: SInt16; + left: SInt16; + bottom: SInt16; + right: SInt16; + ); + 1: ( + topLeft: Point; + botRight: Point; + ); + end; + + RGBColor = record + red: UInt16; + { magnitude of red component } + green: UInt16; + { magnitude of green component } + blue: UInt16; + { magnitude of blue component } + end; + +function test(r: Rect; c1, c2: RGBColor): Rect; +begin + test:= r; +end; + +var + r: rect; + c1,c2: rgbcolor; +begin + test(r,c1,c2); +end.