repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2008-09-29 Jb Evain <jbevain@novell.com>
[mcs.git]
/
tests
/
test-404.cs
blob
cbb1e323ad08b390cffa997379c8cfecc504a4e8
1
// Compiler options: -unsafe
2
3
unsafe class
X
{
4
static int
v
;
5
static int
v_calls
;
6
7
static int
*
get_v
()
8
{
9
v_calls
++;
10
fixed
(
int
*
ptr
= &
v
)
11
{
12
return
ptr
;
13
}
14
}
15
16
static int
Main
()
17
{
18
if
((*
get_v
())++ !=
0
)
19
return
1
;
20
if
(
v
!=
1
)
21
return
2
;
22
if
(
v_calls
!=
1
)
23
return
3
;
24
return
0
;
25
}
26
}