aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-08-15 18:54:11 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:11 +0100
commit372f4b6a4ecca33191159328989dbd16d5fcc527 (patch)
tree047d57eb247c701bacdd48f25dfe50a13f39e749 /tests
parentd720865fb65d67acffb98d45eb7251d0102e2f9b (diff)
downloadtinycc-372f4b6a4ecca33191159328989dbd16d5fcc527.tar.gz
tinycc-372f4b6a4ecca33191159328989dbd16d5fcc527.tar.bz2
Fix enum bitfields passed to stdarg functions
VT_ENUM types use the .ref member and can be VT_BITFIELD, so we need to copy it as well. Simply do it always.
Diffstat (limited to 'tests')
-rw-r--r--tests/tcctest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 8f1fbf4..f8e2040 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -602,11 +602,16 @@ enum test {
E5 = 1000,
};
+struct S_enum {
+ enum {E6 = 42, E7, E8} e:8;
+};
void enum_test()
{
enum test b1;
/* The following should give no warning */
unsigned *p = &b1;
+ struct S_enum s = {E7};
+ printf("enum: %d\n", s.e);
printf("enum:\n%d %d %d %d %d %d\n",
E0, E1, E2, E3, E4, E5);
b1 = 1;