* config/xtensa/xtensa.c (function_arg): Generalize logic so that it
[official-gcc.git] / gcc / testsuite / gcc.dg / unaligned-1.c
blob5df1b37e3634293458753488f54add93d181555a
1 /* PR middle-end/7847 */
2 /* Originator: <jk@tools.de> */
3 /* { dg-do run } */
5 /* This used to fail on SPARC at runtime because of
6 an unaligned memory access. */
8 typedef char int8_t;
9 typedef short int16_t;
10 typedef int int32_t;
11 typedef unsigned char uint8_t;
12 typedef unsigned short uint16_t;
13 typedef unsigned int uint32_t;
15 typedef struct {
16 uint32_t address;
17 uint16_t size;
18 } __attribute__ ((packed)) sml_agl_data_t;
20 typedef struct {
21 sml_agl_data_t data[9];
22 } __attribute__ ((packed)) sml_agli_t;
24 typedef struct {
25 sml_agli_t sml_agli;
26 } __attribute__ ((packed)) dsi_t;
28 typedef struct {
29 int a;
30 dsi_t dsi_pack;
31 } dvd_priv_t;
33 int dvd_read_sector(dvd_priv_t *d, unsigned char* data)
35 int i, skip=0;
37 for (i=0; i < 9; i++)
38 if ((skip=d->dsi_pack.sml_agli.data[i].address) != 0)
39 break;
41 return skip;
44 int main(void)
46 static dvd_priv_t dvd_priv;
47 dvd_read_sector(&dvd_priv, 0);
48 return 0;