commit 6572e37a3b1e74f494411b50bcc4f91a150c9d87
parent a4327ee1d8aa2b13051e95b2787680207b563cac
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 9 Mar 2017 08:23:45 +0100
[tests] Add tests for k&r functions with default int
Diffstat:
3 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/tests/error/0019-kr_names.c b/tests/error/0019-kr_names.c
@@ -0,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);
+}
diff --git a/tests/execute/0128-kr_names.c b/tests/execute/0128-kr_names.c
@@ -0,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);
+}
diff --git 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