Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/strct-pack-4.c

raw
1 void abort (void);
2 void exit (int);
3
4 typedef struct
5 {
6 unsigned char a __attribute__((packed));
7 unsigned short b __attribute__((packed));
8 } three_char_t;
9
10 unsigned char
11 my_set_a (void)
12 {
13 return 0xab;
14 }
15
16 unsigned short
17 my_set_b (void)
18 {
19 return 0x1234;
20 }
21
22 int
23 main (void)
24 {
25 three_char_t three_char;
26
27 three_char.a = my_set_a ();
28 three_char.b = my_set_b ();
29 if (three_char.a != 0xab || three_char.b != 0x1234)
30 abort ();
31 exit (0);
32 }
33