URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
typedef struct
|
typedef struct
|
{
|
{
|
unsigned char a __attribute__((packed));
|
unsigned char a __attribute__((packed));
|
unsigned short b __attribute__((packed));
|
unsigned short b __attribute__((packed));
|
} three_char_t;
|
} three_char_t;
|
|
|
unsigned char
|
unsigned char
|
my_set_a (void)
|
my_set_a (void)
|
{
|
{
|
return 0xab;
|
return 0xab;
|
}
|
}
|
|
|
unsigned short
|
unsigned short
|
my_set_b (void)
|
my_set_b (void)
|
{
|
{
|
return 0x1234;
|
return 0x1234;
|
}
|
}
|
|
|
main ()
|
main ()
|
{
|
{
|
three_char_t three_char;
|
three_char_t three_char;
|
|
|
three_char.a = my_set_a ();
|
three_char.a = my_set_a ();
|
three_char.b = my_set_b ();
|
three_char.b = my_set_b ();
|
if (three_char.a != 0xab || three_char.b != 0x1234)
|
if (three_char.a != 0xab || three_char.b != 0x1234)
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.