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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr44071.c] - Blame information for rev 779

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

Line No. Rev Author Line
1 318 jeremybenn
/* PR middle-end/44071 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
 
5
static inline int
6
f1 (void)
7
{
8
  asm goto ("jmp %l[l1]" : : : : l1, l2);
9
  __builtin_unreachable ();
10
 l1:
11
  return 1;
12
 l2:
13
  return 0;
14
}
15
 
16
__attribute__((noinline)) int
17
b1 (int x)
18
{
19
  if (f1 () || x == 6)
20
    x = 1;
21
  else
22
    x = 2;
23
  return x;
24
}
25
 
26
static inline int
27
f2 (void)
28
{
29
  asm goto ("jmp %l[l2]" : : : : l1, l2);
30
  __builtin_unreachable ();
31
 l1:
32
  return 1;
33
 l2:
34
  return 0;
35
}
36
 
37
__attribute__((noinline)) int
38
b2 (int x)
39
{
40
  if (f2 () || x == 6)
41
    x = 1;
42
  else
43
    x = 2;
44
  return x;
45
}
46
 
47
static inline int
48
f3 (void)
49
{
50
  asm goto ("jmp %l[l1]" : : : : l1, l2);
51
 l1:
52
  return 1;
53
 l2:
54
  return 0;
55
}
56
 
57
__attribute__((noinline)) int
58
b3 (int x)
59
{
60
  if (f3 () || x == 6)
61
    x = 1;
62
  else
63
    x = 2;
64
  return x;
65
}
66
 
67
static inline int
68
f4 (void)
69
{
70
  asm goto ("jmp %l[l2]" : : : : l1, l2);
71
 l1:
72
  return 1;
73
 l2:
74
  return 0;
75
}
76
 
77
__attribute__((noinline)) int
78
b4 (int x)
79
{
80
  if (f4 () || x == 6)
81
    x = 1;
82
  else
83
    x = 2;
84
  return x;
85
}
86
 
87
extern void abort (void);
88
 
89
int
90
main (void)
91
{
92
  int x;
93
  asm ("" : "=r" (x) : "0" (0));
94
  if (b1 (x) != 1 || b1 (x + 6) != 1)
95
    abort ();
96
  if (b2 (x) != 2 || b2 (x + 6) != 1)
97
    abort ();
98
  if (b3 (x) != 1 || b3 (x + 6) != 1)
99
    abort ();
100
  if (b4 (x) != 2 || b4 (x + 6) != 1)
101
    abort ();
102
  return 0;
103
}

powered by: WebSVN 2.1.0

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