add ExcludeFromCodeCoverageAttribute
[mcs.git] / tests / test-653.cs
bloba1e930bb51e5fdf0fde54c9ea58e9d8b7c203bd2
1 // Compiler options: -unsafe
2 using System;
4 class C
6 static unsafe int Test ()
8 try {
9 uint* i = stackalloc uint[int.MaxValue];
10 uint v = 0;
11 i [v] = v;
12 i [0] = v;
13 return 1;
14 } catch (OverflowException) {
15 return 0;
19 unsafe static void Test2 ()
21 byte* b = null;
22 b = b + (byte)1;
23 b = b + (sbyte)1;
24 b = b + (short)1;
25 b = b + (int)1;
26 b = b + (long)1;
27 b = b + (ulong)1;
30 unsafe static void Test2 (sbyte sb, short s, int i, long l, ulong ul)
32 short* b = null;
33 b = b + sb;
34 b = b + s;
35 b = b + i;
36 b = b + l;
37 b = b + ul;
40 public static int Main ()
42 Test2 ();
43 Test2 (1, 2, 3, 4, 5);
44 if (Test () != 0)
45 return 1;
47 Console.WriteLine ("OK");
48 return 0;