2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / comdat1.C
bloba60c865935cc40b413726975c8ea4e512ad24aae
1 // { 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.
8 inline int f ()
10   static int i;
11   return ++i;
14 int g ();
16 int main ()
18   if (f() != 1
19       || g() != 2
20       || f() != 3)
21     return 1;
22   return 0;