compiler

Unnamed Compiled Systems Language Project
git clone http://frotz.net/git/compiler.git
Log | Files | Refs

commit 742ee50f187bff7a6bb2a9f4d523b2cf7c74b08a
parent b599b7c2304975ae3ec862acc0758c373dce88b5
Author: Brian Swetland <swetland@frotz.net>
Date:   Tue, 25 May 2021 19:08:59 -0700

test: add to the structs test

Diffstat:
Mtest/1040-structs.log | 2++
Mtest/1040-structs.src | 9+++++++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/test/1040-structs.log b/test/1040-structs.log @@ -4,6 +4,8 @@ D 0000007b D 000001c8 D 00000080 D 000001cb +D 000000fb +D 00000393 D 10203040 D 50607080 D 00000007 diff --git a/test/1040-structs.src b/test/1040-structs.src @@ -14,6 +14,13 @@ func add(a *Point, b *Point) { a.y = a.y + b.y; } +type PointPtr *Point; + +func add2(a PointPtr, b PointPtr) { + a.x = a.x + b.x; + a.y = a.y + b.y; +} + func print(p *Point) { _hexout_(p.x); _hexout_(p.y); @@ -33,6 +40,8 @@ func start() i32 { _hexout_(p0.y); add(&p1, &p0); print(&p1); + add2(&p1, &p0); + print(&p1); var z Point; z.x = 0x10203040; z.y = 0x50607080;