From 0691b7630b89bf3de5f7691802cb923bd7c1fd99 Mon Sep 17 00:00:00 2001 From: Vlad Vissoultchev Date: Mon, 4 Apr 2016 15:30:26 +0300 Subject: tccgen.c: Allow type attributes to prefix enum/struct/union name From gcc docs: "You may also specify attributes between the enum, struct or union tag and the name of the type rather than after the closing brace." Adds `82_attribs_position.c` in `tests/tests2` --- tests/tests2/82_attribs_position.c | 14 ++++++++++++++ tests/tests2/82_attribs_position.expect | 0 2 files changed, 14 insertions(+) create mode 100644 tests/tests2/82_attribs_position.c create mode 100644 tests/tests2/82_attribs_position.expect (limited to 'tests') diff --git a/tests/tests2/82_attribs_position.c b/tests/tests2/82_attribs_position.c new file mode 100644 index 0000000..45039b3 --- /dev/null +++ b/tests/tests2/82_attribs_position.c @@ -0,0 +1,14 @@ +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; + +typedef union Unaligned16a { + uint16_t u; + uint8_t b[2]; +} __attribute__((packed)) Unaligned16a; + +typedef union __attribute__((packed)) Unaligned16b { + uint16_t u; + uint8_t b[2]; +} Unaligned16b; + +int main () { return 0; } diff --git a/tests/tests2/82_attribs_position.expect b/tests/tests2/82_attribs_position.expect new file mode 100644 index 0000000..e69de29 -- cgit v1.3.1