diff options
Diffstat (limited to 'tests/src/JIT/Regression/JitBlue/GitHub_10621/GitHub_10621.cs')
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_10621/GitHub_10621.cs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_10621/GitHub_10621.cs b/tests/src/JIT/Regression/JitBlue/GitHub_10621/GitHub_10621.cs new file mode 100644 index 0000000000..9f2a4b333e --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_10621/GitHub_10621.cs @@ -0,0 +1,81 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.CompilerServices; + +class GitHub_10621 +{ + [MethodImpl(MethodImplOptions.NoInlining)] + static int F(int x) + { + return x * x; + } + + // An empty try with nested try finallys where + // the inner finally cannot be cloned. + public static int Main() + { + int x = 0; + try { + // empty + } + finally { + try { + for (int i = 0; i < 11; i++) { + x += F(i); + } + } + finally { + + x -= 81; + + try { + // empty + } + finally + { + x -= 64; + try { + x -= 49; + } + finally { + try { + // empty + } + finally { + x -= 36; + try { + x -= 25; + } + finally { + try { + // empty + } + finally + { + x -= 16; + try { + x -= 9; + } + finally { + try { + // empty + } + finally { + x -= 4; + } + } + } + } + } + } + } + } + } + + return x - 1; + } +} + |