URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
int test1 (int b, int c)
|
int test1 (int b, int c)
|
{
|
{
|
char x;
|
char x;
|
if (b)
|
if (b)
|
return x / c;
|
return x / c;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
int test2 (int b, int c)
|
int test2 (int b, int c)
|
{
|
{
|
int x;
|
int x;
|
if (b)
|
if (b)
|
return x * c;
|
return x * c;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
int test3 (int b, int c)
|
int test3 (int b, int c)
|
{
|
{
|
int x;
|
int x;
|
if (b)
|
if (b)
|
return x % c;
|
return x % c;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
int test4 (int b, int c)
|
int test4 (int b, int c)
|
{
|
{
|
char x;
|
char x;
|
if (b)
|
if (b)
|
return x == c;
|
return x == c;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
|
|
extern void abort (void);
|
extern void abort (void);
|
int main()
|
int main()
|
{
|
{
|
if (test1(1, 1000) != 0)
|
if (test1(1, 1000) != 0)
|
abort ();
|
abort ();
|
if (test2(1, 0) != 0)
|
if (test2(1, 0) != 0)
|
abort ();
|
abort ();
|
if (test3(1, 1) != 0)
|
if (test3(1, 1) != 0)
|
abort ();
|
abort ();
|
if (test4(1, 1000) != 0)
|
if (test4(1, 1000) != 0)
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.