PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / align-main-2.c
blobaddbbd12f79ef1cbaaad9f4f99fefe324fa8a253
1 /* Test for stack alignment when PREFERRED_STACK_BOUNDARY > alignment
2 of local variable. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -mpreferred-stack-boundary=6 -mincoming-stack-boundary=6" } */
5 /* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-64,\[\\t \]*%\[re\]?sp" } } */
6 /* { dg-final { scan-assembler-not "and\[lq\]?\[\\t \]*\\$-128,\[\\t \]*%\[re\]?sp" } } */
7 /* { dg-skip-if "Options about stack-boundary aren't support" { x86_64-*-mingw* } } */
8 #include <stddef.h>
10 #define ALIGNMENT 32
11 typedef int aligned __attribute__((aligned(ALIGNMENT)));
12 extern void abort(void);
14 __attribute__ ((noinline))
15 void check(void * a)
17 if (((ptrdiff_t)a & (ALIGNMENT-1)) != 0)
18 abort();
21 int main()
23 aligned a = 1;
24 check(&a);
25 return 0;