scc

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

test038.c (405B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /*
      4 name: TEST038
      5 description: Basic test for tentative definitions
      6 error:
      7 test038.c:45: error: redeclaration of 'x'
      8 output:
      9 G1	I	"x
     10 G1	I	"x	(
     11 	#I0
     12 )
     13 X3	I	F	"main
     14 G5	P	F	"foo
     15 {
     16 \
     17 	h	X3	'P
     18 }
     19 G3	I	F	"main
     20 {
     21 \
     22 	G1	#I0	:I
     23 	h	G1
     24 }
     25 */
     26 
     27 int x;
     28 int x = 0;
     29 int x;
     30 
     31 int main();
     32 
     33 void *
     34 foo()
     35 {
     36 	return &main;
     37 }
     38 
     39 int
     40 main()
     41 {
     42 	x = 0;
     43 	return x;
     44 }
     45 int x = 1;