From: Sergey Andreenko Date: Thu, 25 Apr 2019 17:42:54 +0000 (-0700) Subject: Add a repro test. X-Git-Tag: accepted/tizen/unified/20190813.215958~42^2~386^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5decb744c05dcce3f23ec0757517711a0ecb900;p=platform%2Fupstream%2Fcoreclr.git Add a repro test. --- diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs b/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs new file mode 100644 index 0000000..3695ab2 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs @@ -0,0 +1,36 @@ +// 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.Threading; +using System.Threading.Tasks; + +// The test shows recursive assertion propogation in one statement. + +namespace GitHub_24185 +{ + public class Program + { + static int Main(string[] args) + { + try + { + throw new AggregateException(new Exception("A random exception1"), new Exception("A random exception2")); + } + catch (Exception e) + { + // Each expression in this condition checks that `e` is not null and checks its type. + // This information should be calculated once and propogated by assertion propogation. + if (!(e is AggregateException) || + !((((AggregateException)e).InnerExceptions[0] is ArgumentException) + || ((AggregateException)e).InnerExceptions[0] is AggregateException)) + { + return 100; + } + + } + return 0; + } + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.csproj new file mode 100644 index 0000000..cc72c51 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.csproj @@ -0,0 +1,33 @@ + + + + + Debug + AnyCPU + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + ..\..\ + + + + + + + False + + + + None + True + + + + + + + + + + \ No newline at end of file