Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit eecd311

Browse files
committed
Add test cases for 6 byte structs showing the various situations the
jit must handle: callee is not an inline candidate, is an inline candidate and gets inlined, or inline candidate that does not get inlined. In the case where the callee gets inlined, handle the transitive cases where the callee's returne value itself comes from a call. Add a 3 byte test case to get coverage on arm32. Add new tests to the arm32/arm64 test lists.
1 parent aabba68 commit eecd311

18 files changed

+875
-0
lines changed

tests/arm/Tests.lst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94740,3 +94740,67 @@ MaxAllowedDurationSeconds=600
9474094740
Categories=EXPECTED_PASS
9474194741
HostStyle=0
9474294742

94743+
[GitHub_18522.cmd_11903]
94744+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522\GitHub_18522.cmd
94745+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522
94746+
Expected=0
94747+
MaxAllowedDurationSeconds=600
94748+
Categories=EXPECTED_PASS
94749+
HostStyle=0
94750+
94751+
[GitHub_18522_1.cmd_11904]
94752+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_1\GitHub_18522_1.cmd
94753+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_1
94754+
Expected=0
94755+
MaxAllowedDurationSeconds=600
94756+
Categories=EXPECTED_PASS
94757+
HostStyle=0
94758+
94759+
[GitHub_18522_2.cmd_11905]
94760+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_2\GitHub_18522_2.cmd
94761+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_2
94762+
Expected=0
94763+
MaxAllowedDurationSeconds=600
94764+
Categories=EXPECTED_PASS
94765+
HostStyle=0
94766+
94767+
[GitHub_18522_3.cmd_11906]
94768+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_3\GitHub_18522_3.cmd
94769+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_3
94770+
Expected=0
94771+
MaxAllowedDurationSeconds=600
94772+
Categories=EXPECTED_PASS
94773+
HostStyle=0
94774+
94775+
[GitHub_18522_4.cmd_11907]
94776+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_4\GitHub_18522_4.cmd
94777+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_4
94778+
Expected=0
94779+
MaxAllowedDurationSeconds=600
94780+
Categories=EXPECTED_PASS
94781+
HostStyle=0
94782+
94783+
[GitHub_18522_5.cmd_11908]
94784+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_5\GitHub_18522_5.cmd
94785+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_5
94786+
Expected=0
94787+
MaxAllowedDurationSeconds=600
94788+
Categories=EXPECTED_PASS
94789+
HostStyle=0
94790+
94791+
[GitHub_18522_6.cmd_11909]
94792+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_6\GitHub_18522_6.cmd
94793+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_6
94794+
Expected=0
94795+
MaxAllowedDurationSeconds=600
94796+
Categories=EXPECTED_PASS
94797+
HostStyle=0
94798+
94799+
[GitHub_18522_7.cmd_11910]
94800+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_7\GitHub_18522_7.cmd
94801+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_7
94802+
Expected=0
94803+
MaxAllowedDurationSeconds=600
94804+
Categories=EXPECTED_PASS
94805+
HostStyle=0
94806+

tests/arm64/Tests.lst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94763,3 +94763,67 @@ Expected=0
9476394763
MaxAllowedDurationSeconds=600
9476494764
Categories=EXPECTED_PASS
9476594765
HostStyle=0
94766+
94767+
[GitHub_18522.cmd_12223]
94768+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522\GitHub_18522.cmd
94769+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522
94770+
Expected=0
94771+
MaxAllowedDurationSeconds=600
94772+
Categories=EXPECTED_PASS
94773+
HostStyle=0
94774+
94775+
[GitHub_18522_1.cmd_12224]
94776+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_1\GitHub_18522_1.cmd
94777+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_1
94778+
Expected=0
94779+
MaxAllowedDurationSeconds=600
94780+
Categories=EXPECTED_PASS
94781+
HostStyle=0
94782+
94783+
[GitHub_18522_2.cmd_12225]
94784+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_2\GitHub_18522_2.cmd
94785+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_2
94786+
Expected=0
94787+
MaxAllowedDurationSeconds=600
94788+
Categories=EXPECTED_PASS
94789+
HostStyle=0
94790+
94791+
[GitHub_18522_3.cmd_12226]
94792+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_3\GitHub_18522_3.cmd
94793+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_3
94794+
Expected=0
94795+
MaxAllowedDurationSeconds=600
94796+
Categories=EXPECTED_PASS
94797+
HostStyle=0
94798+
94799+
[GitHub_18522_4.cmd_12227]
94800+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_4\GitHub_18522_4.cmd
94801+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_4
94802+
Expected=0
94803+
MaxAllowedDurationSeconds=600
94804+
Categories=EXPECTED_PASS
94805+
HostStyle=0
94806+
94807+
[GitHub_18522_5.cmd_12228]
94808+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_5\GitHub_18522_5.cmd
94809+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_5
94810+
Expected=0
94811+
MaxAllowedDurationSeconds=600
94812+
Categories=EXPECTED_PASS
94813+
HostStyle=0
94814+
94815+
[GitHub_18522_6.cmd_12229]
94816+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_6\GitHub_18522_6.cmd
94817+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_6
94818+
Expected=0
94819+
MaxAllowedDurationSeconds=600
94820+
Categories=EXPECTED_PASS
94821+
HostStyle=0
94822+
94823+
[GitHub_18522_7.cmd_12230]
94824+
RelativePath=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_7\GitHub_18522_7.cmd
94825+
WorkingDir=JIT\Regression\JitBlue\GitHub_18522\GitHub_18522_7
94826+
Expected=0
94827+
MaxAllowedDurationSeconds=600
94828+
Categories=EXPECTED_PASS
94829+
HostStyle=0
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
7+
// Based on a program generated by Fuzzlyn
8+
9+
struct S0
10+
{
11+
public ushort F0;
12+
}
13+
14+
struct S1
15+
{
16+
public S0 F0;
17+
public ushort F1;
18+
}
19+
20+
public class GitHub_18522
21+
{
22+
static S1 s_36;
23+
24+
// When generating code for the x64 SysV ABI, the jit was
25+
// incorrectly typing the return type from M113, and so
26+
// inadvertently overwriting the F1 field of s_36 on return from
27+
// the (inlined) call.
28+
public static int Main()
29+
{
30+
s_36.F1 = 0xAA;
31+
s_36.F0 = M113();
32+
return (s_36.F1 == 0xAA ? 100 : 0);
33+
}
34+
35+
static S0 M113()
36+
{
37+
return new S0();
38+
}
39+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
10+
<OutputType>Exe</OutputType>
11+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
12+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
13+
</PropertyGroup>
14+
<!-- Default configurations to help VS understand the configurations -->
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
17+
<ItemGroup>
18+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
19+
<Visible>False</Visible>
20+
</CodeAnalysisDependentAssemblyPaths>
21+
</ItemGroup>
22+
<PropertyGroup>
23+
<DebugType></DebugType>
24+
<Optimize>True</Optimize>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<Compile Include="$(MSBuildProjectName).cs" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
34+
</Project>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
7+
// Based on
8+
// Original generated by Fuzzlyn on 2018-06-20 00:58:58
9+
// Seed: 11049252875418439527
10+
// Reduced from 97.5 KiB to 0.5 KiB
11+
// Debug: Outputs -1
12+
// Release: Outputs -65536
13+
14+
struct S0
15+
{
16+
public sbyte F0;
17+
public char F1;
18+
public ushort F2;
19+
}
20+
21+
struct S1
22+
{
23+
public short F0;
24+
public S0 F1;
25+
public S0 F2;
26+
public S0 F3;
27+
public int F4;
28+
public S1(int f4): this()
29+
{
30+
F4 = f4;
31+
}
32+
}
33+
34+
public class GitHub_18522_1
35+
{
36+
static S1 s_6;
37+
static S1[] s_13 = new S1[]{new S1(-1)};
38+
public static int Main()
39+
{
40+
// When generating code for the x64 SysV ABI, the jit was
41+
// incorrectly typing the return type from M16, and so
42+
// inadvertently overwriting the F4 field of s_13[0] on return
43+
// from the (inlined) call.
44+
s_13[0].F3 = M16();
45+
return s_13[0].F4 == -1 ? 100 : 0;
46+
}
47+
48+
static S0 M16()
49+
{
50+
return s_6.F3;
51+
}
52+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
10+
<OutputType>Exe</OutputType>
11+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
12+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
13+
</PropertyGroup>
14+
<!-- Default configurations to help VS understand the configurations -->
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
17+
<ItemGroup>
18+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
19+
<Visible>False</Visible>
20+
</CodeAnalysisDependentAssemblyPaths>
21+
</ItemGroup>
22+
<PropertyGroup>
23+
<DebugType></DebugType>
24+
<Optimize>True</Optimize>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<Compile Include="$(MSBuildProjectName).cs" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
34+
</Project>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Runtime.CompilerServices;
7+
8+
// Based on
9+
// Original generated by Fuzzlyn on 2018-06-20 00:58:58
10+
// Seed: 11049252875418439527
11+
// Reduced from 97.5 KiB to 0.5 KiB
12+
// Debug: Outputs -1
13+
// Release: Outputs -65536
14+
15+
struct S0
16+
{
17+
public sbyte F0;
18+
public char F1;
19+
public ushort F2;
20+
}
21+
22+
struct S1
23+
{
24+
public short F0;
25+
public S0 F1;
26+
public S0 F2;
27+
public S0 F3;
28+
public int F4;
29+
public S1(int f4): this()
30+
{
31+
F4 = f4;
32+
}
33+
}
34+
35+
public class GitHub_18522_2
36+
{
37+
static S1 s_6;
38+
static S1[] s_13 = new S1[]{new S1(-1)};
39+
public static int Main()
40+
{
41+
// When generating code for the x64 SysV ABI, the jit was
42+
// incorrectly typing the return type from M16, and so
43+
// inadvertently overwriting the F4 field of s_13[0] on return
44+
// from the (not inlined) call.
45+
s_13[0].F3 = M16();
46+
return s_13[0].F4 == -1 ? 100 : 0;
47+
}
48+
49+
[MethodImpl(MethodImplOptions.NoInlining)]
50+
static S0 M16()
51+
{
52+
return s_6.F3;
53+
}
54+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
10+
<OutputType>Exe</OutputType>
11+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
12+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
13+
</PropertyGroup>
14+
<!-- Default configurations to help VS understand the configurations -->
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
17+
<ItemGroup>
18+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
19+
<Visible>False</Visible>
20+
</CodeAnalysisDependentAssemblyPaths>
21+
</ItemGroup>
22+
<PropertyGroup>
23+
<DebugType></DebugType>
24+
<Optimize>True</Optimize>
25+
</PropertyGroup>
26+
<ItemGroup>
27+
<Compile Include="$(MSBuildProjectName).cs" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
34+
</Project>

0 commit comments

Comments
 (0)