From 8591f59e9d6208452a7cd936f43684ff6ad992de Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 15 Feb 2008 23:25:35 +0000 Subject: [PATCH] more testcases I had lying around here [r18873] --- parsetest/anonstruct.c | 30 ++++++++++++++++++++++++++++++ parsetest/shouldfail/anonunion.c | 16 ++++++++++++++++ parsetest/shouldfail/structd.c | 11 +++++++++++ 3 files changed, 57 insertions(+) create mode 100644 parsetest/anonstruct.c create mode 100644 parsetest/shouldfail/anonunion.c create mode 100644 parsetest/shouldfail/structd.c diff --git a/parsetest/anonstruct.c b/parsetest/anonstruct.c new file mode 100644 index 0000000..eb74c46 --- /dev/null +++ b/parsetest/anonstruct.c @@ -0,0 +1,30 @@ +int printf(const char *str, ...); + +typedef struct { + struct { + union { + int a; + double b; + }; + struct { + float c; + int k; + }; + } v; + + int l; +} bla; + +bla bl; + +int main(void) +{ + + bl.v.a = 12; + bl.l = 32; + bl.v.c = 23.4; + + printf("%d\n", (char*)&bl.v.c - (char*)&bl); + + return 0; +} diff --git a/parsetest/shouldfail/anonunion.c b/parsetest/shouldfail/anonunion.c new file mode 100644 index 0000000..7208f29 --- /dev/null +++ b/parsetest/shouldfail/anonunion.c @@ -0,0 +1,16 @@ +typedef struct { + int a; + union { + struct { + double a; + }; + }; + + float b; +} blup; + +int main(void) +{ + blup b; + return 0; +} diff --git a/parsetest/shouldfail/structd.c b/parsetest/shouldfail/structd.c new file mode 100644 index 0000000..5324c04 --- /dev/null +++ b/parsetest/shouldfail/structd.c @@ -0,0 +1,11 @@ +typedef struct { + int a; + char c; + double d; + double a; +} t; + +int main(void) +{ + return 0; +} -- 2.20.1