annotate gcc/testsuite/gcc.c-torture/execute/alloca-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-skip-if "requires alloca" { ! alloca } { "-O0" } { "" } } */
kono
parents:
diff changeset
2 /* Verify that alloca storage is sufficiently aligned. */
kono
parents:
diff changeset
3 /* ??? May fail if BIGGEST_ALIGNMENT > STACK_BOUNDARY. Which, I guess
kono
parents:
diff changeset
4 can only happen on !STRICT_ALIGNMENT targets. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 typedef __SIZE_TYPE__ size_t;
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct dummy { int x __attribute__((aligned)); };
kono
parents:
diff changeset
9 #define BIGGEST_ALIGNMENT __alignof__(struct dummy)
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 _Bool foo(void)
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 char *p = __builtin_alloca(32);
kono
parents:
diff changeset
14 return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0;
kono
parents:
diff changeset
15 }
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 int main()
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 if (!foo())
kono
parents:
diff changeset
20 abort ();
kono
parents:
diff changeset
21 return 0;
kono
parents:
diff changeset
22 }