summaryrefslogtreecommitdiff
path: root/test/regression/struct8.c
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-08-18 09:06:55 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-08-18 09:06:55 +0000
commita15858a0a8fcea82db02fe8c9bd2ed912210419f (patch)
tree5c0c19439f0d0f9e8873ce0dad2034cb9cafc4ba /test/regression/struct8.c
parentadedca3a1ff17ff8ac66eb2bcd533a50df0927a0 (diff)
Merge of branches/full-expr-4:
- Csyntax, Csem: source C language has side-effects within expressions, performs implicit casts, and has nondeterministic reduction semantics for expressions - Cstrategy: deterministic red. sem. for the above - Clight: the previous source C language, with pure expressions. Added: temporary variables + implicit casts. - New pass SimplExpr to pull side-effects out of expressions (previously done in untrusted Caml code in cparser/) - Csharpminor: added temporary variables to match Clight. - Cminorgen: adapted, removed cast optimization (moved to back-end) - CastOptim: RTL-level optimization of casts - cparser: transformations Bitfields, StructByValue and StructAssign now work on non-simplified expressions - Added pretty-printers for several intermediate languages, and matching -dxxx command-line flags. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1467 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/struct8.c')
-rw-r--r--test/regression/struct8.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/regression/struct8.c b/test/regression/struct8.c
index 989c352..a100cbe 100644
--- a/test/regression/struct8.c
+++ b/test/regression/struct8.c
@@ -16,8 +16,14 @@ struct S f(struct S s, int scale)
int main()
{
struct S a = { 123, 2.718, 'a' };
- struct S b = f(a, 2);
+ struct S b, c, d, e;
+ b = f(a, 2);
+ c = f(f(a, 2), 3);
+ e = f((d = f(a, 2)), 3);
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);
return 0;
}