From 3f3dce67f442d637a2f933f7fd5accbcf836b9a2 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 18 Mar 2016 12:00:20 -0400 Subject: tentative support of calls with struct return --- lisc/test/abi5.ssa | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lisc/test/abi5.ssa (limited to 'lisc/test/abi5.ssa') 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 +# typedef struct { char t[17]; } mem; +# extern mem test(void); +# mem lower() { return (mem){"abcdefghijklmnop"}; } +# int main() { test(); return 0; } +# <<< + +# >>> output +# abcdefghijklmnop +# <<< -- cgit 1.4.1