From 83d07828c04758a3332f611cf54b9b9b5c371fb2 Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Fri, 19 Apr 2019 15:42:23 -0700 Subject: [PATCH] Add a repro test. --- .../JitBlue/GitHub_24114/GitHub_24114.cs | 34 ++++++++++++++++++++++ .../JitBlue/GitHub_24114/GitHub_24114.csproj | 33 +++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.cs create mode 100644 tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.csproj diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.cs b/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.cs new file mode 100644 index 0000000..67a487a --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.cs @@ -0,0 +1,34 @@ +// 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; + + +// The jit should correctly import get struct address as a first statement during the importation phase. + +namespace GitHub_24114 +{ + class Program + { + static int Main(string[] args) + { + Test(); + return 100; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Test() + { + var options = SimpleStruct.Default; + } + } + + public struct SimpleStruct + { + public static readonly SimpleStruct Default = new SimpleStruct() + { + }; + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.csproj new file mode 100644 index 0000000..95052d9 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_24114/GitHub_24114.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 + + + + + + + + + + -- 2.7.4