mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-05-31 22:41:28 +00:00
30 lines
405 B
C
30 lines
405 B
C
typedef struct
|
|
{
|
|
unsigned char a __attribute__((packed));
|
|
unsigned short b __attribute__((packed));
|
|
} three_char_t;
|
|
|
|
unsigned char
|
|
my_set_a (void)
|
|
{
|
|
return 0xab;
|
|
}
|
|
|
|
unsigned short
|
|
my_set_b (void)
|
|
{
|
|
return 0x1234;
|
|
}
|
|
|
|
main ()
|
|
{
|
|
three_char_t three_char;
|
|
|
|
three_char.a = my_set_a ();
|
|
three_char.b = my_set_b ();
|
|
if (three_char.a != 0xab || three_char.b != 0x1234)
|
|
abort ();
|
|
exit (0);
|
|
}
|
|
|