From f9d92a67dd765fad9b980a933887477b3c3e6f40 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 12 Jan 2014 18:40:02 +0000 Subject: Interp.ml: in the emulation of printf(), check formats against types of arguments. Test sizeof1: adapt to the fact that alignof(double) is either 4 or 8 depending on platform. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2406 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/Results/sizeof1 | 2 +- test/regression/sizeof1.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/regression') diff --git a/test/regression/Results/sizeof1 b/test/regression/Results/sizeof1 index 674f6da..a952be5 100644 --- a/test/regression/Results/sizeof1 +++ b/test/regression/Results/sizeof1 @@ -1,3 +1,3 @@ -sizeof(struct s) = 32, sizeof(tbl) = 32 +sizeof(struct s) = 20, sizeof(tbl) = 20 sizeof(struct bits1) = 1, sizeof(b1) = 1 sizeof(struct bits2) = 8, sizeof(b2) = 8 diff --git a/test/regression/sizeof1.c b/test/regression/sizeof1.c index d7d37d3..139b1bc 100644 --- a/test/regression/sizeof1.c +++ b/test/regression/sizeof1.c @@ -2,18 +2,18 @@ struct s { char c; - union { int i[3]; double d; } n; + union { short i[3]; int d; } n; struct { struct s * hd; struct s * tl; } l; }; char tbl[sizeof(struct s)]; /* Should be 32: char c at 0 - union n at 8 because alignment = 8; sizeof = 12 - struct l at 8+12=20 with alignment = 4; sizeof = 8 - end of struct at 20+8=28 - alignment of whole struct is 8 because of d - 28 aligned to 8 -> 32 + union n at 4 because alignment = 4; sizeof = 8 + struct l at 4+8=12 with alignment = 4; sizeof = 8 + end of struct at 12+8=20 + alignment of whole struct is 4 + 20 aligned to 4 -> 20 */ struct bits1 { -- cgit v1.2.3