Module Name: src Committed By: rillig Date: Thu Nov 18 22:27:01 UTC 2021
Modified Files: src/tests/usr.bin/indent: fmt_decl.c Log Message: tests/indent: demonstrate another bug imported from FreeBSD Side note: the newly added test crashes at least the following versions of indent with a segmentation fault on x86_64: 2000.10.11.14.46.04 2000.10.14.18.07.10 2000.10.17.02.16.44 2000.10.19.14.48.53 2000.10.19.16.31.26 2001.03.16.06.23.20 2001.03.23.20.12.41 2001.06.16.21.47.42 2001.07.20.13.43.50 2001.08.20.12.00.55 2001.12.01.19.27.33 2002.05.26.22.53.38 2003.02.25.10.35.44 To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/indent/fmt_decl.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/fmt_decl.c diff -u src/tests/usr.bin/indent/fmt_decl.c:1.13 src/tests/usr.bin/indent/fmt_decl.c:1.14 --- src/tests/usr.bin/indent/fmt_decl.c:1.13 Sun Nov 7 07:45:00 2021 +++ src/tests/usr.bin/indent/fmt_decl.c Thu Nov 18 22:27:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fmt_decl.c,v 1.13 2021/11/07 07:45:00 rillig Exp $ */ +/* $NetBSD: fmt_decl.c,v 1.14 2021/11/18 22:27:01 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */ /* See FreeBSD r303570 */ @@ -451,3 +451,33 @@ int a - 1; int a - 1; } #indent end + + +/* + * Since 2019-04-04, the indentation of the '*' depends on the function name, + * which does not make sense. + */ +#indent input +int * +f2(void) +{ +} + +int * +yy(void) +{ +} +#indent end + +/* FIXME: Both function definitions must be formatted in the same way. */ +#indent run +int * +f2(void) +{ +} + +int * +yy(void) +{ +} +#indent end