summaryrefslogtreecommitdiff
path: root/tests/src/JIT/opt/Inline/tests/StructAsParam_Method.cs
blob: 122da76777830e35e00bba1146a3618a0608a63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    internal struct TheStruct
    {
        public string fieldinStruct;
    }

    internal class TestStruct
    {
        private static void StructTaker_Inline(TheStruct s)
        {
            s.fieldinStruct = "xyz";
        }

        private static int Main()
        {
            TheStruct testStruct = new TheStruct();

            testStruct.fieldinStruct = "change_xyz";

            StructTaker_Inline(testStruct);

            System.Console.WriteLine("Struct field = {0}", testStruct.fieldinStruct);

            return 100;
        }
    }
}