@@ -722,13 +722,12 @@ static const format_char_info print_char_table[] =
{ "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, T2X_D32, T2X_D64, T2X_D128, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "", NULL },
{ "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN, T2X_D32, T2X_D64, T2X_D128, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "", NULL },
/* C2X conversion specifiers. */
- { "b", 0, STD_C2X, { T2X_UI, T2X_UC, T2X_US, T2X_UL, T2X_ULL, TEX_ULL, T2X_ST, T2X_UPD, T2X_UIM, BADLEN, BADLEN, BADLEN, T2X_U8, T2X_U16, T2X_U32, T2X_U64, T2X_UF8, T2X_UF16, T2X_UF32, T2X_UF64 }, "-wp0#", "i", NULL },
+ { "bB", 0, STD_C2X, { T2X_UI, T2X_UC, T2X_US, T2X_UL, T2X_ULL, TEX_ULL, T2X_ST, T2X_UPD, T2X_UIM, BADLEN, BADLEN, BADLEN, T2X_U8, T2X_U16, T2X_U32, T2X_U64, T2X_UF8, T2X_UF16, T2X_UF32, T2X_UF64 }, "-wp0#", "i", NULL },
/* X/Open conversion specifiers. */
{ "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL },
{ "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R", NULL },
/* GNU conversion specifiers. */
{ "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "", NULL },
- { "B", 0, STD_EXT, { T2X_UI, T2X_UC, T2X_US, T2X_UL, T2X_ULL, TEX_ULL, T2X_ST, T2X_UPD, T2X_UIM, BADLEN, BADLEN, BADLEN, T2X_U8, T2X_U16, T2X_U32, T2X_U64, T2X_UF8, T2X_UF16, T2X_UF32, T2X_UF64 }, "-wp0#", "i", NULL },
{ NULL, 0, STD_C89, NOLENGTHS, NULL, NULL, NULL }
};
@@ -28,6 +28,18 @@ foo (unsigned int u, unsigned short us, unsigned char uc, unsigned long ul,
/* Use of 'L' and 'q' for long long is an extension. */
printf ("%Lb", ull); /* { dg-warning "does not support" } */
printf ("%qb", ull); /* { dg-warning "does not support" } */
+ /* Similar tests with %B. */
+ printf ("%B %hB %hhB %lB %llB %jB %zB %tB\n", u, us, uc, ul, ull, uj, z, ut);
+ printf ("%*.*llB\n", 1, 2, ull);
+ printf ("%-B\n", u);
+ printf ("%#B\n", u);
+ printf ("%08B\n", u);
+ printf ("%+B\n", u); /* { dg-warning "flag" } */
+ printf ("% B\n", u); /* { dg-warning "flag" } */
+ printf ("%-08B\n", u); /* { dg-warning "ignored" } */
+ printf ("%08.5B\n", u); /* { dg-warning "ignored" } */
+ printf ("%LB", ull); /* { dg-warning "does not support" } */
+ printf ("%qB", ull); /* { dg-warning "does not support" } */
/* Use of %wN and %wfN with each valid conversion specifier. */
printf ("%w8d %w16d %w32d %w64d %wf8d %wf16d %wf32d %wf64d",
i8, i16, i32, i64, if8, if16, if32, if64);
@@ -35,6 +47,8 @@ foo (unsigned int u, unsigned short us, unsigned char uc, unsigned long ul,
i8, i16, i32, i64, if8, if16, if32, if64);
printf ("%w8b %w16b %w32b %w64b %wf8b %wf16b %wf32b %wf64b",
u8, u16, u32, u64, uf8, uf16, uf32, uf64);
+ printf ("%w8B %w16B %w32B %w64B %wf8B %wf16B %wf32B %wf64B",
+ u8, u16, u32, u64, uf8, uf16, uf32, uf64);
printf ("%w8o %w16o %w32o %w64o %wf8o %wf16o %wf32o %wf64o",
u8, u16, u32, u64, uf8, uf16, uf32, uf64);
printf ("%w8u %w16u %w32u %w64u %wf8u %wf16u %wf32u %wf64u",
@@ -19,19 +19,4 @@ foo (u_quad_t uq, unsigned int u, unsigned short us, unsigned char uc,
printf ("%qb%qB", uq, uq);
printf ("%Lb%LB", ull, ull);
printf ("%Zb%ZB", z, z);
- /* Use of %B in cases valid for %b. */
- printf ("%B %hB %hhB %lB %llB %jB %zB %tB\n", u, us, uc, ul, ull, uj, z, ut);
- printf ("%*.*llB\n", 1, 2, ull);
- printf ("%-B\n", u);
- printf ("%#B\n", u);
- printf ("%08B\n", u);
- /* Flags valid on signed conversions only. */
- printf ("%+B\n", u); /* { dg-warning "flag" } */
- printf ("% B\n", u); /* { dg-warning "flag" } */
- /* Flags ignored in certain combinations. */
- printf ("%-08B\n", u); /* { dg-warning "ignored" } */
- printf ("%08.5B\n", u); /* { dg-warning "ignored" } */
- /* Use of %wN and %wfN with %B. */
- printf ("%w8B %w16B %w32B %w64B %wf8B %wf16B %wf32B %wf64B",
- u8, u16, u32, u64, uf8, uf16, uf32, uf64);
}