view test/simp1.c @ 255:8cd8d72286ae

PowerPC long long complex function call fix. MIPS entry frame calc.
author kono
date Fri, 14 May 2004 20:57:52 +0900
parents 1452eb0eab20
children 8f09f8bbc494
line wrap: on
line source

int
i(int a,int b,int c,int d,int f)
{
	return a+b+c+d+f;
}

short
s(short a,short b,short c,short d,short f)
{
	printf("s(%d,%d,%d,%d,%d)\n",a,b,c,d,f);
	return a+b+c+d+f;
}

char
ch(char a,char b,char c,char d,char f)
{
	printf("ch(%d,%d,%d,%d,%d)\n",a,b,c,d,f);
	return a+b+c+d+f;
}


float
f(float a,float b,float c,float d,float f)
{
	printf("f(%g,%g,%g,%g,%g)\n",a,b,c,d,f);
	return a+b+c+d+f;
}

double
d(double a,double b,double c,double d,double f)
{
	printf("d(%g,%g,%g,%g,%g)\n",a,b,c,d,f);
	return a+b+c+d+f;
}

long long
l(long long a,long long b,long long c,long long d,long long f)
{
	printf("l(%lld,%lld,%lld,%lld,%lld)\n",a,b,c,d,f);
	return a+b+c+d+f;
}


int
i0()
{
	int a,b,c;
	a=3;
	b=-3;
	c=5;
	c = i(a*3,b*c,b+c,b/c,b-c);
	printf("int: %d\n",c);
}

int
g()
{
	float a,b,c;
	a=3.0;
	b=-3.0;
	c=5.0;
	c = f(a*3,b*c,b+c,b/c,b-c);
	printf("float: %g\n",c);
}

int
h()
{
	double a,b,c;
	a=3.0;
	b=-3.0;
	c=5.0;
	c = d(a*3,b*c,b+c,b/c,b-c);
	printf("double: %g\n",c);
}

int
h1()
{
	long long a,b,c;
	a=3;
	b=-3;
	c=5;
	c = l(a*3,b*c,b+c,b/c,b-c);
	printf("long long: %lld\n",c);
}

int
c1()
{
	char a,b,c;
	a=3;
	b=-3;
	c=5;
	c = ch(a*3,b*c,b+c,b/c,b-c);
	printf("char: %d\n",c);
}

int
s1()
{
	short a,b,c;
	a=3;
	b=-3;
	c=5;
	c = s(a*3,b*c,b+c,b/c,b-c);
	printf("short: %d\n",c);
}

main()
{
    i0();
    g();
    h();
    h1();
    return 0;
}