OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [alloca-1.c] - Blame information for rev 301

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* 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.  */
4
 
5
typedef __SIZE_TYPE__ size_t;
6
 
7
struct dummy { int x __attribute__((aligned)); };
8
#define BIGGEST_ALIGNMENT __alignof__(struct dummy)
9
 
10
_Bool foo(void)
11
{
12
  char *p = __builtin_alloca(32);
13
  return ((size_t)p & (BIGGEST_ALIGNMENT - 1)) == 0;
14
}
15
 
16
int main()
17
{
18
  if (!foo())
19
    abort ();
20
  return 0;
21
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.