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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/19317
2
// { dg-options "-O2" }
3
// { dg-do run }
4
// Origin: Dirk Mueller 
5
 
6
extern "C" void abort (void);
7
 
8
struct A
9
{
10
  A () { d = e = 0; f = -1; }
11
  A (int x) : d (0), e (0), f (x) { }
12
  A b (const A &r) const;
13
  int d;
14
  int e;
15
  int f;
16
};
17
 
18
A
19
A::b (const A & r) const
20
{
21
  A t;
22
  t.f = f < r.f ? f : r.f;
23
  return t;
24
}
25
 
26
int
27
main ()
28
{
29
  A a (100);
30
  a = a.b (A (10));
31
  if (a.f != 10)
32
    abort ();
33
 
34
  A c (10);
35
  A d (100);
36
  c = d.b (c);
37
  if (c.f != 10)
38
    abort ();
39
}

powered by: WebSVN 2.1.0

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