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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [comdat2.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// { dg-additional-sources " comdat2-aux.cc" }
3
// { dg-options "-O" }
4
// Test that statics in inline functions are unified between
5
// translation units.  Currently we handle this by just suppressing
6
// inling and relying on unification of the function itself.
7
 
8
template 
9
struct S {
10
  static int f ()
11
  {
12
    static int i;
13
    return ++i;
14
  }
15
  S () {};
16
  ~S () {};
17
};
18
 
19
typedef S a;
20
 
21
int g ();
22
 
23
int main ()
24
{
25
  if (a::f() != 1
26
      || g() != 2
27
      || a::f() != 3)
28
    return 1;
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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