diff --git a/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs b/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs index ed9046517136..c8aa54223359 100644 --- a/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs +++ b/tests/src/CoreMangLib/cti/system/gc/gckeepalive.cs @@ -44,13 +44,13 @@ public bool PosTest1() GC.WaitForPendingFinalizers(); GC.Collect(); - GC.KeepAlive(tc); if (TestClass.m_TestInt != 1) { TestLibrary.TestFramework.LogError("001.1", "Calling KeepAlive can not prevent an object to be GCed"); TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLE] TestClass.m_TestInt = " + TestClass.m_TestInt); retVal = false; } + GC.KeepAlive(tc); } catch (Exception e) {