diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-08-18 09:06:55 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-08-18 09:06:55 +0000 |
commit | a15858a0a8fcea82db02fe8c9bd2ed912210419f (patch) | |
tree | 5c0c19439f0d0f9e8873ce0dad2034cb9cafc4ba /test/regression/struct7.c | |
parent | adedca3a1ff17ff8ac66eb2bcd533a50df0927a0 (diff) | |
download | compcert-a15858a0a8fcea82db02fe8c9bd2ed912210419f.tar.gz compcert-a15858a0a8fcea82db02fe8c9bd2ed912210419f.zip |
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/struct7.c')
-rw-r--r-- | test/regression/struct7.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/regression/struct7.c b/test/regression/struct7.c index 136602bf..fe3ef827 100644 --- a/test/regression/struct7.c +++ b/test/regression/struct7.c @@ -29,8 +29,8 @@ union u2 D; int main() { - struct small A2; - struct big B2; + struct small A1, A2, AA[1]; + struct big B1, B2; union u1 C2; union u2 D2; int i; @@ -42,10 +42,18 @@ int main() printf("A2 = { %d, %f, { '%c', ... , '%c' } }\n", A2.x, A2.d, A2.c[0], A2.c[4]); + A2 = (A1 = A); + printf("A2 = { %d, %f, { '%c', ... , '%c' } }\n", + A2.x, A2.d, A2.c[0], A2.c[4]); + B2 = B; printf("B2 = { %d, ..., %d, ..., %d }\n", B2.x[0], B2.x[4], B2.x[99]); + B2 = (B1 = B); + printf("B2 = { %d, ..., %d, ..., %d }\n", + B2.x[0], B2.x[4], B2.x[99]); + C2 = C; printf("C2.c = '%c'\n", C2.c); @@ -53,6 +61,14 @@ int main() printf("D2.v = { %d, ..., %d, ..., %d }\n", D2.v.x[0], D2.v.x[4], D2.v.x[99]); + AA[0] = A; + A1.x = 0; + A2.x = 0; + AA[A1.x] = AA[A2.x]; + + printf("AA[0] = { %d, %f, { '%c', ... , '%c' } }\n", + AA[0].x, AA[0].d, AA[0].c[0], AA[0].c[4]); + return 0; } |