2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / alloca-1.c
bloba8d1384c6ecebb1029153a52a7df56741cbd4dde
1 /* Verify that alloca storage is sufficiently aligned. */
2 /* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess
3 can only happen on !STRICT_ALIGNMENT targets. */
5 typedef __SIZE_TYPE__ size_t;
7 struct dummy { int x __attribute__((aligned)); };
8 #define BIGGEST_ALIGNMENT __alignof__(struct dummy)
10 _Bool foo(void)
12 char *p = __builtin_alloca(32);
13 return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0;
16 int main()
18 if (!foo())
19 abort ();
20 return 0;