[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / gtest-fixedbuffer-06.cs
1 // Compiler options: -unsafe
2
3 using System;
4
5 namespace Bug
6 {
7         unsafe struct Demo
8         {
9                 fixed bool test [4];
10         
11                 bool Fixed ()
12                 {
13                         fixed (bool* data_ptr = test)
14                         {
15                                 return true;
16                         }
17                 }
18                 
19                 static bool Foo (int [] data)
20                 {
21                         fixed (int* data_ptr = data)
22                         {
23                                 return data_ptr == null ? true : false;
24                         }
25                 }
26                 
27                 public static int Main ()
28                 {
29                         if (!Foo (null))
30                                 return 1;
31                         
32                         if (!Foo (new int [0]))
33                                 return 2;
34                         
35                         if (!new Demo().Fixed ())
36                                 return 3;
37                         
38                         Console.WriteLine ("OK");
39                         return 0;
40                 }
41         }
42 }
43