projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
* Control.cs: Don't do anything in WmShowWindow if the control has been
[mono.git]
/
mcs
/
tests
/
test-474.cs
1
// Test for bug 76550 -- EmitAssign getting called
2
// on captured params.
3
4
class Z {
5
static void Main ()
6
{
7
TestPreinc (1);
8
TestPostinc (1);
9
}
10
11
delegate void X ();
12
13
static void TestPreinc (int i)
14
{
15
Assert (i, 1);
16
X x = delegate {
17
int z = ++i;
18
Assert (z, 2);
19
Assert (i, 2);
20
};
21
x ();
22
Assert (i, 2);
23
}
24
25
static void TestPostinc (int i)
26
{
27
Assert (i, 1);
28
X x = delegate {
29
int z = i++;
30
Assert (z, 1);
31
Assert (i, 2);
32
};
33
x ();
34
Assert (i, 2);
35
}
36
37
static void Assert (int a, int b)
38
{
39
if (a == b)
40
return;
41
42
throw new System.Exception ("Incorrect was: " + a + " should have been " + b + ".");
43
}
44
}