[hackers] [scc] Add auto refence in test002 || Roberto E. Vargas Caballero
 
commit b9158535e95666900dd3f78ebb53eb7a0dba964f
Author:     Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Sep 1 18:43:13 2015 +0200
Commit:     Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Sep 1 18:43:13 2015 +0200
    Add auto refence in test002
    
    This is another form of incomplete types that must be checked.
diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c
index b8c068a..7c2e7f2 100644
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
_AT_@ -4,29 +4,46 @@ description: Test forward references before definition of types
 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	_AT_S2	A2	:S2
+	A4	#N0	:N	A3	A2	'P	:P	,P
+	j	L7
+	d
+L5
+	A4	#N1	:+N	A3	A3	_AT_S2	M6	.P	:P	,P
+L7
+	j	L5	A3	#P0	!I
+	b
+L6
 }
 */
 
 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 */;
 }
Received on Tue Sep 01 2015 - 20:10:55 CEST
This archive was generated by hypermail 2.3.0
: Tue Sep 01 2015 - 20:12:11 CEST