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
In ilasm/tests:
[mcs.git]
/
tests
/
test-anon-26.cs
blob
5a3f6a8144dc46e47cc87eaefa28a11a4bf84392
1
// Compiler options: -unsafe
2
using
System
;
3
4
delegate int
D
();
5
6
unsafe class
X
{
7
8
static int
Main
()
9
{
10
D x
=
T
(
1
);
11
12
int
v
=
x
();
13
Console
.
WriteLine
(
"Should be 2=
{0}
"
,
v
);
14
return
v
==
2
?
0
:
1
;
15
}
16
17
static
D
T
(
int
a
)
18
{
19
D d
=
delegate
{
20
int
*
x
= &
a
;
21
22
*
x
= *
x
+
1
;
23
return
*
x
;
24
};
25
26
return
d
;
27
}
28
}