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/] [comdat1.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 " comdat1-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
inline int f ()
9
{
10
  static int i;
11
  return ++i;
12
}
13
 
14
int g ();
15
 
16
int main ()
17
{
18
  if (f() != 1
19
      || g() != 2
20
      || f() != 3)
21
    return 1;
22
  return 0;
23
}

powered by: WebSVN 2.1.0

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