[runtime] Don't insta-fail when a faulty COM type is encountered. (#5616)
[mono.git] / mcs / tests / gtest-415.cs
index a71b5b98835f896e568bb3fd1ba9611167138cd7..4cfcd92e98f5ee9e5c2ace03ed718c5c1a68ab79 100644 (file)
@@ -1,27 +1,20 @@
-// Compiler options: -unsafe
+using System;
 
-unsafe struct S
+class Foo
 {
-       public short nData;
-       public fixed int Data [1];
-}
+       public static int Main ()
+       {
+               if (Bar (1))
+                       return 1;
 
-unsafe struct S2
-{
-       public uint Header;
-       public fixed byte Data [5];
+               if (!Bar (IntPtr.Zero))
+                       return 2;
 
-       public void Test ()
-       {
-               fixed (byte* bP = Data) {
-                       S* p = (S*) bP;
-                       p = (S*) (p->Data + p->nData);
-               }
+               return 0;
        }
 
-       public static void Main ()
+       static bool Bar<T> (T val) where T : struct
        {
-               new S2 ().Test ();
+               return val is IntPtr;
        }
 }
-