URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
static int ref(void)
|
static int ref(void)
|
{
|
{
|
union {
|
union {
|
char c[5];
|
char c[5];
|
int i;
|
int i;
|
} u;
|
} u;
|
|
|
__builtin_memset (&u, 0, sizeof(u));
|
__builtin_memset (&u, 0, sizeof(u));
|
u.c[0] = 1;
|
u.c[0] = 1;
|
u.c[1] = 2;
|
u.c[1] = 2;
|
u.c[2] = 3;
|
u.c[2] = 3;
|
u.c[3] = 4;
|
u.c[3] = 4;
|
|
|
return u.i;
|
return u.i;
|
}
|
}
|
|
|
#define MAX(a,b) (a < b ? b : a)
|
#define MAX(a,b) (a < b ? b : a)
|
|
|
static int test(void)
|
static int test(void)
|
{
|
{
|
char c[MAX(5, sizeof(int))] __attribute__((aligned)) = { 1, 2, 3, 4 };
|
char c[MAX(5, sizeof(int))] __attribute__((aligned)) = { 1, 2, 3, 4 };
|
return *(int *)c;
|
return *(int *)c;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
int a = test();
|
int a = test();
|
int b = ref();
|
int b = ref();
|
if (a != b)
|
if (a != b)
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.