diff options
author | Marek Safar <marek.safar@gmail.com> | 2006-09-22 01:25:50 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2006-09-22 01:25:50 +0400 |
commit | 1e14edb557d24a07948a66f46dcd24eeac5ed466 (patch) | |
tree | 779ec4f42cc87fe6532c8e7f87b7ca7bc707fec8 /mcs/tests/gtest-289.cs | |
parent | e8d0c3a667900e68b7a312c74b8188e3128c63d0 (diff) |
New tests.
svn path=/trunk/mcs/; revision=65796
Diffstat (limited to 'mcs/tests/gtest-289.cs')
-rw-r--r-- | mcs/tests/gtest-289.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mcs/tests/gtest-289.cs b/mcs/tests/gtest-289.cs new file mode 100644 index 00000000000..c32b3babc01 --- /dev/null +++ b/mcs/tests/gtest-289.cs @@ -0,0 +1,62 @@ +// Compiler options: -optimize+
+
+using System;
+using System.Reflection;
+
+enum E
+{
+}
+
+delegate void D();
+
+class C {
+ public C () {}
+
+ int i = default (int);
+ double d = default (double);
+ char c = default (char);
+ bool b = default (bool);
+ decimal dec2 = default (decimal);
+ object o = default (object);
+ ValueType BoolVal = default (ValueType);
+ E e = default (E);
+
+ int[] a_i = default(int[]);
+ object[] a_o = default(object[]);
+ ValueType[] a_v = default(ValueType[]);
+
+ event D Ev1 = default(D);
+}
+
+class Consts
+{
+ const int i = default (int);
+ const double d = default (double);
+ const char c = default (char);
+ const bool b = default (bool);
+ const decimal dec2 = default (decimal);
+ const object o = default (object);
+ const ValueType BoolVal = default (ValueType);
+ const E e = default (E);
+
+ const int[] a_i = default(int[]);
+ const object[] a_o = default(object[]);
+ const ValueType[] a_v = default(ValueType[]);
+}
+
+class Test
+{
+ static int Main ()
+ {
+ ConstructorInfo mi = typeof(C).GetConstructors ()[0];
+ MethodBody mb = mi.GetMethodBody();
+
+ if (mb.GetILAsByteArray ().Length != 7) {
+ Console.WriteLine("Optimization failed");
+ return 3;
+ }
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}
\ No newline at end of file |