gcc_bit_field_types.c revision 1.1
1/*	$NetBSD: gcc_bit_field_types.c,v 1.1 2021/05/02 21:22:09 rillig Exp $	*/
2# 3 "gcc_bit_field_types.c"
3
4/*
5 * https://gcc.gnu.org/onlinedocs/gcc/Structures-unions-enumerations-and-bit-fields-implementation.html
6 *
7 * "Other integer types, such as long int, and enumerated types are permitted
8 * even in strictly conforming mode."
9 *
10 * See msg_035.c.
11 */
12
13// Test for message: illegal bit-field type '%s' [35]
14
15/* Omit -g, see gcc_bit_field_types.c. */
16/* lint1-flags: -Sw */
17
18/* Try all types from tspec_t. */
19struct example {
20	int int_flag: 1;
21	unsigned int unsigned_int_flag: 1;
22	long long_flag: 1;	/* expect: 35 *//*FIXME*/
23	unsigned long unsigned_long_flag: 1;	/* expect: 35 *//*FIXME*/
24	long long long_long_flag: 1;	/* expect: 35 *//*FIXME*/
25	unsigned long long unsigned_long_long_flag: 1;	/* expect: 35 *//*FIXME*/
26	double double_flag: 1;	/* expect: 35 */
27};
28