]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
Get rid of dg-skip-if etc. default args
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / torture / stackalign / alloca-1.c
CommitLineData
3b2488ca 1/* { dg-do run } */
4f4b0ab8 2/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } } */
e2acc079 3/* { dg-require-effective-target alloca } */
3b2488ca
L
4
5#include "check.h"
6
7#ifndef ALIGNMENT
8#define ALIGNMENT 64
9#endif
10
11typedef int aligned __attribute__((aligned(ALIGNMENT)));
12
13int global;
14
15void
16bar (char *p, int size)
17{
18 __builtin_strncpy (p, "good", size);
19}
20
21void
22foo (int size)
23{
24 char *p = __builtin_alloca (size + 1);
25 aligned i;
26
27 bar (p, size);
28 if (__builtin_strncmp (p, "good", size) != 0)
29 {
30#ifdef DEBUG
31 p[size] = '\0';
32 printf ("Failed: %s != good\n", p);
33#endif
34 abort ();
35 }
36
37 if (check_int (&i, __alignof__(i)) != i)
38 abort ();
39}
40
41int
42main()
43{
44 foo (5);
45 return 0;
46}