Module Name: src Committed By: rillig Date: Fri Jun 2 11:26:21 UTC 2023
Modified Files: src/tests/usr.bin/indent: opt_bc.c Log Message: tests/indent: demonstrate bugs when formatting preprocessing lines To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/opt_bc.c 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/opt_bc.c diff -u src/tests/usr.bin/indent/opt_bc.c:1.6 src/tests/usr.bin/indent/opt_bc.c:1.7 --- src/tests/usr.bin/indent/opt_bc.c:1.6 Sun Apr 24 09:04:12 2022 +++ src/tests/usr.bin/indent/opt_bc.c Fri Jun 2 11:26:21 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: opt_bc.c,v 1.6 2022/04/24 09:04:12 rillig Exp $ */ +/* $NetBSD: opt_bc.c,v 1.7 2023/06/02 11:26:21 rillig Exp $ */ /* * Tests for the options '-bc' and '-nbc'. @@ -63,3 +63,37 @@ double a, b, c; return a + b + c; } //indent end + + +//indent input +int a, +#if 0 +b, c; int d; +#else +b, c; int d; +#endif +//indent end + +//indent run -bc +int a, +#if 0 + b, + c; +int d; +#else +// $ FIXME: The '#else' branch must be indented like the '#if' branch. + b, c; +int d; +#endif +//indent end + +//indent run -nbc +int a, +// $ FIXME: 'b, c' must not be merged into the preprocessing line. +#if 0 b, c; +int d; +#else + b, c; +int d; +#endif +//indent end