X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgenerics.cs;h=e9b41a64e08ab33fe63924edf89aeec83d2b0b52;hb=20ab5bfe7ae2cf84cd9e6fdad9758ded9f687ca2;hp=186fb90db91dd240624db5925aa3f9352ee9be22;hpb=4accf0d718c238b3efcd50eed6fc6f86b9ae43cd;p=mono.git diff --git a/mono/mini/generics.cs b/mono/mini/generics.cs index 186fb90db91..e9b41a64e08 100644 --- a/mono/mini/generics.cs +++ b/mono/mini/generics.cs @@ -269,7 +269,6 @@ class Tests return s.return_field () + s.return_field (); } - [Category ("!INTERPRETER")] public static int test_0_generic_get_value_optimization_vtype () { TestStruct[] arr = new TestStruct[] { new TestStruct (100, 200), new TestStruct (300, 400) }; IEnumerator enumerator = GenericClass.Y (arr); @@ -463,7 +462,6 @@ class Tests } #endif - [Category ("!INTERPRETER")] public static int test_0_ldvirtftn_generic_method () { new GenericsTests ().ldvirtftn (); @@ -490,7 +488,6 @@ class Tests // This cannot be made to work with full-aot, since there it is impossible to // statically determine that Foo.Bar is needed, the code only // references IFoo.Bar - [Category ("!INTERPRETER")] [Category ("!FULLAOT")] public static int test_0_generic_virtual_on_interfaces () { Foo.count1 = 0; @@ -516,7 +513,6 @@ class Tests return 0; } - [Category ("!INTERPRETER")] public static int test_0_generic_virtual_on_interfaces_ref () { Foo.count1 = 0; Foo.count2 = 0; @@ -556,7 +552,6 @@ class Tests Value_2 = 2 } - [Category ("!INTERPRETER")] public static int test_0_regress_550964_constrained_enum_long () { MyEnumUlong a = MyEnumUlong.Value_2; MyEnumUlong b = MyEnumUlong.Value_2; @@ -575,7 +570,6 @@ class Tests } } - [Category ("!INTERPRETER")] public static int test_0_fullaot_linq () { var allWords = new XElement [] { new XElement { Value = "one" } }; var filteredWords = allWords.Where(kw => kw.Value.StartsWith("T")); @@ -598,7 +592,6 @@ class Tests int c = ((ICollection)arr).Count; } - [Category ("!INTERPRETER")] /* Test that treating arrays as generic collections works with full-aot */ public static int test_0_fullaot_array_wrappers () { GenericsTests[] arr = new GenericsTests [10]; @@ -658,7 +651,6 @@ class Tests return typeof (T); } - [Category ("!INTERPRETER")] public static int test_0_gshared_delegate_rgctx () { Func t = new Func (get_type); @@ -668,7 +660,6 @@ class Tests return 1; } - [Category ("!INTERPRETER")] // Creating a delegate from a generic method from gshared code public static int test_0_gshared_delegate_from_gshared () { if (gshared_delegate_from_gshared () != 0) @@ -700,7 +691,6 @@ class Tests public delegate TRet Transform (TKey key, TValue value); } - [Category ("!INTERPRETER")] public static int test_0_bug_620864 () { var d = new Pair.Transform> (Pair.make_pair); @@ -757,7 +747,6 @@ class Tests return 0; } - [Category ("!INTERPRETER")] [Category ("GSHAREDVT")] public static int test_6_partial_sharing_linq () { var messages = new List (); @@ -768,7 +757,6 @@ class Tests return messages.Max(i => i.MessageID); } - [Category ("!INTERPRETER")] public static int test_0_partial_shared_method_in_nonshared_class () { var c = new Class1 (); return (c.Foo (5).GetType () == typeof (Class1)) ? 0 : 1; @@ -945,7 +933,6 @@ class Tests } } - [Category ("!INTERPRETER")] [Category ("!FULLAOT")] [Category ("!BITCODE")] public static int test_0_regress_668095_synchronized_gshared () { @@ -964,7 +951,6 @@ class Tests } } - [Category ("!INTERPRETER")] [Category ("GSHAREDVT")] static int test_0_synchronized_gshared () { var c = new SyncClass (); @@ -1001,7 +987,6 @@ class Tests } // #2155 - [Category ("!INTERPRETER")] [Category ("GSHAREDVT")] public static int test_0_fullaot_sflda_cctor () { List documents = new List(); @@ -1027,7 +1012,6 @@ class Tests static List sources = new List(); // #6112 - [Category ("!INTERPRETER")] public static int test_0_fullaot_imt () { sources.Add(null); sources.Add(null); @@ -1049,7 +1033,6 @@ class Tests class BClass : AClass { } - [Category ("!INTERPRETER")] public static int test_0_fullaot_variant_iface () { var arr = new BClass [10]; var enumerable = (IEnumerable)arr; @@ -1081,7 +1064,6 @@ class Tests } } - [Category ("!INTERPRETER")] public static int test_1_regress_constrained_iface_call_7571 () { var r = new Record [10]; Foo2.Extract (r); @@ -1092,7 +1074,6 @@ class Tests Val = 1 } - [Category ("!INTERPRETER")] public static int test_0_regress_constrained_iface_call_enum () { var r = new ConstrainedEnum [10]; return Foo3.CompareTo (r); @@ -1152,7 +1133,6 @@ class Tests } #endif - [Category ("!INTERPRETER")] public static int test_0_delegate_callvirt_fullaot () { Func f = delegate () { return "A"; }; var f2 = (Func, string>)Delegate.CreateDelegate (typeof @@ -1235,7 +1215,6 @@ class Tests return t.GetHashCode (); } - [Category ("!INTERPRETER")] public static int test_0_constrained_partial_sharing () { string s; @@ -1292,7 +1271,6 @@ class Tests static object delegate_8_args_res; - [Category ("!INTERPRETER")] public static int test_0_delegate_8_args () { delegate_8_args_res = null; Action () { + return RuntimeHelpers.IsReferenceOrContainsReferences (); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static bool is_ref_or_contains_refs_gen_ref () { + return RuntimeHelpers.IsReferenceOrContainsReferences> (); + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static bool is_ref_or_contains_refs_gen_noref () { + return RuntimeHelpers.IsReferenceOrContainsReferences> (); + } + + struct GenStruct { + T t; + } + + struct NoRefGenStruct { + } + + struct RefStruct { + string s; + } + + struct NestedRefStruct { + RefStruct r; + } + + struct NoRefStruct { + int i; + } + + public static int test_0_isreference_intrins () { + if (RuntimeHelpers.IsReferenceOrContainsReferences ()) + return 1; + if (!RuntimeHelpers.IsReferenceOrContainsReferences ()) + return 2; + if (!RuntimeHelpers.IsReferenceOrContainsReferences ()) + return 3; + if (!RuntimeHelpers.IsReferenceOrContainsReferences ()) + return 4; + if (RuntimeHelpers.IsReferenceOrContainsReferences ()) + return 5; + // Generic code + if (is_ref_or_contains_refs ()) + return 6; + // Shared code + if (!is_ref_or_contains_refs ()) + return 7; + // Complex type from shared code + if (!is_ref_or_contains_refs_gen_ref ()) + return 8; + if (is_ref_or_contains_refs_gen_ref ()) + return 9; + if (is_ref_or_contains_refs_gen_noref ()) + return 10; + + return 0; + } } #if !__MOBILE__