aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-10-02 21:37:58 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:49:56 +0100
commitddecb0e68517dd7ffb6e594561580ad32377dfef (patch)
tree9f30944376edc5d5fa29fb5e7ddbfeeefbb5b07e /tests
parent5d6a9e797a3c2d12ed54edb14851f4b023de4799 (diff)
downloadtinycc-ddecb0e68517dd7ffb6e594561580ad32377dfef.tar.gz
tinycc-ddecb0e68517dd7ffb6e594561580ad32377dfef.tar.bz2
Split off record layouting
Such struct decl: struct S { char a; int i;} __attribute__((packed)); should be accepted and cause S to be five bytes long (i.e. the packed attribute should matter). So we can't layout the members during parsing already. Split off the offset and alignment calculation for this.
Diffstat (limited to 'tests')
-rw-r--r--tests/tcctest.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 2249cb4..d1b7cb0 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -3539,7 +3539,6 @@ typedef struct __attribute__((__packed__)) {
int c;
} Spacked2;
Spacked2 spacked2;
-#ifdef BROKEN
/* This doesn't work for now. Requires adjusting field offsets/sizes
after parsing the struct members. */
typedef struct Spacked3_s {
@@ -3548,14 +3547,11 @@ typedef struct Spacked3_s {
int c;
} __attribute__((__packed__)) Spacked3;
Spacked3 spacked3;
-#endif
void attrib_test(void)
{
printf("attr: %d %d %d %d\n", sizeof(struct Spacked),
sizeof(spacked), sizeof(Spacked2), sizeof(spacked2));
-#ifdef BROKEN
printf("attr: %d %d\n", sizeof(Spacked3), sizeof(spacked3));
-#endif
}
extern __attribute__((__unused__)) char * __attribute__((__unused__)) *
strange_attrib_placement (void);