diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-05-15 00:36:45 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-05-15 00:36:45 -0400 |
commit | ca5b305ab25c42fba3d022fd0e4c4288159c451b (patch) | |
tree | 881ef4fcb671d88b7855fee9367ee360796b752d /tnslc/simple.tnsl | |
parent | 52ec72efcd748473c15fad74ff03cd9d88c38ccd (diff) |
Fixed struct returns (struct calls still do not work)
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r-- | tnslc/simple.tnsl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl index ea517d4..5ef7946 100644 --- a/tnslc/simple.tnsl +++ b/tnslc/simple.tnsl @@ -1,15 +1,34 @@ {}uint8 str1 = "abcd" +struct Stress { + int i +} + +struct Test { + Stress s +} + +/; s_call () [Stress] + Stress a + a.i = 1 + return a +;/ + /; main (int argc, ~~uint argv) [int] # On windows, the first two arguments are passed in RCX and RDX, so we need to # update their positions here or else tnsl will have garbage values in r8 and r9 asm "mov r8, rcx" asm "mov r9, rdx" - ~uint8 a = ~str1{0} + Stress test + Test stress + + test.i = 1 + + stress.s = s_call() # return 3 - return a` + return stress.s.i ;/ |