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.c-torture/] [execute/] [pr43385.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR c/43385 */
2
 
3
extern void abort (void);
4
 
5
int e;
6
 
7
__attribute__((noinline)) void
8
foo (int x, int y)
9
{
10
  if (__builtin_expect (x, 0) && y != 0)
11
    e++;
12
}
13
 
14
__attribute__((noinline)) int
15
bar (int x, int y)
16
{
17
  if (__builtin_expect (x, 0) && y != 0)
18
    return 1;
19
  else
20
    return 0;
21
}
22
 
23
int
24
main (void)
25
{
26
  int z = 0;
27
  asm ("" : "+r" (z));
28
  foo (z + 2, z + 1);
29
  if (e != 1)
30
    abort ();
31
  foo (z + 2, z);
32
  if (e != 1)
33
    abort ();
34
  foo (z + 1, z + 1);
35
  if (e != 2)
36
    abort ();
37
  foo (z + 1, z);
38
  if (e != 2)
39
    abort ();
40
  foo (z, z + 1);
41
  if (e != 2)
42
    abort ();
43
  foo (z, z);
44
  if (e != 2)
45
    abort ();
46
  if (bar (z + 2, z + 1) != 1)
47
    abort ();
48
  if (bar (z + 2, z) != 0)
49
    abort ();
50
  if (bar (z + 1, z + 1) != 1)
51
    abort ();
52
  if (bar (z + 1, z) != 0)
53
    abort ();
54
  if (bar (z, z + 1) != 0)
55
    abort ();
56
  if (bar (z, z) != 0)
57
    abort ();
58
  return 0;
59
}

powered by: WebSVN 2.1.0

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