S/390: Allow immediates in loc expander
[official-gcc.git] / gcc / testsuite / gcc.dg / misaligned-expand-1.c
blobb799b6b87c2a8d334eb05956005782b39cbdb442
1 /* Test that expand can generate correct loads of misaligned data even on
2 strict alignment platforms. */
4 /* { dg-do run } */
5 /* { dg-options "-O0" } */
7 extern void abort ();
9 typedef unsigned int myint __attribute__((aligned(1)));
11 unsigned int
12 foo (myint *p)
14 return *p;
17 #define cst (int) 0xdeadbeef
18 #define NUM 8
20 struct blah
22 char c;
23 myint i[NUM];
26 struct blah g;
28 int
29 main (int argc, char **argv)
31 int i, k;
32 for (k = 0; k < NUM; k++)
34 g.i[k] = cst;
35 i = foo (&g.i[k]);
37 if (i != cst)
38 abort ();
40 return 0;