this may cause some tests to fail. But at least we can still compile
the test program and run the tests... */
-#ifndef __STDC__
+#if !defined(__STDC__) && !defined(__cplusplus)
#define signed /**/
#endif
signed char sc ;
} flags;
+struct internalvartest
+{
+ unsigned int a : 1;
+ struct
+ {
+ unsigned int b : 1;
+ struct
+ {
+ unsigned int c : 1;
+ signed int d : 1;
+ } deep;
+ signed int e : 1;
+ } inner;
+ signed int f : 1;
+} dummy_internalvartest;
+
void break1 ()
{
}
{
}
+struct container
+{
+ struct fields one;
+ struct fields two;
+} container;
+
/* This is used by bitfields.exp to determine if the target understands
signed bitfields. */
int i;
break1 ();
flags.uc = 0;
- flags.s1 = 1;
+ flags.s1 = -1;
break1 ();
flags.s1 = 0;
flags.u3 = 0;
flags.u9 = 0;
- flags.s1 = 0x1;
- flags.s2 = 0x3;
- flags.s3 = 0x7;
- flags.s9 = 0x1FF;
+ flags.s1 = -1;
+ flags.s2 = -1;
+ flags.s3 = -1;
+ flags.s9 = -1;
flags.sc = 0xFF;
break2 ();
flags.s1 = 0;
break4 ();
/* Maximally negative values */
- flags.s1 = 0x1;
- flags.s2 = 0x2;
- flags.s3 = 0x4;
- flags.s9 = 0x100;
+ flags.s1 = -0x1;
+ flags.s2 = -0x2;
+ flags.s3 = -0x4;
+ flags.s9 = -0x100;
/* Extract bitfield value so that bitfield.exp can check if the target
understands signed bitfields. */
i = flags.s9;
break4 ();
/* -1 */
- flags.s1 = 0x1;
- flags.s2 = 0x3;
- flags.s3 = 0x7;
- flags.s9 = 0x1FF;
+ flags.s1 = -1;
+ flags.s2 = -1;
+ flags.s3 = -1;
+ flags.s9 = -1;
break4 ();
flags.s1 = 0;
flags.s3 = 0;
flags.s9 = 0;
+ /* Bitfields at a non-zero offset in a containing structure. */
+ container.one.u3 = 5;
+ container.two.u3 = 3;
+ break5 ();
+
return 0;
}