Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/indent tests/indent: demonstrate another bug i...



details:   https://anonhg.NetBSD.org/src/rev/eb042d3b99f8
branches:  trunk
changeset: 1026316:eb042d3b99f8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Nov 18 22:27:01 2021 +0000

description:
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

diffstat:

 tests/usr.bin/indent/fmt_decl.c |  32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 977e0f0a6b07 -r eb042d3b99f8 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Thu Nov 18 21:19:18 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Thu Nov 18 22:27:01 2021 +0000
@@ -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;
 }
 #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



Home | Main Index | Thread Index | Old Index