[hackers] [scc] Add basic test for storage specifiers || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 21 Aug 2015 00:17:08 +0200 (CEST)

X-DEBUG-UPD: 605c7cdb0678c691f3c118154501f8ec2e8f852c
commit 605c7cdb0678c691f3c118154501f8ec2e8f852c
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Aug 21 00:15:07 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Aug 21 00:15:07 2015 +0200

    Add basic test for storage specifiers
    
    This test checks the correct parsing of several basic
    combination of types and storage specifiers, and the
    correct detection of errors.

diff --git a/cc1/tests/test014.c b/cc1/tests/test014.c
new file mode 100644
index 0000000..c8da94a
--- /dev/null
+++ b/cc1/tests/test014.c
_AT_@ -0,0 +1,86 @@
+/*
+name: TEST014
+description: Basic storage class test
+output:
+test014.c:22: warning: 'a' defined but not used
+test014.c:22: warning: 'k' defined but not used
+test014.c:22: warning: 'j' defined but not used
+test014.c:22: warning: 'i' defined but not used
+test014.c:22: warning: 'h' defined but not used
+test014.c:28: warning: 'par' defined but not used
+test014.c:28: warning: 'par' defined but not used
+test014.c:33: warning: 'par' defined but not used
+test014.c:35: error: incorrect storage class for file-scope declaration
+test014.c:35: error: invalid storage class for function 'd'
+test014.c:38: error: bad storage class in function parameter
+test014.c:39: error: invalid storage class for function 'func4'
+test014.c:40: error: invalid type specification
+test014.c:41: warning: 'f' defined but not used
+test014.c:44: error: conflicting types for 'd'
+G1 I a
+Y2 M b
+X3 I c
+F1
+G5 F1 func1
+{
+-
+A2 I h
+T3 M i
+R4 W j
+X5 I k
+T6 Z a
+ yI #I0
+}
+F2 I
+G6 F2 func2
+{
+R1 I par
+-
+A3 I par
+}
+T7 F2 func3
+{
+R1 I par
+-
+}
+????
+*/
+
+int a;
+static char b;
+extern int c;
+typedef unsigned e;
+
+int
+func1(void)
+{
+ auto h;
+ static char i;
+ register long j;
+ extern int k;
+ static unsigned long a;
+ return 0;
+}
+
+void
+func2(register int par)
+{
+ int par;
+}
+
+static void
+func3(register int par)
+{
+}
+
+register short d;
+
+register void
+func4(static int par)
+{
+ static register f;
+}
+
+short d;
+char d;
+
Received on Fri Aug 21 2015 - 00:17:08 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 21 2015 - 00:24:22 CEST