scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

test014.c (1444B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /*
      4 name: TEST014
      5 description: Basic storage class test
      6 error:
      7 test014.c:15: warning: 'a' defined but not used
      8 test014.c:15: warning: 'k' defined but not used
      9 test014.c:15: warning: 'j' defined but not used
     10 test014.c:15: warning: 'i' defined but not used
     11 test014.c:15: warning: 'h' defined but not used
     12 test014.c:21: warning: 'par' defined but not used
     13 test014.c:21: warning: 'par' defined but not used
     14 test014.c:26: warning: 'par' defined but not used
     15 test014.c:28: error: incorrect storage class for file-scope declaration
     16 test014.c:31: error: bad storage class in function parameter
     17 test014.c:32: error: invalid storage class for function 'func4'
     18 test014.c:33: error: invalid type specification
     19 test014.c:34: warning: 'f' defined but not used
     20 test014.c:34: warning: 'par' defined but not used
     21 test014.c:37: error: conflicting types for 'd'
     22 output:
     23 G1	I	"a
     24 Y2	K	"b
     25 X3	I	"c
     26 G6	I	F	"func1
     27 {
     28 \
     29 A7	I	"h
     30 T8	K	"i
     31 R9	W	"j
     32 X10	I	"k
     33 T11	Z	"a
     34 	h	#I0
     35 }
     36 G14	0	F	"func2
     37 {
     38 R12	I	"par
     39 \
     40 A15	I	"par
     41 }
     42 T17	0	F	"func3
     43 {
     44 R16	I	"par
     45 \
     46 }
     47 */
     48 
     49 #line 1
     50 int a;
     51 static char b;
     52 extern int c;
     53 typedef unsigned e;
     54 
     55 int
     56 func1(void)
     57 {
     58 	auto h;
     59 	static char i;
     60 	register long j;
     61 	extern int k;
     62 	static unsigned long a;
     63 	return 0;
     64 }
     65 
     66 void
     67 func2(register int par)
     68 {
     69 	int par;
     70 }
     71 
     72 static void
     73 func3(register int par)
     74 {
     75 }
     76 
     77 register short d;
     78 
     79 register void
     80 func4(static int par)
     81 {
     82 	static register f;
     83 }
     84 
     85 short d;
     86 char d;
     87