Module Name:    src
Committed By:   rillig
Date:           Mon May  3 06:24:18 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: gcc_attribute.c gcc_attribute.exp

Log Message:
tests/lint: demonstrate bug in the lexer for GCC attributes


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/gcc_attribute.c \
    src/tests/usr.bin/xlint/lint1/gcc_attribute.exp

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/xlint/lint1/gcc_attribute.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.3 src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.4
--- src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.3	Sat May  1 07:56:20 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_attribute.c	Mon May  3 06:24:18 2021
@@ -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;
+}
Index: src/tests/usr.bin/xlint/lint1/gcc_attribute.exp
diff -u src/tests/usr.bin/xlint/lint1/gcc_attribute.exp:1.3 src/tests/usr.bin/xlint/lint1/gcc_attribute.exp:1.4
--- src/tests/usr.bin/xlint/lint1/gcc_attribute.exp:1.3	Sat May  1 07:56:20 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_attribute.exp	Mon May  3 06:24:18 2021
@@ -1 +1,2 @@
 gcc_attribute.c(39): error: syntax error 'unknown_attribute' [249]
+gcc_attribute.c(51): error: syntax error 'pcs' [249]

Reply via email to