using System;
using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Collections;
+using System.Threading;
/*
* Regression tests for the GC support in the JIT
liveness_12_inner (1, 2, 3, 4, 5, 6, new object ());
return 0;
}
+
+ public static void liveness_13_inner (ref ArrayList arr) {
+ // The value of arr will be stored in a spill slot
+ arr.Add (alloc_obj_and_gc ());
+ }
+
+ // Liveness for byref arguments in spill slots
+ public static int test_0_liveness_13 () {
+ var arr = new ArrayList ();
+ liveness_13_inner (ref arr);
+ return 0;
+ }
+
+ static ThreadLocal<object> tls;
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ static void alloc_tls_obj () {
+ tls = new ThreadLocal<object> ();
+ tls.Value = new object ();
+ }
+
+ public static int test_0_thread_local () {
+ alloc_tls_obj ();
+ GC.Collect ();
+ Type t = tls.Value.GetType ();
+ if (t == typeof (object))
+ return 0;
+ else
+ return 1;
+ }
}
\ No newline at end of file