]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Wed, 29 May 2002 20:34:28 +0000 (20:34 +0000)
committerNo Author <no-author@gcc.gnu.org>
Wed, 29 May 2002 20:34:28 +0000 (20:34 +0000)
'gcc-3_1-branch'.

From-SVN: r54019

gcc/testsuite/gcc.c-torture/execute/alloca-1.c [new file with mode: 0644]

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 (file)
index 0000000..a8d1384
--- /dev/null
@@ -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;
+}