Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-928.cs
1 // Compiler options: -unsafe
2
3 using System;
4 using System.Reflection;
5 using System.Linq;
6
7 unsafe class Program
8 {
9         public static void Test ()
10         {
11                 string s = "";
12                 unsafe {
13                         fixed (char *chars = s) {
14                         }
15                 }
16         }
17
18         public static int Main ()
19         {
20                 Test ();
21
22                 var m = typeof (Program).GetMethod ("Test");
23                 var lv = m.GetMethodBody ().LocalVariables.Where (l => l.LocalType == typeof (char*)).Single ();
24                 if (lv.IsPinned)
25                         return 1;
26
27                 return 0;
28         }
29 }