PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / alloca-1.c
blob6a65ddfe9145e327ba9757f9955b0457c0facd66
1 /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
2 /* Verify that alloca storage is sufficiently aligned. */
3 /* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess
4 can only happen on !STRICT_ALIGNMENT targets. */
6 typedef __SIZE_TYPE__ size_t;
8 struct dummy { int x __attribute__((aligned)); };
9 #define BIGGEST_ALIGNMENT __alignof__(struct dummy)
11 _Bool foo(void)
13 char *p = __builtin_alloca(32);
14 return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0;
17 int main()
19 if (!foo())
20 abort ();
21 return 0;