From: No Author Date: Wed, 29 May 2002 20:34:28 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: releases/gcc-3.1.1~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c77eaf4a9c58d1aa71ed20ad4f556ca225ae11;p=thirdparty%2Fgcc.git This commit was manufactured by cvs2svn to create branch 'gcc-3_1-branch'. From-SVN: r54019 --- diff --git a/gcc/testsuite/gcc.c-torture/execute/alloca-1.c b/gcc/testsuite/gcc.c-torture/execute/alloca-1.c new file mode 100644 index 000000000000..a8d1384c6ece --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/alloca-1.c @@ -0,0 +1,21 @@ +/* Verify that alloca storage is sufficiently aligned. */ +/* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess + can only happen on !STRICT_ALIGNMENT targets. */ + +typedef __SIZE_TYPE__ size_t; + +struct dummy { int x __attribute__((aligned)); }; +#define BIGGEST_ALIGNMENT __alignof__(struct dummy) + +_Bool foo(void) +{ + char *p = __builtin_alloca(32); + return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0; +} + +int main() +{ + if (!foo()) + abort (); + return 0; +}