shithub: scc

Download patch

ref: 2ce22577d4ef7361895212ed8719c8ff8f36e601
parent: 40c38052a3f66ee50d55d848b57f7d7d7a97a547
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Jan 10 04:36:01 EST 2016

Add test about double typedef

This test is interesting because it has a typedef in
the declaration of the type and in the definition of
the type.

--- /dev/null
+++ b/cc1/tests/test043.c
@@ -1,0 +1,34 @@
+/*
+name: TEST043
+description: Test for double typedef (taken from plan9 kernel)
+output:
+F4	0
+S2	Clock0link
+M6	P	clock
+M8	P	link
+G9	S2	cl0
+F10	I
+G11	F10	main
+{
+\
+	G9	M6	.P	@F4	c0
+	r	#I0
+}
+*/
+
+typedef struct Clock0link Clock0link;
+typedef struct Clock0link {
+	void		(*clock)(void);
+	Clock0link*	link;
+} Clock0link;
+
+
+
+Clock0link cl0;
+
+int
+main(void)
+{
+	(*cl0.clock)();
+	return 0;
+}