summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw38766.pp
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-19 20:52:12 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-19 20:52:12 +0000
commitd2e345b7a3c3badb5c57fb8ea6c5953381ab1284 (patch)
treeedc6fc6bdac236f97892ecac1221d2f54deff205 /tests/webtbs/tw38766.pp
parentd7c24a635b8ec7dad69c558a863cf37033f52614 (diff)
downloadfpc-d2e345b7a3c3badb5c57fb8ea6c5953381ab1284.tar.gz
* AArch64: fix storing a 32 bit value in the lower 32 bits of a 64 bit
subsetreg (mantis #38766) git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49236 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'tests/webtbs/tw38766.pp')
-rw-r--r--tests/webtbs/tw38766.pp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/webtbs/tw38766.pp b/tests/webtbs/tw38766.pp
new file mode 100644
index 0000000000..7393d00f91
--- /dev/null
+++ b/tests/webtbs/tw38766.pp
@@ -0,0 +1,28 @@
+{$mode objfpc}
+
+type
+ trec = record
+ x, y: longint;
+ end;
+
+function max(x,y: longint): longint;
+begin
+ if x>y then
+ result:=x
+ else
+ result:=y;
+end;
+
+function test: trec; inline;
+begin
+ result.x:=1;
+ result.y:=2;
+ result.x:=max(result.x,result.y);
+end;
+
+begin
+ if test.x<>2 then
+ halt(1);
+ if test.y<>2 then
+ halt(2);
+end.