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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [pr30286.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* PR middle-end/30286 */
2
/* { dg-do run } */
3
/* { dg-options "-O2 -ftrapv" } */
4
 
5
extern void abort (void);
6
struct S { struct S *s; };
7
struct T { struct S *t[25]; };
8
 
9
void
10
__attribute__((noinline))
11
foo (int i, struct T *x, struct S *y)
12
{
13
  int j;
14
  for (j = 14; j > i; j--)
15
    x->t[j] = y->s;
16
}
17
 
18
int
19
main (void)
20
{
21
  struct S s;
22
  struct T t;
23
  int i;
24
 
25
  s.s = &s;
26
  __builtin_memset (&t, 0, sizeof (t));
27
  foo (6, &t, &s);
28
  for (i = 0; i < 25; i++)
29
    if (t.t[i] != ((i > 6 && i <= 14) ? &s : (struct S *) 0))
30
      abort ();
31
  __builtin_memset (&t, 0, sizeof (t));
32
  foo (-1, &t, &s);
33
  for (i = 0; i < 25; i++)
34
    if (t.t[i] != ((i >= 0 && i <= 14) ? &s : (struct S *) 0))
35
      abort ();
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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