repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
opt
/
static6.C
blob
00e76fb73503ec58d1a67e6653d0d3138b234310
1
// PR c++/31806
2
// { dg-do run }
3
// { dg-options "-O2 -fno-inline -fno-threadsafe-statics" }
4
5
extern "C" void abort(void);
6
7
struct A
8
{
9
void *d;
10
};
11
12
static const A& staticA()
13
{
14
static A s_static;
15
return s_static;
16
}
17
18
void assert_failed()
19
{
20
abort();
21
}
22
23
A testMethod()
24
{
25
static const A& s = staticA( );
26
if (&s == 0)
27
assert_failed();
28
return s;
29
}
30
31
int main()
32
{
33
testMethod();
34
return 0;
35
}