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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr7503-1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/7503
2
// { dg-do run }
3
// { dg-options "-O2" }
4
 
5
extern "C" void abort();
6
 
7
void test1a()
8
{
9
  int A = 4;
10
  int B = 4;
11
 
12
  (A > B ? A : B) = 1;
13
  if (A != 4 || B != 1)
14
    abort ();
15
}
16
 
17
void test1b()
18
{
19
  int A = 3;
20
  int B = 5;
21
 
22
  (A > B ? A : B) = 1;
23
  if (A != 3 || B != 1)
24
    abort ();
25
}
26
 
27
void test1c()
28
{
29
  int A = 5;
30
  int B = 3;
31
 
32
  (A > B ? A : B) = 1;
33
  if (A != 1 || B != 3)
34
    abort ();
35
}
36
 
37
void test2a()
38
{
39
  int A = 4;
40
  int B = 4;
41
 
42
  (A >= B ? A : B) = 1;
43
  if (A != 1 || B != 4)
44
    abort ();
45
}
46
 
47
void test2b()
48
{
49
  int A = 3;
50
  int B = 5;
51
 
52
  (A >= B ? A : B) = 1;
53
  if (A != 3 || B != 1)
54
    abort ();
55
}
56
 
57
void test2c()
58
{
59
  int A = 5;
60
  int B = 3;
61
 
62
  (A >= B ? A : B) = 1;
63
  if (A != 1 || B != 3)
64
    abort ();
65
}
66
 
67
void test3a()
68
{
69
  int A = 4;
70
  int B = 4;
71
 
72
  (A < B ? A : B) = 1;
73
  if (A != 4 || B != 1)
74
    abort ();
75
}
76
 
77
void test3b()
78
{
79
  int A = 3;
80
  int B = 5;
81
 
82
  (A < B ? A : B) = 1;
83
  if (A != 1 || B != 5)
84
    abort ();
85
}
86
 
87
void test3c()
88
{
89
  int A = 5;
90
  int B = 3;
91
 
92
  (A < B ? A : B) = 1;
93
  if (A != 5 || B != 1)
94
    abort ();
95
}
96
 
97
void test4a()
98
{
99
  int A = 4;
100
  int B = 4;
101
 
102
  (A <= B ? A : B) = 1;
103
  if (A != 1 || B != 4)
104
    abort ();
105
}
106
 
107
void test4b()
108
{
109
  int A = 3;
110
  int B = 5;
111
 
112
  (A <= B ? A : B) = 1;
113
  if (A != 1 || B != 5)
114
    abort ();
115
}
116
 
117
void test4c()
118
{
119
  int A = 5;
120
  int B = 3;
121
 
122
  (A <= B ? A : B) = 1;
123
  if (A != 5 || B != 1)
124
    abort ();
125
}
126
 
127
 
128
int main()
129
{
130
  test1a();
131
  test1b();
132
  test1c();
133
 
134
  test2a();
135
  test2b();
136
  test2c();
137
 
138
  test3a();
139
  test3b();
140
  test3c();
141
 
142
  test4a();
143
  test4b();
144
  test4c();
145
 
146
  return 0;
147
}
148
 

powered by: WebSVN 2.1.0

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