shithub: scc

Download patch

ref: d0a90a5aa668cfab6cc1a3e2ad02a0d61d349898
parent: 5452a740f77b55731c52958f3f99086d02bd9d41
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Mar 9 03:23:45 EST 2017

[tests] Add tests for k&r functions with default int

--- /dev/null
+++ b/tests/error/0019-kr_names.c
@@ -1,0 +1,21 @@
+/*
+PATTERN:
+0019-kr_names.c:9: warning: parameter names (without types) in function declaration
+0019-kr_names.c:13: warning: type of 'a' defaults to int
+0019-kr_names.c:13: warning: type of 'c' defaults to int
+.
+*/
+
+int f(a,b);
+
+int
+f(a,b,c) char b;
+{
+	return a - c + b;
+}
+
+int
+main(void)
+{
+	return f(1,0,1);
+}
--- /dev/null
+++ b/tests/execute/0128-kr_names.c
@@ -1,0 +1,13 @@
+int f(a,b);
+
+int
+f(a,b,c) char b;
+{
+	return a - c + b;
+}
+
+int
+main(void)
+{
+	return f(1,0,1);
+}
--- a/tests/execute/scc-tests.lst
+++ b/tests/execute/scc-tests.lst
@@ -118,3 +118,4 @@
 0125-fundcl.c
 0126-macropar.c [TODO]
 0127-doublecte.c [TODO]
+0128-kr_names.c