+2004-11-05 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * gcc.dg/compat/struct-layout-1_generate.c (main): Generate a
+ call to fflush(stdout) before abort.
+ (my_ffsll): New function.
+ (generate_fields): Use it.
+
2004-11-05 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/init-undef-1.c: New test.
#include \"t%03d_test.h\"\n\
#undef TX\n\
if (fails)\n\
- abort ();\n\
+ {\n\
+ fflush (stdout);\n\
+ abort ();\n\
+ }\n\
exit (0);\n\
}\n", srcdir, srcdir, filecnt, filecnt);
fclose (outfile);
abort ();
}
+/* This is from gcc.c-torture/execute/builtin-bitops-1.c. */
+static int
+my_ffsll (unsigned long long x)
+{
+ int i;
+ if (x == 0)
+ return 0;
+ /* We've tested LLONG_MAX for 64 bits so this should be safe. */
+ for (i = 0; i < 64; i++)
+ if (x & (1ULL << i))
+ break;
+ return i + 1;
+}
+
void
generate_fields (enum FEATURE features, struct entry *e, struct entry *parent,
int len)
case 'B': ma = 1; break;
case ' ':
if (e[j].type->type == TYPE_UENUM)
- mi = ffsll (e[j].type->maxval + 1) - 1;
+ mi = my_ffsll (e[j].type->maxval + 1) - 1;
else if (e[j].type->type == TYPE_SENUM)
- mi = ffsll (e[j].type->maxval + 1);
+ mi = my_ffsll (e[j].type->maxval + 1);
else
abort ();
if (!mi)