summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw16163.pp
blob: 155a614a6b575d987c167708397d8adf99b6de1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ %norun }

program test;

{$mode objfpc}

type
  TFColor = record
    b, g, r : Byte;
    // m : Byte; // uncomment it to avoid InternalError 200301231
  end;

  TFColorA = record
    c : TFColor;
    a : Byte;
    // adding some field here, or chaning a type to Word or Interger
    // also fixed the problem. 
  end;

function FColorToFColorA(C : TFColor) : TFColorA;
begin
  Result.c:=C;
  Result.a:=255;
end;

var
  t : TFColor;
  a : TFColor;
begin
  FillChar(a, sizeof(a), $55);
  t:=FColorToFColorA(a).c; // IE 200301231 why?
  if (t.b<>$55) or
     (t.r<>$55) or
     (t.g<>$55) then
    halt(1);
end.