diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-18 12:00:20 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-18 15:14:55 -0400 |
commit | 3f3dce67f442d637a2f933f7fd5accbcf836b9a2 (patch) | |
tree | 101e33ed72094746161b798eb5e6532a12e66289 /lisc/test/abi5.ssa | |
parent | a93af73ff296cb740d750e0101198ce748d29cfd (diff) | |
download | roux-3f3dce67f442d637a2f933f7fd5accbcf836b9a2.tar.gz |
tentative support of calls with struct return
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 +# <<< |