aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/packedstruct1.c
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-10-16 07:37:28 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-10-16 07:37:28 +0000
commit7e378c0215c99d7f8bd38341081ec04fd202fd0a (patch)
tree1a17a6568e1c421c2543d3576c97f9296ca15179 /test/regression/packedstruct1.c
parente8bd77565422ab8e6d2fdd4ec7d5e7e4916ff2bd (diff)
downloadcompcert-kvx-7e378c0215c99d7f8bd38341081ec04fd202fd0a.tar.gz
compcert-kvx-7e378c0215c99d7f8bd38341081ec04fd202fd0a.zip
Revised emulation of packed structs
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1729 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/packedstruct1.c')
-rw-r--r--test/regression/packedstruct1.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/regression/packedstruct1.c b/test/regression/packedstruct1.c
index 1bde780e..cecd1f30 100644
--- a/test/regression/packedstruct1.c
+++ b/test/regression/packedstruct1.c
@@ -50,20 +50,30 @@ struct s3 {
unsigned int z;
signed short v;
signed int w;
+ char * p;
+ unsigned int t[3];
};
struct s3 s3;
void test3(void)
{
+ char xx;
+
printf("sizeof(struct s3) = %d\n", sizeof(struct s3));
s3.x = 123;
s3.y = 45678;
s3.z = 0x80000001U;
s3.v = -456;
s3.w = -1234567;
- printf("s3 = {x = %u, y = %u, z = %u, v = %d, w = %d}\n\n",
- s3.x, s3.y, s3.z, s3.v, s3.w);
+ s3.p = &xx;
+ s3.t[0] = 111;
+ s3.t[1] = 222;
+ s3.t[2] = 333;
+ printf("s3 = {x = %u, y = %u, z = %u, v = %d, w = %d, p is %s, t = {%d,%d,%d}}\n\n",
+ s3.x, s3.y, s3.z, s3.v, s3.w,
+ (s3.p == &xx ? "ok" : "BAD"),
+ s3.t[0], s3.t[1], s3.t[2]);
}
/* Back to normal */