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/] [g++.dg/] [other/] [init2.C] - Blame information for rev 308

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

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2001 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 20 Dec 2001 
5
 
6
// PR 160. Wrong code emitted for some reference initializers.
7
 
8
void Foo ()
9
{
10
}
11
 
12
int fail;
13
 
14
class C
15
{
16
  public:
17
  int m;
18
  int &r;
19
 
20
  C () ;
21
};
22
 
23
C::C ()
24
  : m (1), r ((Foo (), m))
25
{
26
  m = 10;
27
 
28
  if (r != m)
29
    fail = 1;
30
  else if (&m != &r)
31
    fail = 2;
32
}
33
int main ()
34
{
35
  int m (1);
36
  int &r ((Foo (),m));
37
 
38
  m = 10;
39
  if (r != m)
40
    fail = 3;
41
  else if (&r != &m)
42
    fail = 4;
43
 
44
  if (!fail)
45
    {
46
      C c;
47
    }
48
  return fail;
49
}

powered by: WebSVN 2.1.0

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