From ffd6080f9e1e742c73ac38354b31c6fc4e3963ba Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 15 Mar 2011 12:41:45 +0000 Subject: Revised handling of sizeof(string-literal) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1611 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/sizeof1.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/regression/sizeof1.c') diff --git a/test/regression/sizeof1.c b/test/regression/sizeof1.c index e8441a2c..d7d37d35 100644 --- a/test/regression/sizeof1.c +++ b/test/regression/sizeof1.c @@ -1,3 +1,5 @@ +#include + struct s { char c; union { int i[3]; double d; } n; @@ -29,3 +31,13 @@ struct bits2 { char b2[sizeof(struct bits2)]; /* should be 8 */ +int main() +{ + printf("sizeof(struct s) = %d, sizeof(tbl) = %d\n", + sizeof(struct s), sizeof(tbl)); + printf("sizeof(struct bits1) = %d, sizeof(b1) = %d\n", + sizeof(struct bits1), sizeof(b1)); + printf("sizeof(struct bits2) = %d, sizeof(b2) = %d\n", + sizeof(struct bits2), sizeof(b2)); + return 0; +} -- cgit