summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-01-12 18:40:02 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-01-12 18:40:02 +0000
commitf9d92a67dd765fad9b980a933887477b3c3e6f40 (patch)
tree23ff722f98299280bc08774d820d0e801a7511d0 /test
parent6a8f9945403c4856ad94b115f6bcc229e79bc492 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/regression/Results/sizeof12
-rw-r--r--test/regression/sizeof1.c12
2 files changed, 7 insertions, 7 deletions
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 {