repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
comdat1.C
blob
a60c865935cc40b413726975c8ea4e512ad24aae
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
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
}