From 2bbfaf436f937ace4809d84be812ea1ac7fd7352 Mon Sep 17 00:00:00 2001 From: James Lyon Date: Thu, 18 Apr 2013 17:27:34 +0100 Subject: Tests in abitest.c now work on Win32. I expect that Linux-x86 is probably fine. All other architectures except ARM are definitely broken since I haven't yet implemented gfunc_sret for these, although replicating the current behaviour should be straightforward. --- arm-gen.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arm-gen.c') diff --git a/arm-gen.c b/arm-gen.c index 3e86d9e..03262aa 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -800,6 +800,19 @@ int assign_fpreg(struct avail_regs *avregs, int align, int size) } #endif +/* Return 1 if this function returns via an sret pointer, 0 otherwise */ +ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *align) { + size = type_size(vt, &align); + if (size > 4) { + return 1; + } else { + *align = 4; + ret->ref = NULL; + ret->t = VT_INT; + } + return 0; +} + /* Generate function call. The function address is pushed first, then all the parameters in call order. This functions pops all the parameters and the function address. */ -- cgit v1.3.1