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: test '*' in function decl...
details: https://anonhg.NetBSD.org/src/rev/5e2773bb9ce9
branches: trunk
changeset: 1026452:5e2773bb9ce9
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Nov 25 16:05:07 2021 +0000
description:
tests/indent: test '*' in function declarations
diffstat:
tests/usr.bin/indent/fmt_decl.c | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diffs (56 lines):
diff -r da364d72f4ff -r 5e2773bb9ce9 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c Thu Nov 25 14:17:22 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c Thu Nov 25 16:05:07 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_decl.c,v 1.24 2021/11/25 08:03:08 rillig Exp $ */
+/* $NetBSD: fmt_decl.c,v 1.25 2021/11/25 16:05:07 rillig Exp $ */
/* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
/*
@@ -188,6 +188,25 @@
#indent run-equals-input
+/*
+ * Ensure that the usual GCC-style function attributes are formatted in a
+ * sensible way.
+ */
+#indent input
+void function(const char *, ...) __attribute__((format(printf, 1, 2)));
+#indent end
+
+/* FIXME: missing space before '__attribute__' */
+#indent run -di0
+void function(const char *, ...)__attribute__((format(printf, 1, 2)));
+#indent end
+
+/* FIXME: missing space before '__attribute__' */
+#indent run
+void function(const char *, ...)__attribute__((format(printf, 1, 2)));
+#indent end
+
+
#indent input
static
_attribute_printf(1, 2)
@@ -757,3 +776,20 @@
return GNode_ValueDirect(gn, TARGET);
}
#indent end
+
+
+/*
+ * Ensure that '*' in declarations is interpreted (or at least formatted) as
+ * a 'pointer to' type derivation, not as a binary or unary operator.
+ */
+#indent input
+number *var = a * b;
+
+void
+function(void)
+{
+ number *var = a * b;
+}
+#indent end
+
+#indent run-equals-input -di0
Home |
Main Index |
Thread Index |
Old Index