diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-20 13:13:29 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-12-20 13:13:29 +0000 |
commit | 1c768ee3ff91e826f52cf08e1aaa8c4d637240f5 (patch) | |
tree | 2e3b505567304d8795b06ff9b2485e230214d923 /test/regression/struct8.c | |
parent | 7698300cfe2d3f944ce2e1d4a60a263620487718 (diff) | |
download | compcert-1c768ee3ff91e826f52cf08e1aaa8c4d637240f5.tar.gz compcert-1c768ee3ff91e826f52cf08e1aaa8c4d637240f5.zip |
Hack StructReturn to better adhere to PowerPC and ARM calling conventions.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2382 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/struct8.c')
-rw-r--r-- | test/regression/struct8.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/regression/struct8.c b/test/regression/struct8.c index a100cbe3..00a3f7c3 100644 --- a/test/regression/struct8.c +++ b/test/regression/struct8.c @@ -13,17 +13,34 @@ struct S f(struct S s, int scale) return r; } +struct T { char a, b; }; + +struct T g(struct T s) +{ + struct T r; + r.a = s.b; + r.b = s.a; + return r; +} + int main() { struct S a = { 123, 2.718, 'a' }; struct S b, c, d, e; + struct T x = { 'x', 'y' }; + struct T y, z; b = f(a, 2); c = f(f(a, 2), 3); e = f((d = f(a, 2)), 3); + y = g(x); + z = g(g(x)); printf("a = { %d, %f, '%c' }\n", a.x, a.d, a.c); printf("b = { %d, %f, '%c' }\n", b.x, b.d, b.c); printf("c = { %d, %f, '%c' }\n", c.x, c.d, c.c); printf("d = { %d, %f, '%c' }\n", d.x, d.d, d.c); printf("e = { %d, %f, '%c' }\n", e.x, e.d, e.c); + printf("x = { '%c', '%c' }\n", x.a, x.b); + printf("y = { '%c', '%c' }\n", y.a, y.b); + printf("z = { '%c', '%c' }\n", z.a, z.b); return 0; } |