PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / nest-align-1.c
blob73c0f6470db2d18874f0712bbf437108bccd4e06
1 /* Test for alignment handling when a variable is accessed by nested
2 function. */
3 /* Origin: Joey Ye <joey.ye@intel.com> */
5 /* Force bigger stack alignment for PowerPC EABI targets. */
6 /* { dg-options "-mno-eabi" { target powerpc-*-eabi* } } */
8 #include <stddef.h>
10 typedef int aligned __attribute__((aligned));
11 extern void abort (void);
13 void
14 check (int *i)
16 *i = 20;
17 if ((((ptrdiff_t) i) & (__alignof__(aligned) - 1)) != 0)
18 abort ();
21 void
22 foo (void)
24 aligned jj;
25 void bar ()
27 jj = -20;
29 jj = 0;
30 bar ();
31 if (jj != -20)
32 abort ();
33 check (&jj);
34 if (jj != 20)
35 abort ();
38 int
39 main()
41 foo ();
42 return 0;