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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr50527.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-Os --param large-stack-frame=30 -Wno-pointer-to-int-cast" } */
3
 
4
extern void abort (void);
5
 
6
void __attribute__((noinline))
7
bar (char *a)
8
{
9
}
10
 
11
void __attribute__((noinline))
12
foo (char *a, int b)
13
{
14
}
15
 
16
void __attribute__((noinline))
17
test_align (char *p, int aligned, unsigned int mask)
18
{
19
  int p_aligned = ((unsigned long int)p & mask) == 0;
20
  if (aligned != p_aligned)
21
    abort ();
22
}
23
 
24
int
25
main ()
26
{
27
  const int kIterations = 4;
28
  char results[kIterations];
29
  int i;
30
  unsigned int mask;
31
 
32
  mask = 0xf;
33
  test_align (results, ((unsigned long int)results & mask) == 0, mask);
34
  mask = 0x7;
35
  test_align (results, ((unsigned long int)results & mask) == 0, mask);
36
  mask = 0x3;
37
  test_align (results, ((unsigned long int)results & mask) == 0, mask);
38
  mask = 0x1;
39
  test_align (results, ((unsigned long int)results & mask) == 0, mask);
40
 
41
  bar (results);
42
  for (i = 0; i < kIterations; i++)
43
    foo ("%d ", results[i]);
44
 
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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