diff --git a/src/tests/JIT/Directed/lifetime/lifetime1.cs b/src/tests/JIT/Directed/lifetime/lifetime1.cs index 02834ffc99a2d..c463fa38a297a 100644 --- a/src/tests/JIT/Directed/lifetime/lifetime1.cs +++ b/src/tests/JIT/Directed/lifetime/lifetime1.cs @@ -53,7 +53,6 @@ public static int f2() { A a = new A(); a.F(); - a = null; // Testcase 3 Console.WriteLine(); @@ -63,6 +62,7 @@ public static int f2() Console.WriteLine("Testcase 3 FAILED"); return -1; } + GC.KeepAlive(a); return 100; }