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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20030313-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
struct A
2
{
3
  unsigned long p, q, r, s;
4
} x = { 13, 14, 15, 16 };
5
 
6
extern void abort (void);
7
extern void exit (int);
8
 
9
static inline struct A *
10
bar (void)
11
{
12
  struct A *r;
13
 
14
  switch (8)
15
    {
16
    case 2:
17
      abort ();
18
      break;
19
    case 8:
20
      r = &x;
21
      break;
22
    default:
23
      abort ();
24
      break;
25
    }
26
  return r;
27
}
28
 
29
void
30
foo (unsigned long *x, int y)
31
{
32
  if (y != 12)
33
    abort ();
34
  if (x[0] != 1 || x[1] != 11)
35
    abort ();
36
  if (x[2] != 2 || x[3] != 12)
37
    abort ();
38
  if (x[4] != 3 || x[5] != 13)
39
    abort ();
40
  if (x[6] != 4 || x[7] != 14)
41
    abort ();
42
  if (x[8] != 5 || x[9] != 15)
43
    abort ();
44
  if (x[10] != 6 || x[11] != 16)
45
    abort ();
46
}
47
 
48
int
49
main (void)
50
{
51
  unsigned long a[40];
52
  int b = 0;
53
 
54
  a[b++] = 1;
55
  a[b++] = 11;
56
  a[b++] = 2;
57
  a[b++] = 12;
58
  a[b++] = 3;
59
  a[b++] = bar()->p;
60
  a[b++] = 4;
61
  a[b++] = bar()->q;
62
  a[b++] = 5;
63
  a[b++] = bar()->r;
64
  a[b++] = 6;
65
  a[b++] = bar()->s;
66
  foo (a, b);
67
  exit (0);
68
}

powered by: WebSVN 2.1.0

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