repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove building with NOCRYPTO option
[minix3.git]
/
external
/
bsd
/
libc++
/
dist
/
libcxxrt
/
test
/
test_guard.cc
blob
1ad5a2f58134ff01874e2d8e266af9fc4af0485d
1
#include <stdio.h>
2
#include
"test.h"
3
4
static int
static_count
;
5
struct
static_struct
6
{
7
int
i
;
8
static_struct
()
9
{
10
static_count
++;
11
i
=
12
;
12
};
13
};
14
15
static
static_struct ss
;
16
17
int
init_static
(
void
)
18
{
19
static
static_struct s
;
20
return
s
.
i
;
21
}
22
23
void
test_guards
(
void
)
24
{
25
init_static
();
26
int
i
=
init_static
();
27
TEST
(
i
==
12
,
"Static initialized"
);
28
TEST
(
static_count
==
2
,
"Each static only initialized once"
);
29
}