diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2008-04-08 08:47:59 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2008-04-08 08:47:59 +0400 |
commit | 0d77d7710fcd8f412b16a867a34985df1fb0dd54 (patch) | |
tree | f4549a1383210cc1f6af49a18854ea2e66c33196 /mcs/tests/test-630.cs | |
parent | 14ba742245e3803307ddf9d9673226909a69e8e8 (diff) |
Fix mono/tests/exception4.cs
* statement.cs (ExceptionStatement, TryCatch): Revert to using
ec.NeedReturnLabel () rather emitting a 'nop'.
svn path=/trunk/mcs/; revision=100089
Diffstat (limited to 'mcs/tests/test-630.cs')
-rw-r--r-- | mcs/tests/test-630.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mcs/tests/test-630.cs b/mcs/tests/test-630.cs new file mode 100644 index 00000000000..4ac6173091e --- /dev/null +++ b/mcs/tests/test-630.cs @@ -0,0 +1,47 @@ +using System; + +public class MyEx : Exception { + public MyEx () {} +} + +public class Ex { + + public static int test (int a) { + int res; + int fin = 0; + try { + res = 10/a; + throw new MyEx (); + } catch (Exception ex) { + ex = new MyEx (); + throw; + } finally { + fin = 1; + } + return res; + } + public static int Main () { + int catched = 0; + try { + test (1); + } catch (MyEx ex) { + catched = 1; + } + if (catched != 1) + return 2; + try { + test (0); + } catch (MyEx ex) { + catched = 2; + } catch { + // we should get here because rethrow rethrows the dividebyzero ex + // not the exception assigned to the local var (a MyEx) + catched = 3; + } + if (catched != 3) + return 3; + return 0; + } +} + + |