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/] [g++.dg/] [torture/] [stackalign/] [check.h] - Blame information for rev 307

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

Line No. Rev Author Line
1 301 jeremybenn
#include <stddef.h>
2
#ifdef DEBUG
3
#include <stdio.h>
4
#endif
5
 
6
#ifdef  __cplusplus
7
extern "C" void abort (void);
8
#else
9
extern void abort (void);
10
#endif
11
 
12
int
13
check_int (int *i, int align)
14
{
15
  *i = 20;
16
  if ((((ptrdiff_t) i) & (align - 1)) != 0)
17
    {
18
#ifdef DEBUG
19
      printf ("\nUnalign address (%d): %p!\n", align, i);
20
#endif
21
      abort ();
22
    }
23
  return *i;
24
}
25
 
26
void
27
check (void *p, int align)
28
{
29
  if ((((ptrdiff_t) p) & (align - 1)) != 0)
30
    {
31
#ifdef DEBUG
32
      printf ("\nUnalign address (%d): %p!\n", align, p);
33
#endif
34
      abort ();
35
    }
36
}

powered by: WebSVN 2.1.0

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