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