repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Revert "[2018-06] [System]: `MonoTlsStream` is now `IDisposable` and cleans up on...
[mono-project.git]
/
mono
/
tests
/
exception.cs
blob
c60e9a3b500f501a926bd0fdf74874ef63065da2
1
using
System
;
2
3
public class
Ex
{
4
5
int
p
;
6
7
public static int
test1
() {
8
Ex x
=
null
;
9
10
try
{
11
x
.
p
=
1
;
12
}
catch
(
NullReferenceException
) {
13
return
0
;
14
}
15
return
1
;
16
}
17
18
public static int
test
(
int
a
) {
19
int
res
;
20
int
fin
=
0
;
21
try
{
22
res
=
10
/
a
;
23
}
catch
(
DivideByZeroException ex
) {
24
if
(
fin
!=
1
)
25
res
=
34
;
26
else
27
res
=
33
;
28
}
catch
{
29
if
(
fin
!=
1
)
30
res
=
24
;
31
else
32
res
=
22
;
33
}
finally
{
34
fin
=
1
;
35
}
36
return
res
;
37
}
38
public static int
Main
() {
39
if
(
test
(
1
) !=
10
)
40
return
1
;
41
if
(
test
(
0
) !=
34
)
42
return
2
;
43
if
(
test1
() !=
0
)
44
return
3
;
45
46
return
0
;
47
}
48
}
49
50