2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr66906.c
blob969e183c79c492df69269f02a800169d2dcf1250
1 /* { dg-do run { target ia32 } } */
2 /* { dg-options "-O0 -mregparm=3" } */
4 typedef int ptrdiff_t;
5 extern void abort (void);
6 int
7 check_int (int *i, int align)
9 *i = 20;
10 if ((((ptrdiff_t) i) & (align - 1)) != 0)
11 abort ();
12 return *i;
14 void
15 check (void *p, int align)
17 if ((((ptrdiff_t) p) & (align - 1)) != 0)
18 abort ();
20 typedef int aligned __attribute__((aligned(64)));
21 void
22 foo (void)
24 aligned j;
25 void bar ()
27 aligned i;
28 if (check_int (&i, __alignof__(i)) != i)
29 abort ();
30 if (check_int (&j, __alignof__(j)) != j)
31 abort ();
32 j = -20;
34 bar ();
35 if (j != -20)
36 abort ();
37 if (check_int (&j, __alignof__(j)) != j)
38 abort ();
40 int
41 main()
43 foo ();
44 return 0;