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.dg/] [20030826-2.c] - Blame information for rev 328

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -fomit-frame-pointer" } */
3
/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
struct S
9
{
10
  int *a;
11
  unsigned char *b, c;
12
};
13
 
14
int u, v, w;
15
 
16
void
17
foo (unsigned short x)
18
{
19
  u += x;
20
}
21
 
22
int
23
bar (struct S **x, int *y)
24
{
25
  w += *y;
26
  *y = w + 25;
27
  return 0;
28
}
29
 
30
int
31
baz (struct S **x)
32
{
33
  struct S *y = *x;
34
  unsigned char *a = y->b;
35
 
36
  foo (*a);
37
 
38
  if (__builtin_expect (y->c != 0 || y->a == &v, 0))
39
    return 1;
40
 
41
  if (__builtin_expect (*a == 1, 0))
42
    {
43
      int a, b = bar (x, &a);
44
 
45
      if (a)
46
        return b;
47
    }
48
 
49
  return 0;
50
}
51
 
52
int
53
main (void)
54
{
55
  struct S a, *b = &a;
56
  unsigned char c;
57
 
58
  __builtin_memset (b, 0, sizeof (a));
59
  a.a = &v;
60
  a.b = &c;
61
  if (baz (&b) != 1)
62
    abort ();
63
  exit (0);
64
}

powered by: WebSVN 2.1.0

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