Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: demonstrate bug in the...
details: https://anonhg.NetBSD.org/src/rev/390620b9aabb
branches: trunk
changeset: 378995:390620b9aabb
user: rillig <rillig%NetBSD.org@localhost>
date: Mon May 03 06:24:18 2021 +0000
description:
tests/lint: demonstrate bug in the lexer for GCC attributes
diffstat:
tests/usr.bin/xlint/lint1/gcc_attribute.c | 15 ++++++++++++++-
tests/usr.bin/xlint/lint1/gcc_attribute.exp | 1 +
2 files changed, 15 insertions(+), 1 deletions(-)
diffs (32 lines):
diff -r 85b0f284eae6 -r 390620b9aabb tests/usr.bin/xlint/lint1/gcc_attribute.c
--- a/tests/usr.bin/xlint/lint1/gcc_attribute.c Mon May 03 05:24:44 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/gcc_attribute.c Mon May 03 06:24:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_attribute.c,v 1.3 2021/05/01 07:56:20 rillig Exp $ */
+/* $NetBSD: gcc_attribute.c,v 1.4 2021/05/03 06:24:18 rillig Exp $ */
# 3 "gcc_attribute.c"
/*
@@ -38,3 +38,16 @@ function_nonnull_list(void *, const void
/* expect+1: syntax error 'unknown_attribute' */
void __attribute__((unknown_attribute))
function_with_unknown_attribute(void);
+
+/*
+ * There is an attribute called 'pcs', but that attribute must not prevent an
+ * ordinary variable from being named the same.
+ *
+ * Seen in yds.c, function yds_allocate_slots.
+ */
+void
+local_variable_pcs(void)
+{
+ int pcs = 3; /* expect: syntax error 'pcs' *//*FIXME*/
+ return pcs;
+}
diff -r 85b0f284eae6 -r 390620b9aabb tests/usr.bin/xlint/lint1/gcc_attribute.exp
--- a/tests/usr.bin/xlint/lint1/gcc_attribute.exp Mon May 03 05:24:44 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/gcc_attribute.exp Mon May 03 06:24:18 2021 +0000
@@ -1,1 +1,2 @@
gcc_attribute.c(39): error: syntax error 'unknown_attribute' [249]
+gcc_attribute.c(51): error: syntax error 'pcs' [249]
Home |
Main Index |
Thread Index |
Old Index