[runtime] Overwrite stacktrace for exception on re-throw. Fixes #1856.
[mono.git] / mono / tests / cas / demand / selfassert.cs
1 using System;
2 using System.Security;
3 using System.Security.Permissions;
4
5 public class Program {
6
7         [SecurityPermission (SecurityAction.Assert, UnmanagedCode=true)]
8         [SecurityPermission (SecurityAction.Demand, UnmanagedCode=true)]
9         static int Test ()
10         {
11                 return 1;
12         }
13
14         [SecurityPermission (SecurityAction.Deny, UnmanagedCode=true)]
15         static int Main ()
16         {
17                 int result = 2;
18                 try {
19                         result = Test ();
20                         Console.WriteLine ("*1* Unexpected call to Test");
21                 }
22                 catch (SecurityException se) {
23                         result = 0;
24                         Console.WriteLine ("*0* Expected SecurityException\n{0}", se);
25                 }
26                 return result;
27         }
28 }