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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR optimization/6631
2
 
3
// { dg-do run }
4
// { dg-options "-O" }
5
 
6
extern "C" void abort (void);
7
 
8
struct QSize
9
{
10
  QSize();
11
  QSize( int w, int h );
12
  int wd, ht;
13
  friend inline const QSize operator+( const QSize &, const QSize & );
14
};
15
 
16
inline QSize::QSize()
17
{ wd = ht = -1; }
18
 
19
inline QSize::QSize( int w, int h )
20
{ wd = w; ht = h; }
21
 
22
inline const QSize operator+( const QSize & s1, const QSize & s2 )
23
{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
24
 
25
QSize minimumSize()
26
{
27
  return QSize (100, 200);
28
}
29
 
30
QSize totalMinimumSize()
31
{
32
    QSize s = minimumSize();
33
    return s + QSize( 0, 0 );
34
}
35
 
36
int main()
37
{
38
  QSize s = totalMinimumSize();
39
  if (s.wd != 100 || s.ht != 200)
40
    abort ();
41
}
42
 

powered by: WebSVN 2.1.0

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