From 268a53de823a6750d6256ee1fb1e7707b4b45740 Mon Sep 17 00:00:00 2001 From: Xavier ASUS Date: Fri, 18 Oct 2019 00:31:54 +0200 Subject: sdcc-3.9.0 fork implementing GNU assembler syntax This fork aims to provide better support for stm8-binutils --- support/valdiag/tests/struct.c | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 support/valdiag/tests/struct.c (limited to 'support/valdiag/tests/struct.c') diff --git a/support/valdiag/tests/struct.c b/support/valdiag/tests/struct.c new file mode 100644 index 0000000..c7f4938 --- /dev/null +++ b/support/valdiag/tests/struct.c @@ -0,0 +1,115 @@ + +#ifdef TEST1 +struct tag { + int good1; + register int bad; /* ERROR */ + int good2; +} badstruct; /* IGNORE */ +#endif + +#ifdef TEST2 +struct tag { + int good1; + int bad; /* IGNORE */ + int bad; /* ERROR */ + int good2; +} badstruct; +#endif + +#ifdef TEST3a +struct tag { + int good1; + int bad:255; /* ERROR */ + int good2; +} badstruct; +#endif + +#ifdef TEST3b +struct tag { + int good1; + float badtype1 : 5; /* ERROR */ + int good2; + _Bool badwidth2 : 2; /* ERROR */ + int good3; + int badwidth2 : 17; /* ERROR */ + int good4; +} badstruct; +#endif + +#ifdef TEST4 +struct tag { + int good1; + int good2; +} goodstruct1; + +struct tag goodstruct2; +#endif + +#ifdef TEST5a +struct tag { + int good1; + int good2; +} goodstruct1; + +union tag badunion; /* ERROR */ +#endif + +#ifdef TEST5b +union tag { + int good1; + int good2; +} goodunion1; + +struct tag badstruct; /* ERROR */ +#endif + + +#ifdef TEST6 +struct linklist { + struct linklist *prev; + struct linklist *next; + int x; +} ll; +#endif + +#ifdef TEST7a +union tag { + struct tag *next; /* ERROR */ + int x; +} ll; +#endif + +#ifdef TEST7b +struct tag { + union tag *next; /* ERROR */ + int x; +} ll; +#endif + +#ifdef TEST8a +struct tag { + int a; /* IGNORE */ + struct { + int a; /* ERROR(SDCC) */ /* IGNORE(GCC) */ + int b; + }; +} ll; +#endif + +#ifdef TEST8b +struct tag { + int a; + struct { + int b; + int c; + }; +} ll; + +void test(void) +{ + ll.a = 1; + ll.b = 2; + ll.c = 3; +} + +#endif -- cgit v1.2.3