1 /* Test that expand can generate correct stores to misaligned data even on
2    strict alignment platforms.  */
3 
4 /* { dg-do run } */
5 /* { dg-options "-O0" } */
6 
7 extern void abort ();
8 
9 typedef unsigned int myint __attribute__((aligned(1)));
10 
11 void
foo(myint * p,unsigned int i)12 foo (myint *p, unsigned int i)
13 {
14   *p = i;
15 }
16 
17 #define cst (int) 0xdeadbeef
18 #define NUM 8
19 
20 struct blah
21 {
22   char c;
23   myint i[NUM];
24 };
25 
26 struct blah g;
27 
28 int
main(int argc,char ** argv)29 main (int argc, char **argv)
30 {
31   int k;
32 
33   for (k = 0; k < NUM; k++)
34     {
35       foo (&g.i[k], cst);
36       if (g.i[k] != cst)
37 	abort ();
38     }
39   return 0;
40 }
41