Merge pull request #980 from StephenMcConnel/bug-18638
[mono.git] / mcs / tests / gtest-628.cs
1 using System;
2 using System.Threading;
3
4 class Impl<T> where T : class
5 {
6         public static object CompareExchangeImpl (TypedReference tr, object value, object comparand)
7         {
8                 return Interlocked.CompareExchange (ref __refvalue(tr, T), (T) value, (T) comparand);
9         }
10 }
11
12 class X
13 {
14         public static void Main ()
15         {
16                 var obj = "obj";
17                 var tr = __makeref (obj);
18                 Impl<string>.CompareExchangeImpl (tr, "foo", null);
19         }
20 }