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/lint2 tests/lint: test old-style functio...



details:   https://anonhg.NetBSD.org/src/rev/01ef283f9cf7
branches:  trunk
changeset: 1023366:01ef283f9cf7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 04 18:34:17 2021 +0000

description:
tests/lint: test old-style functions in a lint library

To really qualify as old-style, a function must not declare a return
type in its definition.

diffstat:

 tests/usr.bin/xlint/lint2/emit.exp-ln |  5 ++++-
 tests/usr.bin/xlint/lint2/emit.ln     |  8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r a873b525087f -r 01ef283f9cf7 tests/usr.bin/xlint/lint2/emit.exp-ln
--- a/tests/usr.bin/xlint/lint2/emit.exp-ln     Sat Sep 04 18:26:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/emit.exp-ln     Sat Sep 04 18:34:17 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: emit.exp-ln,v 1.4 2021/09/04 18:26:35 rillig Exp $
+# $NetBSD: emit.exp-ln,v 1.5 2021/09/04 18:34:17 rillig Exp $
 
 S llib-lemit.ln
 0 s llib-lemit.ln
@@ -26,6 +26,9 @@
 0 d 0.0 v1 S1 du 14func_scanflike f1 PC I
 0 d 0.0 v1 du 12func_varargs F2 PC E I
 
+0 d 0.0 d r o u 13old_style_int f0 I
+0 d 0.0 d o u 14old_style_void f0 I
+
 # the variables for the basic types
 0 d 0.0 du 9var__Bool B
 0 d 0.0 du 19var_array_of_double A7D
diff -r a873b525087f -r 01ef283f9cf7 tests/usr.bin/xlint/lint2/emit.ln
--- a/tests/usr.bin/xlint/lint2/emit.ln Sat Sep 04 18:26:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/emit.ln Sat Sep 04 18:34:17 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: emit.ln,v 1.3 2021/09/04 18:26:35 rillig Exp $
+# $NetBSD: emit.ln,v 1.4 2021/09/04 18:34:17 rillig Exp $
 #
 # Test emitting a lint library file.
 
@@ -83,4 +83,10 @@
 0 d 0.0 v1 d 12func_varargs F2 PC E I
 0 d 0.0 v1 P1 d 15func_printflike f1 PC I
 0 d 0.0 v1 S1 d 14func_scanflike f1 PC I
+
+# old_style_void() {}
+0 d 0.0 d o 14old_style_void f0 I
+# old_style_int() { return 1; }
+0 d 0.0 d r o 13old_style_int f0 I
+
 # TODO: find out how traditional C defined a varargs function



Home | Main Index | Thread Index | Old Index