Browse Source

* enabled for non-x86 as well
+ also test with regvars (tw4234a)

git-svn-id: trunk@1461 -

Jonas Maebe 20 years ago
parent
commit
a357bef5e5
3 changed files with 38 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 0 1
      tests/webtbs/tw4234.pp
  3. 37 0
      tests/webtbs/tw4234a.pp

+ 1 - 0
.gitattributes

@@ -6306,6 +6306,7 @@ tests/webtbs/tw4219.pp svneol=native#text/plain
 tests/webtbs/tw4223.pp svneol=native#text/plain
 tests/webtbs/tw4233.pp svneol=native#text/plain
 tests/webtbs/tw4234.pp svneol=native#text/plain
+tests/webtbs/tw4234a.pp svneol=native#text/plain
 tests/webtbs/tw4240.pp svneol=native#text/plain
 tests/webtbs/tw4247.pp svneol=native#text/plain
 tests/webtbs/tw4253.pp svneol=native#text/plain

+ 0 - 1
tests/webtbs/tw4234.pp

@@ -1,4 +1,3 @@
-{ %cpu=i386 }
 { %opt=-O2 }
 
 {$mode objfpc}

+ 37 - 0
tests/webtbs/tw4234a.pp

@@ -0,0 +1,37 @@
+{ %opt=-O2r }
+
+{$mode objfpc}
+
+type
+  TFPColor = record
+    red,green,blue,alpha : word;
+  end;
+  TColorData = qword;
+
+  tcl=class
+    function ColorColorAlpha16 (CD:TColorData) : TFPColor;
+  end;
+
+function tcl.ColorColorAlpha16 (CD:TColorData) : TFPColor;
+var c : qword;
+begin
+with result do
+begin
+red := CD and $FFFF;
+c := qword($FFFF0000);
+green := (CD and c) shr 16;
+c := c shl 16;
+blue := (CD and c) shr 32;
+c := c shl 16;
+alpha := (CD and c) shr 48;
+end;
+end;
+
+var
+  cd  : tcolordata;
+  c : tcl;
+begin
+  cd:=$1234;
+  c:=tcl.create;
+  c.colorcoloralpha16(cd);
+end.