diff options
Diffstat (limited to 'lisc/test/abi5.ssa')
-rw-r--r-- | lisc/test/abi5.ssa | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lisc/test/abi5.ssa b/lisc/test/abi5.ssa new file mode 100644 index 0000000..1917eb5 --- /dev/null +++ b/lisc/test/abi5.ssa @@ -0,0 +1,24 @@ +# call a C function return a +# large struct in memory + +type :mem = { b 17 } + +function $test() { +@start + %r =:mem call $lower() + %x =w call $puts(l %r) + ret +} + + +# >>> driver +# #include <stdio.h> +# typedef struct { char t[17]; } mem; +# extern mem test(void); +# mem lower() { return (mem){"abcdefghijklmnop"}; } +# int main() { test(); return 0; } +# <<< + +# >>> output +# abcdefghijklmnop +# <<< |