shithub: scc

Download patch

ref: b9158535e95666900dd3f78ebb53eb7a0dba964f
parent: c19b3bf153c5a741945e1ed2681f2279dd0c7a28
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Sep 1 14:43:13 EDT 2015

Add auto refence in test002

This is another form of incomplete types that must be checked.

--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
@@ -4,16 +4,28 @@
 output:
 G4	P	x
 F1
-G6	F1	main
+G7	F1	main
 {
 -
 S2	S
 (
 M5	I	i
+M6	P	next
 )
 A2	S2	y
+A3	P	p
+A4	N	n
 	A2	M5	.I	#I0	:I
 	G4	@S2	A2	:S2
+	A4	#N0	:N	A3	A2	'P	:P	,P
+	j	L7
+	d
+L5
+	A4	#N1	:+N	A3	A3	@S2	M6	.P	:P	,P
+L7
+	j	L5	A3	#P0	!I
+	b
+L6
 }
 */
 
@@ -20,13 +32,18 @@
 struct S *x;
 struct S {
 	int i;
+	struct S *next;
 };
 
-void
+int
 main(void)
 {
-	struct S y;
+	struct S y, *p;
+	unsigned n;
 
 	y.i = 0;
 	*x = y;
+
+	for (n = 0, p = &y; p; ++n, p = p->next)
+		/* nothing */;
 }