view test/simp.c @ 615:2dee957ef988

test case on undeclared name gcc include path handling
author kono
date Wed, 06 Sep 2006 15:21:06 +0900
parents 492f06738550
children a7f5796e540a
line wrap: on
line source

#include "stdio.h"

#define UNDECL

float f = 3;
float g = 4096.0f;

int kk = {-3};

int
main2(int i)
{
    i+=f;
    return +i;
}

int
alpha(c)
char c;
{
     return(('a'<=c&&c<='z')||('A'<=c&&c<='Z')||c=='_');
}
char ch;

void main1();
int main0() ;

int
main(int ac,char *av[]) 
{
    int i;

    printf("#0031:%d\n",ac);
    for(i=0;i<ac;i++) {
	printf("#0033:%s\n",&av[i][3]);
    }
    ch = 'E';
    main1(-8);
    printf("#0037:%d\n",main2(3));
#ifdef UNDECL
    j = k;   // undeclared global variable
    printf("#0037:%d\n",h);
#endif
    return main0(ac,ch,av);
}

int
main0(ac,ch,av) 
int ac;
char ch;
char *av[];
{
    int i;
    printf("#0048:%d %c\n",ac,ch);
    for(i=0;i<ac;i++) {
	printf("#0050:%s\n",&av[i][3]);
    }
    printf("#0052:%d==1\n",alpha(ch));
    return 0;
}

void
main1(int l)
{
   printf("#0059:%d\n", ((l+0)<-511||(l+0)>511));
   if ((l+0)<-511||(l+0)>511) printf("#0060:yes\n");
   l = -1;
   printf("#0062:%d\n", l==-1? 555:333);
}