Module Name: src Committed By: rillig Date: Fri Oct 8 23:04:02 UTC 2021
Modified Files: src/tests/usr.bin/indent: token-colon.0 token-colon.0.stdout Log Message: tests/indent: test formatting of the token ':' To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/token-colon.0 \ src/tests/usr.bin/indent/token-colon.0.stdout Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/indent/token-colon.0 diff -u src/tests/usr.bin/indent/token-colon.0:1.1 src/tests/usr.bin/indent/token-colon.0:1.2 --- src/tests/usr.bin/indent/token-colon.0:1.1 Fri Mar 12 00:13:06 2021 +++ src/tests/usr.bin/indent/token-colon.0 Fri Oct 8 23:04:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: token-colon.0,v 1.1 2021/03/12 00:13:06 rillig Exp $ */ +/* $NetBSD: token-colon.0,v 1.2 2021/10/08 23:04:02 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -14,4 +14,21 @@ * In the declaration of a struct member that is a bit-field. */ -/* TODO: Add some code to be formatted. */ +void endless(void) +{ +label1: +goto label2; + + if (true)if (true)if (true)if (true)label2 :goto label1; +} + +int constant_expression = true?4:12345; + +struct bit_field { +bool flag:1; +int maybe_signed : 4; +signed int definitely_signed:3; +signed int : 0;/* finish the storage unit for the bit-field */ +unsigned int definitely_unsigned:3; +unsigned int:0;/* finish the storage unit for the bit-field */ +}; Index: src/tests/usr.bin/indent/token-colon.0.stdout diff -u src/tests/usr.bin/indent/token-colon.0.stdout:1.1 src/tests/usr.bin/indent/token-colon.0.stdout:1.2 --- src/tests/usr.bin/indent/token-colon.0.stdout:1.1 Fri Mar 12 00:13:06 2021 +++ src/tests/usr.bin/indent/token-colon.0.stdout Fri Oct 8 23:04:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: token-colon.0.stdout,v 1.1 2021/03/12 00:13:06 rillig Exp $ */ +/* $NetBSD: token-colon.0.stdout,v 1.2 2021/10/08 23:04:02 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -14,4 +14,28 @@ * In the declaration of a struct member that is a bit-field. */ -/* TODO: Add some code to be formatted. */ +void +endless(void) +{ +label1: + goto label2; + + if (true) + if (true) + if (true) + if (true) + label2: goto label1; +} + +int constant_expression = true ? 4 : 12345; + +struct bit_field { + bool flag:1; + int maybe_signed:4; + signed int definitely_signed:3; +/* $ XXX: Placing the colon directly at the type looks inconsistent. */ + signed int: 0; /* finish the storage unit for the bit-field */ + unsigned int definitely_unsigned:3; +/* $ XXX: Placing the colon directly at the type looks inconsistent. */ + unsigned int: 0; /* finish the storage unit for the bit-field */ +};