repo_name
stringclasses 6
values | pr_number
int64 512
78.9k
| pr_title
stringlengths 3
144
| pr_description
stringlengths 0
30.3k
| author
stringlengths 2
21
| date_created
timestamp[ns, tz=UTC] | date_merged
timestamp[ns, tz=UTC] | previous_commit
stringlengths 40
40
| pr_commit
stringlengths 40
40
| query
stringlengths 17
30.4k
| filepath
stringlengths 9
210
| before_content
stringlengths 0
112M
| after_content
stringlengths 0
112M
| label
int64 -1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b34945/b34945.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
namespace DefaultNamespace
{
using System;
public struct X0
{
public int X0_0;
public int X0_4;
public int X0_8;
public int X0_C;
}
public struct X1
{
/*public X0 X1_0;
public X0 X1_1;
public X0 X1_2;
public X0 X1_3;
public X0 X1_4;
public X0 X1_5;
public X0 X1_6;
public X0 X1_7;*/
public X0 X1_8;
public X0 X1_9;
public X0 X1_A;
public X0 X1_B;
public X0 X1_C;
public X0 X1_D;
public X0 X1_E;
public X0 X1_F;
}
public struct X2
{
public X1 X2_0;
public X1 X2_1;
public X1 X2_2;
public X1 X2_3;
public X1 X2_4;
public X1 X2_5;
public X1 X2_6;
public X1 X2_7;
/*public X1 X2_8;
public X1 X2_9;
public X1 X2_A;
public X1 X2_B;
public X1 X2_C;
public X1 X2_D;
public X1 X2_E;
public X1 X2_F;*/
}
public struct X3
{
public X2 X3_0;
public X2 X3_1;
public X2 X3_2;
public X2 X3_3;
/*public X2 X3_4;
public X2 X3_5;
public X2 X3_6;
public X2 X3_7;
public X2 X3_8;
public X2 X3_9;
public X2 X3_A;
public X2 X3_B;
public X2 X3_C;
public X2 X3_D;
public X2 X3_E;
public X2 X3_F;*/
}
public struct X4
{
public X3 X4_0;
public X3 X4_1;
public X3 X4_2;
public X3 X4_3;
public X3 X4_4;
public X3 X4_5;
public X3 X4_6;
/*public X3 X4_7;
public X3 X4_8;
public X3 X4_9;
public X3 X4_A;
public X3 X4_B;
public X3 X4_C;
public X3 X4_D;
public X3 X4_E;
public X3 X4_F;*/
}
public struct X5
{
public X4 X5_0;
public X4 X5_1;
/*
public X4 X5_2;
public X4 X5_3;
public X4 X5_4;
public X4 X5_5;
public X4 X5_6;
public X4 X5_7;
public X4 X5_8;
public X4 X5_9;
public X4 X5_A;
public X4 X5_B;
public X4 X5_C;
public X4 X5_D;
public X4 X5_E;
public X4 X5_F;
*/
}
/*
public struct X6
{
public X5 X6_0;
public X5 X6_1;
public X5 X6_2;
public X5 X6_3;
public X5 X6_4; // ldfld with NULL object
public X5 X6_5;
public X5 X6_6;
public X5 X6_7;
public X5 X6_8;
public X5 X6_9;
public X5 X6_A;
public X5 X6_B;
public X5 X6_C;
public X5 X6_D;
public X5 X6_E;
public X5 X6_F;
}
public struct X7
{
public X6 X7_0;
public X6 X7_1;
public X6 X7_2;
public X6 X7_3;
public X6 X7_4;
public X6 X7_5;
public X6 X7_6;
public X6 X7_7;
public X6 X7_8;
public X6 X7_9;
public X6 X7_A;
public X6 X7_B;
public X6 X7_C;
public X6 X7_D;
public X6 X7_E;
public X6 X7_F;
}
*/
class Foo
{
public static int Read(ref int x)
{
return x;
}
public static int Main()
{
int result = 0;
try
{
// ldflda with NULL object
result += Read(ref Base.mem.X5_1.X4_6.X3_3.X2_7.X1_8.X0_0);
// ldfld with NULL object
result += Base.mem.X5_1.X4_6.X3_3.X2_7.X1_8.X0_0;
}
catch (NullReferenceException)
{
return 100;
}
return 1;
}
public static Foo Base = null;
public X5 mem;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
namespace DefaultNamespace
{
using System;
public struct X0
{
public int X0_0;
public int X0_4;
public int X0_8;
public int X0_C;
}
public struct X1
{
/*public X0 X1_0;
public X0 X1_1;
public X0 X1_2;
public X0 X1_3;
public X0 X1_4;
public X0 X1_5;
public X0 X1_6;
public X0 X1_7;*/
public X0 X1_8;
public X0 X1_9;
public X0 X1_A;
public X0 X1_B;
public X0 X1_C;
public X0 X1_D;
public X0 X1_E;
public X0 X1_F;
}
public struct X2
{
public X1 X2_0;
public X1 X2_1;
public X1 X2_2;
public X1 X2_3;
public X1 X2_4;
public X1 X2_5;
public X1 X2_6;
public X1 X2_7;
/*public X1 X2_8;
public X1 X2_9;
public X1 X2_A;
public X1 X2_B;
public X1 X2_C;
public X1 X2_D;
public X1 X2_E;
public X1 X2_F;*/
}
public struct X3
{
public X2 X3_0;
public X2 X3_1;
public X2 X3_2;
public X2 X3_3;
/*public X2 X3_4;
public X2 X3_5;
public X2 X3_6;
public X2 X3_7;
public X2 X3_8;
public X2 X3_9;
public X2 X3_A;
public X2 X3_B;
public X2 X3_C;
public X2 X3_D;
public X2 X3_E;
public X2 X3_F;*/
}
public struct X4
{
public X3 X4_0;
public X3 X4_1;
public X3 X4_2;
public X3 X4_3;
public X3 X4_4;
public X3 X4_5;
public X3 X4_6;
/*public X3 X4_7;
public X3 X4_8;
public X3 X4_9;
public X3 X4_A;
public X3 X4_B;
public X3 X4_C;
public X3 X4_D;
public X3 X4_E;
public X3 X4_F;*/
}
public struct X5
{
public X4 X5_0;
public X4 X5_1;
/*
public X4 X5_2;
public X4 X5_3;
public X4 X5_4;
public X4 X5_5;
public X4 X5_6;
public X4 X5_7;
public X4 X5_8;
public X4 X5_9;
public X4 X5_A;
public X4 X5_B;
public X4 X5_C;
public X4 X5_D;
public X4 X5_E;
public X4 X5_F;
*/
}
/*
public struct X6
{
public X5 X6_0;
public X5 X6_1;
public X5 X6_2;
public X5 X6_3;
public X5 X6_4; // ldfld with NULL object
public X5 X6_5;
public X5 X6_6;
public X5 X6_7;
public X5 X6_8;
public X5 X6_9;
public X5 X6_A;
public X5 X6_B;
public X5 X6_C;
public X5 X6_D;
public X5 X6_E;
public X5 X6_F;
}
public struct X7
{
public X6 X7_0;
public X6 X7_1;
public X6 X7_2;
public X6 X7_3;
public X6 X7_4;
public X6 X7_5;
public X6 X7_6;
public X6 X7_7;
public X6 X7_8;
public X6 X7_9;
public X6 X7_A;
public X6 X7_B;
public X6 X7_C;
public X6 X7_D;
public X6 X7_E;
public X6 X7_F;
}
*/
class Foo
{
public static int Read(ref int x)
{
return x;
}
public static int Main()
{
int result = 0;
try
{
// ldflda with NULL object
result += Read(ref Base.mem.X5_1.X4_6.X3_3.X2_7.X1_8.X0_0);
// ldfld with NULL object
result += Base.mem.X5_1.X4_6.X3_3.X2_7.X1_8.X0_0;
}
catch (NullReferenceException)
{
return 100;
}
return 1;
}
public static Foo Base = null;
public X5 mem;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.ObjectModel/tests/System/ComponentModel/PropertyChangedEventArgsTests.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.ComponentModel.Tests
{
public class PropertyChangedEventArgsTests
{
[Theory]
[InlineData(null)]
[InlineData("")]
[InlineData("propertyName")]
public void Ctor_String(string propertyName)
{
var e = new PropertyChangedEventArgs(propertyName);
Assert.Equal(propertyName, e.PropertyName);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.ComponentModel.Tests
{
public class PropertyChangedEventArgsTests
{
[Theory]
[InlineData(null)]
[InlineData("")]
[InlineData("propertyName")]
public void Ctor_String(string propertyName)
{
var e = new PropertyChangedEventArgs(propertyName);
Assert.Equal(propertyName, e.PropertyName);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Methodical/MDArray/InnerProd/stringarr_cs_ro.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="stringarr.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="stringarr.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Formats.Asn1/tests/Writer/WriteGeneralizedTime.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Xunit;
namespace System.Formats.Asn1.Tests.Writer
{
public class WriteGeneralizedTime : Asn1WriterTests
{
public static IEnumerable<object[]> TestCases { get; } = new object[][]
{
new object[]
{
new DateTimeOffset(2017, 10, 16, 8, 24, 3, TimeSpan.FromHours(-7)),
false,
"0F32303137313031363135323430335A",
},
new object[]
{
new DateTimeOffset(1817, 10, 16, 21, 24, 3, TimeSpan.FromHours(6)),
false,
"0F31383137313031363135323430335A",
},
new object[]
{
new DateTimeOffset(3000, 1, 1, 0, 0, 0, TimeSpan.Zero),
false,
"0F33303030303130313030303030305A",
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 999, TimeSpan.Zero),
false,
"1331393939313233313233353935392E3939395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 999, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 880, TimeSpan.Zero),
false,
"1231393939313233313233353935392E38385A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 880, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 700, TimeSpan.Zero),
false,
"1131393939313233313233353935392E375A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 700, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 123, TimeSpan.Zero) + TimeSpan.FromTicks(4567),
false,
"1731393939313233313233353935392E313233343536375A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 123, TimeSpan.Zero) + TimeSpan.FromTicks(4567),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 12, TimeSpan.Zero) + TimeSpan.FromTicks(3450),
false,
"1631393939313233313233353935392E3031323334355A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 12, TimeSpan.Zero) + TimeSpan.FromTicks(3450),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 1, TimeSpan.Zero) + TimeSpan.FromTicks(2300),
false,
"1531393939313233313233353935392E30303132335A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 1, TimeSpan.Zero) + TimeSpan.FromTicks(2300),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 0, TimeSpan.Zero) + TimeSpan.FromTicks(1000),
false,
"1431393939313233313233353935392E303030315A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 0, TimeSpan.Zero) + TimeSpan.FromTicks(1000),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, TimeSpan.Zero) + TimeSpan.FromTicks(1),
false,
"1731393939313233313233353935392E303030303030315A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, TimeSpan.Zero) + TimeSpan.FromTicks(1),
true,
"0F31393939313233313233353935395A"
},
};
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_BER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds: omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_BER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
Asn1Tag tag = new Asn1Tag(TagClass.Application, 11);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_CER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.CER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_CER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.CER);
Asn1Tag tag = new Asn1Tag(TagClass.Private, 95);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_DER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_DER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
Asn1Tag tag = new Asn1Tag(TagClass.ContextSpecific, 3);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[InlineData(AsnEncodingRules.BER, false)]
[InlineData(AsnEncodingRules.CER, false)]
[InlineData(AsnEncodingRules.DER, false)]
[InlineData(AsnEncodingRules.BER, true)]
[InlineData(AsnEncodingRules.CER, true)]
[InlineData(AsnEncodingRules.DER, true)]
public void VerifyWriteGeneralizedTime_Null(
AsnEncodingRules ruleSet,
bool omitFractionalSeconds)
{
AsnWriter writer = new AsnWriter(ruleSet);
AssertExtensions.Throws<ArgumentException>(
"tag",
() => writer.WriteGeneralizedTime(DateTimeOffset.Now, omitFractionalSeconds, Asn1Tag.Null));
}
[Theory]
[InlineData(AsnEncodingRules.BER)]
[InlineData(AsnEncodingRules.CER)]
[InlineData(AsnEncodingRules.DER)]
public void VerifyWriteGeneralizedTime_IgnoresConstructed(AsnEncodingRules ruleSet)
{
AsnWriter writer = new AsnWriter(ruleSet);
DateTimeOffset value = new DateTimeOffset(2017, 11, 16, 17, 35, 1, TimeSpan.Zero);
writer.WriteGeneralizedTime(value, tag: new Asn1Tag(UniversalTagNumber.GeneralizedTime, true));
writer.WriteGeneralizedTime(value, tag: new Asn1Tag(TagClass.ContextSpecific, 3, true));
Verify(writer, "180F32303137313131363137333530315A" + "830F32303137313131363137333530315A");
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Xunit;
namespace System.Formats.Asn1.Tests.Writer
{
public class WriteGeneralizedTime : Asn1WriterTests
{
public static IEnumerable<object[]> TestCases { get; } = new object[][]
{
new object[]
{
new DateTimeOffset(2017, 10, 16, 8, 24, 3, TimeSpan.FromHours(-7)),
false,
"0F32303137313031363135323430335A",
},
new object[]
{
new DateTimeOffset(1817, 10, 16, 21, 24, 3, TimeSpan.FromHours(6)),
false,
"0F31383137313031363135323430335A",
},
new object[]
{
new DateTimeOffset(3000, 1, 1, 0, 0, 0, TimeSpan.Zero),
false,
"0F33303030303130313030303030305A",
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 999, TimeSpan.Zero),
false,
"1331393939313233313233353935392E3939395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 999, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 880, TimeSpan.Zero),
false,
"1231393939313233313233353935392E38385A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 880, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 700, TimeSpan.Zero),
false,
"1131393939313233313233353935392E375A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 700, TimeSpan.Zero),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 123, TimeSpan.Zero) + TimeSpan.FromTicks(4567),
false,
"1731393939313233313233353935392E313233343536375A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 123, TimeSpan.Zero) + TimeSpan.FromTicks(4567),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 12, TimeSpan.Zero) + TimeSpan.FromTicks(3450),
false,
"1631393939313233313233353935392E3031323334355A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 12, TimeSpan.Zero) + TimeSpan.FromTicks(3450),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 1, TimeSpan.Zero) + TimeSpan.FromTicks(2300),
false,
"1531393939313233313233353935392E30303132335A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 1, TimeSpan.Zero) + TimeSpan.FromTicks(2300),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 0, TimeSpan.Zero) + TimeSpan.FromTicks(1000),
false,
"1431393939313233313233353935392E303030315A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, 0, TimeSpan.Zero) + TimeSpan.FromTicks(1000),
true,
"0F31393939313233313233353935395A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, TimeSpan.Zero) + TimeSpan.FromTicks(1),
false,
"1731393939313233313233353935392E303030303030315A"
},
new object[]
{
new DateTimeOffset(1999, 12, 31, 23, 59, 59, TimeSpan.Zero) + TimeSpan.FromTicks(1),
true,
"0F31393939313233313233353935395A"
},
};
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_BER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds: omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_BER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.BER);
Asn1Tag tag = new Asn1Tag(TagClass.Application, 11);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_CER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.CER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_CER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.CER);
Asn1Tag tag = new Asn1Tag(TagClass.Private, 95);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_DER(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
writer.WriteGeneralizedTime(input, omitFractionalSeconds);
Verify(writer, "18" + expectedHexPayload);
}
[Theory]
[MemberData(nameof(TestCases))]
public void VerifyWriteGeneralizedTime_DER_CustomTag(
DateTimeOffset input,
bool omitFractionalSeconds,
string expectedHexPayload)
{
AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
Asn1Tag tag = new Asn1Tag(TagClass.ContextSpecific, 3);
writer.WriteGeneralizedTime(input, omitFractionalSeconds, tag);
Verify(writer, Stringify(tag) + expectedHexPayload);
}
[Theory]
[InlineData(AsnEncodingRules.BER, false)]
[InlineData(AsnEncodingRules.CER, false)]
[InlineData(AsnEncodingRules.DER, false)]
[InlineData(AsnEncodingRules.BER, true)]
[InlineData(AsnEncodingRules.CER, true)]
[InlineData(AsnEncodingRules.DER, true)]
public void VerifyWriteGeneralizedTime_Null(
AsnEncodingRules ruleSet,
bool omitFractionalSeconds)
{
AsnWriter writer = new AsnWriter(ruleSet);
AssertExtensions.Throws<ArgumentException>(
"tag",
() => writer.WriteGeneralizedTime(DateTimeOffset.Now, omitFractionalSeconds, Asn1Tag.Null));
}
[Theory]
[InlineData(AsnEncodingRules.BER)]
[InlineData(AsnEncodingRules.CER)]
[InlineData(AsnEncodingRules.DER)]
public void VerifyWriteGeneralizedTime_IgnoresConstructed(AsnEncodingRules ruleSet)
{
AsnWriter writer = new AsnWriter(ruleSet);
DateTimeOffset value = new DateTimeOffset(2017, 11, 16, 17, 35, 1, TimeSpan.Zero);
writer.WriteGeneralizedTime(value, tag: new Asn1Tag(UniversalTagNumber.GeneralizedTime, true));
writer.WriteGeneralizedTime(value, tag: new Asn1Tag(TagClass.ContextSpecific, 3, true));
Verify(writer, "180F32303137313131363137333530315A" + "830F32303137313131363137333530315A");
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Globalization.Calendars/tests/System/Globalization/UmAlQuraCalendarTests.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Globalization.Tests
{
public class UmAlQuraCalendarTests : CalendarTestBase
{
public override Calendar Calendar => new UmAlQuraCalendar();
public override DateTime MinSupportedDateTime => new DateTime(1900, 04, 30);
public override DateTime MaxSupportedDateTime => new DateTime(2077, 11, 16, 23, 59, 59).AddTicks(9999999);
public override CalendarAlgorithmType AlgorithmType => CalendarAlgorithmType.LunarCalendar;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Globalization.Tests
{
public class UmAlQuraCalendarTests : CalendarTestBase
{
public override Calendar Calendar => new UmAlQuraCalendar();
public override DateTime MinSupportedDateTime => new DateTime(1900, 04, 30);
public override DateTime MaxSupportedDateTime => new DateTime(2077, 11, 16, 23, 59, 59).AddTicks(9999999);
public override CalendarAlgorithmType AlgorithmType => CalendarAlgorithmType.LunarCalendar;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Management/tests/System/Management/ManagementObjectSearcherTests.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Linq;
using Xunit;
namespace System.Management.Tests
{
public class ManagementObjectSearcherTests
{
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34689", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public void Dynamic_Instances()
{
using (var searcher = new ManagementObjectSearcher())
{
const string targetClass = "Win32_Process";
var selectQuery = new SelectQuery(targetClass);
searcher.Query = selectQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
foreach (ManagementObject instance in instances)
Assert.Equal(targetClass, instance.Path.ClassName);
}
}
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[OuterLoop]
public void Related_Instances()
{
using (var searcher = new ManagementObjectSearcher())
{
var relatedObjectQuery = new RelatedObjectQuery($"Win32_LogicalDisk.DeviceID='{WmiTestHelper.SystemDriveId}'");
searcher.Query = relatedObjectQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
string[] expectedAssociatedInstanceClasses =
{
"Win32_Directory", "Win32_DiskPartition", "Win32_ComputerSystem", "Win32_QuotaSetting", "Win32_SystemAccount", "Win32_Group"
};
foreach (ManagementObject instance in instances)
Assert.True(expectedAssociatedInstanceClasses.Contains(instance.Path.ClassName), $"Unexpected instance of class {instance.Path.ClassName}");
}
}
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[OuterLoop]
public void Relationship_Classes()
{
using (var searcher = new ManagementObjectSearcher())
{
var relationshipQuery = new RelationshipQuery($"Win32_LogicalDisk.DeviceID='{WmiTestHelper.SystemDriveId}'");
searcher.Query = relationshipQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
string[] expectedReferenceClasses =
{
"Win32_LogicalDiskRootDirectory", "Win32_LogicalDiskToPartition", "Win32_SystemDevices", "Win32_VolumeQuotaSetting", "Win32_DiskQuota"
};
foreach (ManagementObject instance in instances)
Assert.True(expectedReferenceClasses.Contains(instance.Path.ClassName), $"Unexpected instance of class {instance.Path.ClassName}");
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Linq;
using Xunit;
namespace System.Management.Tests
{
public class ManagementObjectSearcherTests
{
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34689", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public void Dynamic_Instances()
{
using (var searcher = new ManagementObjectSearcher())
{
const string targetClass = "Win32_Process";
var selectQuery = new SelectQuery(targetClass);
searcher.Query = selectQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
foreach (ManagementObject instance in instances)
Assert.Equal(targetClass, instance.Path.ClassName);
}
}
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[OuterLoop]
public void Related_Instances()
{
using (var searcher = new ManagementObjectSearcher())
{
var relatedObjectQuery = new RelatedObjectQuery($"Win32_LogicalDisk.DeviceID='{WmiTestHelper.SystemDriveId}'");
searcher.Query = relatedObjectQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
string[] expectedAssociatedInstanceClasses =
{
"Win32_Directory", "Win32_DiskPartition", "Win32_ComputerSystem", "Win32_QuotaSetting", "Win32_SystemAccount", "Win32_Group"
};
foreach (ManagementObject instance in instances)
Assert.True(expectedAssociatedInstanceClasses.Contains(instance.Path.ClassName), $"Unexpected instance of class {instance.Path.ClassName}");
}
}
[ConditionalFact(typeof(WmiTestHelper), nameof(WmiTestHelper.IsWmiSupported))]
[OuterLoop]
public void Relationship_Classes()
{
using (var searcher = new ManagementObjectSearcher())
{
var relationshipQuery = new RelationshipQuery($"Win32_LogicalDisk.DeviceID='{WmiTestHelper.SystemDriveId}'");
searcher.Query = relationshipQuery;
ManagementObjectCollection instances = searcher.Get();
Assert.True(instances.Count > 0);
string[] expectedReferenceClasses =
{
"Win32_LogicalDiskRootDirectory", "Win32_LogicalDiskToPartition", "Win32_SystemDevices", "Win32_VolumeQuotaSetting", "Win32_DiskQuota"
};
foreach (ManagementObject instance in instances)
Assert.True(expectedReferenceClasses.Contains(instance.Path.ClassName), $"Unexpected instance of class {instance.Path.ClassName}");
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/Scenarios/GCSimulator/GCSimulator_240.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GCStressIncompatible>true</GCStressIncompatible>
<CLRTestExecutionArguments>-t 1 -tp 0 -dz 17 -sdz 8500 -dc 10000 -sdc 5000 -lt 5 -f -dp 0.4 -dw 0.0</CLRTestExecutionArguments>
<IsGCSimulatorTest>true</IsGCSimulatorTest>
<CLRTestProjectToRun>GCSimulator.csproj</CLRTestProjectToRun>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="GCSimulator.cs" />
<Compile Include="lifetimefx.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GCStressIncompatible>true</GCStressIncompatible>
<CLRTestExecutionArguments>-t 1 -tp 0 -dz 17 -sdz 8500 -dc 10000 -sdc 5000 -lt 5 -f -dp 0.4 -dw 0.0</CLRTestExecutionArguments>
<IsGCSimulatorTest>true</IsGCSimulatorTest>
<CLRTestProjectToRun>GCSimulator.csproj</CLRTestProjectToRun>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="GCSimulator.cs" />
<Compile Include="lifetimefx.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/Stress/Tests/ThdTreeGrowingObj.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestKind>BuildOnly</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="ThdTreeGrowingObj.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestKind>BuildOnly</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="ThdTreeGrowingObj.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using Microsoft.Internal;
using Microsoft.Internal.Collections;
namespace System.ComponentModel.Composition.Primitives
{
/// <summary>
/// Defines the <see langword="abstract"/> base class for composable part catalogs, which produce
/// and return <see cref="ComposablePartDefinition"/> objects.
/// </summary>
/// <remarks>
/// This type is thread safe.
/// </remarks>
[DebuggerTypeProxy(typeof(ComposablePartCatalogDebuggerProxy))]
public abstract class ComposablePartCatalog : IEnumerable<ComposablePartDefinition>, IDisposable
{
private bool _isDisposed;
private volatile IQueryable<ComposablePartDefinition>? _queryableParts;
internal static readonly List<Tuple<ComposablePartDefinition, ExportDefinition>> _EmptyExportsList = new List<Tuple<ComposablePartDefinition, ExportDefinition>>();
/// <summary>
/// Initializes a new instance of the <see cref="ComposablePartCatalog"/> class.
/// </summary>
protected ComposablePartCatalog()
{
}
/// <summary>
/// Gets the part definitions of the catalog.
/// </summary>
/// <value>
/// A <see cref="IQueryable{T}"/> of <see cref="ComposablePartDefinition"/> objects of the
/// <see cref="ComposablePartCatalog"/>.
/// </value>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ComposablePartCatalog"/> has been disposed of.
/// </exception>
/// <remarks>
/// <note type="inheritinfo">
/// Overriders of this property should never return <see langword="null"/>.
/// </note>
/// </remarks>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
public virtual IQueryable<ComposablePartDefinition> Parts
{
get
{
ThrowIfDisposed();
if (_queryableParts == null)
{
// Guarantee one time only set _queryableParts
var p = this.AsQueryable();
Interlocked.CompareExchange(ref _queryableParts, p, null);
if (_queryableParts == null)
{
throw new Exception(SR.Diagnostic_InternalExceptionMessage);
}
}
return _queryableParts;
}
}
/// <summary>
/// Returns the export definitions that match the constraint defined by the specified definition.
/// </summary>
/// <param name="definition">
/// The <see cref="ImportDefinition"/> that defines the conditions of the
/// <see cref="ExportDefinition"/> objects to return.
/// </param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> of <see cref="Tuple{T1, T2}"/> containing the
/// <see cref="ExportDefinition"/> objects and their associated
/// <see cref="ComposablePartDefinition"/> for objects that match the constraint defined
/// by <paramref name="definition"/>.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="definition"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ComposablePartCatalog"/> has been disposed of.
/// </exception>
/// <remarks>
/// <note type="inheritinfo">
/// Overriders of this property should never return <see langword="null"/>, if no
/// <see cref="ExportDefinition"/> match the conditions defined by
/// <paramref name="definition"/>, return an empty <see cref="IEnumerable{T}"/>.
/// </note>
/// </remarks>
public virtual IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
{
ThrowIfDisposed();
Requires.NotNull(definition, nameof(definition));
List<Tuple<ComposablePartDefinition, ExportDefinition>>? exports = null;
var candidateParts = GetCandidateParts(definition);
if (candidateParts != null)
{
foreach (var part in candidateParts)
{
if (part.TryGetExports(definition, out Tuple<ComposablePartDefinition, ExportDefinition>? singleMatch, out IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>>? multipleMatches))
{
exports = exports.FastAppendToListAllowNulls(singleMatch, multipleMatches);
}
}
}
Debug.Assert(exports != null || _EmptyExportsList != null);
return exports ?? _EmptyExportsList;
}
internal virtual IEnumerable<ComposablePartDefinition>? GetCandidateParts(ImportDefinition definition)
{
return this;
}
/// <summary>
/// Releases the unmanaged and managed resources used by the <see cref="ComposablePartCatalog"/>.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
_isDisposed = true;
}
[DebuggerStepThrough]
private void ThrowIfDisposed()
{
if (_isDisposed)
{
throw ExceptionBuilder.CreateObjectDisposed(this);
}
}
//
// If neither Parts nor GetEnumerator() is overriden then return an empty list
// If GetEnumerator is overridden this code should not be invoked: ReferenceAssemblies mark it as Abstract or Not present
// We verify whether Parts is overriden by seeing if the object returns matched the one cached for this instance
// Note: a query object is only cached if Parts is invoked on a catalog which did not implement it
// Because reference assemblies do not expose Parts and we no longer use it, it should not get invoked by 3rd parties
// Because the reference assemblies mark GetEnumerator as Abstract 3rd party code should not lack an implementation
// That implementation should not try to call this implementation
// Our code doies delegate to Parts in the DebuggerProxies of course.
//
public virtual IEnumerator<ComposablePartDefinition> GetEnumerator()
{
var parts = Parts;
if (object.ReferenceEquals(parts, _queryableParts))
{
return Enumerable.Empty<ComposablePartDefinition>().GetEnumerator();
}
return parts.GetEnumerator();
}
Collections.IEnumerator Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using Microsoft.Internal;
using Microsoft.Internal.Collections;
namespace System.ComponentModel.Composition.Primitives
{
/// <summary>
/// Defines the <see langword="abstract"/> base class for composable part catalogs, which produce
/// and return <see cref="ComposablePartDefinition"/> objects.
/// </summary>
/// <remarks>
/// This type is thread safe.
/// </remarks>
[DebuggerTypeProxy(typeof(ComposablePartCatalogDebuggerProxy))]
public abstract class ComposablePartCatalog : IEnumerable<ComposablePartDefinition>, IDisposable
{
private bool _isDisposed;
private volatile IQueryable<ComposablePartDefinition>? _queryableParts;
internal static readonly List<Tuple<ComposablePartDefinition, ExportDefinition>> _EmptyExportsList = new List<Tuple<ComposablePartDefinition, ExportDefinition>>();
/// <summary>
/// Initializes a new instance of the <see cref="ComposablePartCatalog"/> class.
/// </summary>
protected ComposablePartCatalog()
{
}
/// <summary>
/// Gets the part definitions of the catalog.
/// </summary>
/// <value>
/// A <see cref="IQueryable{T}"/> of <see cref="ComposablePartDefinition"/> objects of the
/// <see cref="ComposablePartCatalog"/>.
/// </value>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ComposablePartCatalog"/> has been disposed of.
/// </exception>
/// <remarks>
/// <note type="inheritinfo">
/// Overriders of this property should never return <see langword="null"/>.
/// </note>
/// </remarks>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
public virtual IQueryable<ComposablePartDefinition> Parts
{
get
{
ThrowIfDisposed();
if (_queryableParts == null)
{
// Guarantee one time only set _queryableParts
var p = this.AsQueryable();
Interlocked.CompareExchange(ref _queryableParts, p, null);
if (_queryableParts == null)
{
throw new Exception(SR.Diagnostic_InternalExceptionMessage);
}
}
return _queryableParts;
}
}
/// <summary>
/// Returns the export definitions that match the constraint defined by the specified definition.
/// </summary>
/// <param name="definition">
/// The <see cref="ImportDefinition"/> that defines the conditions of the
/// <see cref="ExportDefinition"/> objects to return.
/// </param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> of <see cref="Tuple{T1, T2}"/> containing the
/// <see cref="ExportDefinition"/> objects and their associated
/// <see cref="ComposablePartDefinition"/> for objects that match the constraint defined
/// by <paramref name="definition"/>.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="definition"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The <see cref="ComposablePartCatalog"/> has been disposed of.
/// </exception>
/// <remarks>
/// <note type="inheritinfo">
/// Overriders of this property should never return <see langword="null"/>, if no
/// <see cref="ExportDefinition"/> match the conditions defined by
/// <paramref name="definition"/>, return an empty <see cref="IEnumerable{T}"/>.
/// </note>
/// </remarks>
public virtual IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>> GetExports(ImportDefinition definition)
{
ThrowIfDisposed();
Requires.NotNull(definition, nameof(definition));
List<Tuple<ComposablePartDefinition, ExportDefinition>>? exports = null;
var candidateParts = GetCandidateParts(definition);
if (candidateParts != null)
{
foreach (var part in candidateParts)
{
if (part.TryGetExports(definition, out Tuple<ComposablePartDefinition, ExportDefinition>? singleMatch, out IEnumerable<Tuple<ComposablePartDefinition, ExportDefinition>>? multipleMatches))
{
exports = exports.FastAppendToListAllowNulls(singleMatch, multipleMatches);
}
}
}
Debug.Assert(exports != null || _EmptyExportsList != null);
return exports ?? _EmptyExportsList;
}
internal virtual IEnumerable<ComposablePartDefinition>? GetCandidateParts(ImportDefinition definition)
{
return this;
}
/// <summary>
/// Releases the unmanaged and managed resources used by the <see cref="ComposablePartCatalog"/>.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
_isDisposed = true;
}
[DebuggerStepThrough]
private void ThrowIfDisposed()
{
if (_isDisposed)
{
throw ExceptionBuilder.CreateObjectDisposed(this);
}
}
//
// If neither Parts nor GetEnumerator() is overriden then return an empty list
// If GetEnumerator is overridden this code should not be invoked: ReferenceAssemblies mark it as Abstract or Not present
// We verify whether Parts is overriden by seeing if the object returns matched the one cached for this instance
// Note: a query object is only cached if Parts is invoked on a catalog which did not implement it
// Because reference assemblies do not expose Parts and we no longer use it, it should not get invoked by 3rd parties
// Because the reference assemblies mark GetEnumerator as Abstract 3rd party code should not lack an implementation
// That implementation should not try to call this implementation
// Our code doies delegate to Parts in the DebuggerProxies of course.
//
public virtual IEnumerator<ComposablePartDefinition> GetEnumerator()
{
var parts = Parts;
if (object.ReferenceEquals(parts, _queryableParts))
{
return Enumerable.Empty<ComposablePartDefinition>().GetEnumerator();
}
return parts.GetEnumerator();
}
Collections.IEnumerator Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/ReflectionCoreCallbacksImplementation.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Collections.Generic;
using System.Reflection.Runtime.General;
using System.Reflection.Runtime.TypeInfos;
using System.Reflection.Runtime.TypeInfos.NativeFormat;
using System.Reflection.Runtime.Assemblies;
using System.Reflection.Runtime.FieldInfos;
using System.Reflection.Runtime.FieldInfos.NativeFormat;
using System.Reflection.Runtime.MethodInfos;
using System.Reflection.Runtime.BindingFlagSupport;
using System.Reflection.Runtime.Modules;
using Internal.Runtime.Augments;
using Internal.Reflection.Augments;
using Internal.Reflection.Core.Execution;
using Internal.Metadata.NativeFormat;
namespace System.Reflection.Runtime.General
{
internal sealed class ReflectionCoreCallbacksImplementation : ReflectionCoreCallbacks
{
internal ReflectionCoreCallbacksImplementation()
{
}
public sealed override Assembly Load(AssemblyName assemblyRef, bool throwOnFileNotFound)
{
if (assemblyRef == null)
throw new ArgumentNullException(nameof(assemblyRef));
if (throwOnFileNotFound)
return RuntimeAssemblyInfo.GetRuntimeAssembly(assemblyRef.ToRuntimeAssemblyName());
else
return RuntimeAssemblyInfo.GetRuntimeAssemblyIfExists(assemblyRef.ToRuntimeAssemblyName());
}
public sealed override Assembly Load(byte[] rawAssembly, byte[] pdbSymbolStore)
{
if (rawAssembly == null)
throw new ArgumentNullException(nameof(rawAssembly));
return RuntimeAssemblyInfo.GetRuntimeAssemblyFromByteArray(rawAssembly, pdbSymbolStore);
}
public sealed override Assembly Load(string assemblyPath)
{
if (assemblyPath == null)
throw new ArgumentNullException(nameof(assemblyPath));
return RuntimeAssemblyInfo.GetRuntimeAssemblyFromPath(assemblyPath);
}
//
// This overload of GetMethodForHandle only accepts handles for methods declared on non-generic types (the method, however,
// can be an instance of a generic method.) To resolve handles for methods declared on generic types, you must pass
// the declaring type explicitly using the two-argument overload of GetMethodFromHandle.
//
// This is a vestige from desktop generic sharing that got itself enshrined in the code generated by the C# compiler for Linq Expressions.
//
public sealed override MethodBase GetMethodFromHandle(RuntimeMethodHandle runtimeMethodHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
QMethodDefinition methodHandle;
RuntimeTypeHandle declaringTypeHandle;
RuntimeTypeHandle[] genericMethodTypeArgumentHandles;
if (!executionEnvironment.TryGetMethodFromHandle(runtimeMethodHandle, out declaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
throw new ArgumentException(SR.Argument_InvalidHandle);
MethodBase methodBase = ReflectionCoreExecution.ExecutionDomain.GetMethod(declaringTypeHandle, methodHandle, genericMethodTypeArgumentHandles);
if (methodBase.DeclaringType.IsConstructedGenericType) // For compat with desktop, insist that the caller pass us the declaring type to resolve members of generic types.
throw new ArgumentException(SR.Format(SR.Argument_MethodDeclaringTypeGeneric, methodBase));
return methodBase;
}
//
// This overload of GetMethodHandle can handle all method handles.
//
public sealed override MethodBase GetMethodFromHandle(RuntimeMethodHandle runtimeMethodHandle, RuntimeTypeHandle declaringTypeHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
QMethodDefinition methodHandle;
RuntimeTypeHandle[] genericMethodTypeArgumentHandles;
if (!executionEnvironment.TryGetMethodFromHandleAndType(runtimeMethodHandle, declaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
{
// This may be a method declared on a non-generic type: this api accepts that too so try the other table.
RuntimeTypeHandle actualDeclaringTypeHandle;
if (!executionEnvironment.TryGetMethodFromHandle(runtimeMethodHandle, out actualDeclaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
throw new ArgumentException(SR.Argument_InvalidHandle);
if (!actualDeclaringTypeHandle.Equals(declaringTypeHandle))
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethodHandle,
declaringTypeHandle.GetTypeForRuntimeTypeHandle(),
actualDeclaringTypeHandle.GetTypeForRuntimeTypeHandle()));
}
MethodBase methodBase = ReflectionCoreExecution.ExecutionDomain.GetMethod(declaringTypeHandle, methodHandle, genericMethodTypeArgumentHandles);
return methodBase;
}
//
// This overload of GetFieldForHandle only accepts handles for fields declared on non-generic types. To resolve handles for fields
// declared on generic types, you must pass the declaring type explicitly using the two-argument overload of GetFieldFromHandle.
//
// This is a vestige from desktop generic sharing that got itself enshrined in the code generated by the C# compiler for Linq Expressions.
//
public sealed override FieldInfo GetFieldFromHandle(RuntimeFieldHandle runtimeFieldHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
FieldHandle fieldHandle;
RuntimeTypeHandle declaringTypeHandle;
if (!executionEnvironment.TryGetFieldFromHandle(runtimeFieldHandle, out declaringTypeHandle, out fieldHandle))
throw new ArgumentException(SR.Argument_InvalidHandle);
FieldInfo fieldInfo = GetFieldInfo(declaringTypeHandle, fieldHandle);
if (fieldInfo.DeclaringType.IsConstructedGenericType) // For compat with desktop, insist that the caller pass us the declaring type to resolve members of generic types.
throw new ArgumentException(SR.Format(SR.Argument_FieldDeclaringTypeGeneric, fieldInfo));
return fieldInfo;
}
//
// This overload of GetFieldHandle can handle all field handles.
//
public sealed override FieldInfo GetFieldFromHandle(RuntimeFieldHandle runtimeFieldHandle, RuntimeTypeHandle declaringTypeHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
FieldHandle fieldHandle;
if (!executionEnvironment.TryGetFieldFromHandleAndType(runtimeFieldHandle, declaringTypeHandle, out fieldHandle))
{
// This may be a field declared on a non-generic type: this api accepts that too so try the other table.
RuntimeTypeHandle actualDeclaringTypeHandle;
if (!executionEnvironment.TryGetFieldFromHandle(runtimeFieldHandle, out actualDeclaringTypeHandle, out fieldHandle))
throw new ArgumentException(SR.Argument_InvalidHandle);
if (!actualDeclaringTypeHandle.Equals(declaringTypeHandle))
throw new ArgumentException(SR.Format(SR.Argument_ResolveFieldHandle,
declaringTypeHandle.GetTypeForRuntimeTypeHandle(),
actualDeclaringTypeHandle.GetTypeForRuntimeTypeHandle()));
}
FieldInfo fieldInfo = GetFieldInfo(declaringTypeHandle, fieldHandle);
return fieldInfo;
}
public sealed override EventInfo GetImplicitlyOverriddenBaseClassEvent(EventInfo e)
{
return e.GetImplicitlyOverriddenBaseClassMember();
}
public sealed override MethodInfo GetImplicitlyOverriddenBaseClassMethod(MethodInfo m)
{
return m.GetImplicitlyOverriddenBaseClassMember();
}
public sealed override PropertyInfo GetImplicitlyOverriddenBaseClassProperty(PropertyInfo p)
{
return p.GetImplicitlyOverriddenBaseClassMember();
}
private FieldInfo GetFieldInfo(RuntimeTypeHandle declaringTypeHandle, FieldHandle fieldHandle)
{
RuntimeTypeInfo contextTypeInfo = declaringTypeHandle.GetTypeForRuntimeTypeHandle();
NativeFormatRuntimeNamedTypeInfo definingTypeInfo = contextTypeInfo.AnchoringTypeDefinitionForDeclaredMembers.CastToNativeFormatRuntimeNamedTypeInfo();
// RuntimeFieldHandles always yield FieldInfo's whose ReflectedType equals the DeclaringType.
RuntimeTypeInfo reflectedType = contextTypeInfo;
return NativeFormatRuntimeFieldInfo.GetRuntimeFieldInfo(fieldHandle, definingTypeInfo, contextTypeInfo, reflectedType);
}
[DebuggerHidden]
[DebuggerStepThrough]
public sealed override object ActivatorCreateInstance(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
Type type, bool nonPublic)
{
return ActivatorImplementation.CreateInstance(type, nonPublic);
}
[DebuggerHidden]
[DebuggerStepThrough]
public sealed override object ActivatorCreateInstance(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
Type type, BindingFlags bindingAttr, Binder? binder, object[]? args, CultureInfo? culture, object[]? activationAttributes)
{
return ActivatorImplementation.CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
}
// V2 api: Creates open or closed delegates to static or instance methods - relaxed signature checking allowed.
public sealed override Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure)
{
return CreateDelegateWorker(type, firstArgument, method, throwOnBindFailure, allowClosed: true);
}
// V1 api: Creates open delegates to static or instance methods - relaxed signature checking allowed.
public sealed override Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure)
{
// This API existed in v1/v1.1 and only expected to create open
// instance delegates, so we forbid closed delegates for backward compatibility.
// But we'll allow relaxed signature checking and open static delegates because
// there's no ambiguity there (the caller would have to explicitly
// pass us a static method or a method with a non-exact signature
// and the only change in behavior from v1.1 there is that we won't
// fail the call).
return CreateDelegateWorker(type, null, method, throwOnBindFailure, allowClosed: false);
}
private static Delegate CreateDelegateWorker(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure, bool allowClosed)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!(method is RuntimeMethodInfo runtimeMethodInfo))
throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
Delegate result = runtimeMethodInfo.CreateDelegateNoThrowOnBindFailure(runtimeDelegateType, firstArgument, allowClosed);
if (result == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return result;
}
// V1 api: Creates closed delegates to instance methods only, relaxed signature checking disallowed.
[RequiresUnreferencedCode("The target method might be removed")]
public sealed override Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (target == null)
throw new ArgumentNullException(nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate);
RuntimeTypeInfo runtimeContainingType = target.GetType().CastToRuntimeTypeInfo();
RuntimeMethodInfo runtimeMethodInfo = LookupMethodForCreateDelegate(runtimeDelegateType, runtimeContainingType, method, isStatic: false, ignoreCase: ignoreCase);
if (runtimeMethodInfo == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return runtimeMethodInfo.CreateDelegateWithoutSignatureValidation(type, target, isStatic: false, isOpen: false);
}
// V1 api: Creates open delegates to static methods only, relaxed signature checking disallowed.
public sealed override Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target, string method, bool ignoreCase, bool throwOnBindFailure)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (target == null)
throw new ArgumentNullException(nameof(target));
if (target.ContainsGenericParameters)
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!(target is RuntimeTypeInfo runtimeContainingType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate);
RuntimeMethodInfo runtimeMethodInfo = LookupMethodForCreateDelegate(runtimeDelegateType, runtimeContainingType, method, isStatic: true, ignoreCase: ignoreCase);
if (runtimeMethodInfo == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return runtimeMethodInfo.CreateDelegateWithoutSignatureValidation(type, target: null, isStatic: true, isOpen: true);
}
//
// Helper for the V1/V1.1 Delegate.CreateDelegate() api. These apis take method names rather than MethodInfo and only expect to create open static delegates
// or closed instance delegates. For backward compatibility, they don't allow relaxed signature matching (which could make the choice of target method ambiguous.)
//
private static RuntimeMethodInfo LookupMethodForCreateDelegate(RuntimeTypeInfo runtimeDelegateType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] RuntimeTypeInfo containingType, string method, bool isStatic, bool ignoreCase)
{
Debug.Assert(runtimeDelegateType.IsDelegate);
BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.ExactBinding;
if (isStatic)
{
bindingFlags |= BindingFlags.Static;
}
else
{
bindingFlags |= BindingFlags.Instance | BindingFlags.DeclaredOnly;
}
if (ignoreCase)
{
bindingFlags |= BindingFlags.IgnoreCase;
}
RuntimeMethodInfo invokeMethod = runtimeDelegateType.GetInvokeMethod();
ParameterInfo[] parameters = invokeMethod.GetParametersNoCopy();
int numParameters = parameters.Length;
Type[] parameterTypes = new Type[numParameters];
for (int i = 0; i < numParameters; i++)
{
parameterTypes[i] = parameters[i].ParameterType;
}
while (containingType != null)
{
MethodInfo methodInfo = containingType.GetMethod(method, 0, bindingFlags, null, parameterTypes, null);
if (methodInfo != null && methodInfo.ReturnType.Equals(invokeMethod.ReturnType))
return (RuntimeMethodInfo)methodInfo; // This cast is safe since we already verified that containingType is runtime implemented.
#pragma warning disable IL2072 // https://github.com/dotnet/linker/issues/2673
containingType = (RuntimeTypeInfo)(containingType.BaseType);
#pragma warning restore
}
return null;
}
#if FEATURE_COMINTEROP
public sealed override Type GetTypeFromCLSID(Guid clsid, string server, bool throwOnError)
{
// Note: "throwOnError" is a vacuous parameter. Any errors due to the CLSID not being registered or the server not being found will happen
// on the Activator.CreateInstance() call. GetTypeFromCLSID() merely wraps the data in a Type object without any validation.
return RuntimeCLSIDTypeInfo.GetRuntimeCLSIDTypeInfo(clsid, server);
}
#endif
public sealed override IntPtr GetFunctionPointer(RuntimeMethodHandle runtimeMethodHandle, RuntimeTypeHandle declaringTypeHandle)
{
MethodBase method = GetMethodFromHandle(runtimeMethodHandle, declaringTypeHandle);
switch (method)
{
case RuntimeMethodInfo methodInfo:
return methodInfo.LdFtnResult;
case RuntimeConstructorInfo constructorInfo:
return constructorInfo.LdFtnResult;
default:
Debug.Fail("RuntimeMethodHandle should only return a methodbase implemented by the runtime.");
throw new NotSupportedException();
}
}
public sealed override void RunModuleConstructor(Module module)
{
RuntimeAssemblyInfo assembly = (RuntimeAssemblyInfo)module.Assembly;
assembly.RunModuleConstructor();
}
public sealed override void MakeTypedReference(object target, FieldInfo[] flds, out Type type, out int offset)
{
if (target == null)
throw new ArgumentNullException(nameof(target));
if (flds == null)
throw new ArgumentNullException(nameof(flds));
if (flds.Length == 0)
throw new ArgumentException(SR.Arg_ArrayZeroError, nameof(flds));
offset = 0;
Type targetType = target.GetType();
for (int i = 0; i < flds.Length; i++)
{
if (!(flds[i] is RuntimeFieldInfo field))
throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo);
if (field.IsStatic)
throw new ArgumentException(SR.Argument_TypedReferenceInvalidField);
// For proper handling of Nullable<T> don't change to something like 'IsAssignableFrom'
// Currently we can't make a TypedReference to fields of Nullable<T>, which is fine.
Type declaringType = field.DeclaringType;
if (targetType != declaringType && !targetType.IsSubclassOf(declaringType))
throw new MissingMemberException(SR.MissingMemberTypeRef); // MissingMemberException is a strange exception to throw, but it is the compatible exception.
Type fieldType = field.FieldType;
if (fieldType.IsPrimitive)
throw new ArgumentException(SR.Arg_TypeRefPrimitve); // This check exists for compatibility (why such an ad-hoc restriction?)
if (i < (flds.Length - 1) && !fieldType.IsValueType)
throw new MissingMemberException(SR.MissingMemberNestErr); // MissingMemberException is a strange exception to throw, but it is the compatible exception.
targetType = fieldType;
offset = checked(offset + field.Offset);
}
type = targetType;
}
public sealed override Assembly[] GetLoadedAssemblies() => RuntimeAssemblyInfo.GetLoadedAssemblies();
public sealed override EnumInfo GetEnumInfo(Type type) => type.CastToRuntimeTypeInfo().EnumInfo;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Collections.Generic;
using System.Reflection.Runtime.General;
using System.Reflection.Runtime.TypeInfos;
using System.Reflection.Runtime.TypeInfos.NativeFormat;
using System.Reflection.Runtime.Assemblies;
using System.Reflection.Runtime.FieldInfos;
using System.Reflection.Runtime.FieldInfos.NativeFormat;
using System.Reflection.Runtime.MethodInfos;
using System.Reflection.Runtime.BindingFlagSupport;
using System.Reflection.Runtime.Modules;
using Internal.Runtime.Augments;
using Internal.Reflection.Augments;
using Internal.Reflection.Core.Execution;
using Internal.Metadata.NativeFormat;
namespace System.Reflection.Runtime.General
{
internal sealed class ReflectionCoreCallbacksImplementation : ReflectionCoreCallbacks
{
internal ReflectionCoreCallbacksImplementation()
{
}
public sealed override Assembly Load(AssemblyName assemblyRef, bool throwOnFileNotFound)
{
if (assemblyRef == null)
throw new ArgumentNullException(nameof(assemblyRef));
if (throwOnFileNotFound)
return RuntimeAssemblyInfo.GetRuntimeAssembly(assemblyRef.ToRuntimeAssemblyName());
else
return RuntimeAssemblyInfo.GetRuntimeAssemblyIfExists(assemblyRef.ToRuntimeAssemblyName());
}
public sealed override Assembly Load(byte[] rawAssembly, byte[] pdbSymbolStore)
{
if (rawAssembly == null)
throw new ArgumentNullException(nameof(rawAssembly));
return RuntimeAssemblyInfo.GetRuntimeAssemblyFromByteArray(rawAssembly, pdbSymbolStore);
}
public sealed override Assembly Load(string assemblyPath)
{
if (assemblyPath == null)
throw new ArgumentNullException(nameof(assemblyPath));
return RuntimeAssemblyInfo.GetRuntimeAssemblyFromPath(assemblyPath);
}
//
// This overload of GetMethodForHandle only accepts handles for methods declared on non-generic types (the method, however,
// can be an instance of a generic method.) To resolve handles for methods declared on generic types, you must pass
// the declaring type explicitly using the two-argument overload of GetMethodFromHandle.
//
// This is a vestige from desktop generic sharing that got itself enshrined in the code generated by the C# compiler for Linq Expressions.
//
public sealed override MethodBase GetMethodFromHandle(RuntimeMethodHandle runtimeMethodHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
QMethodDefinition methodHandle;
RuntimeTypeHandle declaringTypeHandle;
RuntimeTypeHandle[] genericMethodTypeArgumentHandles;
if (!executionEnvironment.TryGetMethodFromHandle(runtimeMethodHandle, out declaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
throw new ArgumentException(SR.Argument_InvalidHandle);
MethodBase methodBase = ReflectionCoreExecution.ExecutionDomain.GetMethod(declaringTypeHandle, methodHandle, genericMethodTypeArgumentHandles);
if (methodBase.DeclaringType.IsConstructedGenericType) // For compat with desktop, insist that the caller pass us the declaring type to resolve members of generic types.
throw new ArgumentException(SR.Format(SR.Argument_MethodDeclaringTypeGeneric, methodBase));
return methodBase;
}
//
// This overload of GetMethodHandle can handle all method handles.
//
public sealed override MethodBase GetMethodFromHandle(RuntimeMethodHandle runtimeMethodHandle, RuntimeTypeHandle declaringTypeHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
QMethodDefinition methodHandle;
RuntimeTypeHandle[] genericMethodTypeArgumentHandles;
if (!executionEnvironment.TryGetMethodFromHandleAndType(runtimeMethodHandle, declaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
{
// This may be a method declared on a non-generic type: this api accepts that too so try the other table.
RuntimeTypeHandle actualDeclaringTypeHandle;
if (!executionEnvironment.TryGetMethodFromHandle(runtimeMethodHandle, out actualDeclaringTypeHandle, out methodHandle, out genericMethodTypeArgumentHandles))
throw new ArgumentException(SR.Argument_InvalidHandle);
if (!actualDeclaringTypeHandle.Equals(declaringTypeHandle))
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethodHandle,
declaringTypeHandle.GetTypeForRuntimeTypeHandle(),
actualDeclaringTypeHandle.GetTypeForRuntimeTypeHandle()));
}
MethodBase methodBase = ReflectionCoreExecution.ExecutionDomain.GetMethod(declaringTypeHandle, methodHandle, genericMethodTypeArgumentHandles);
return methodBase;
}
//
// This overload of GetFieldForHandle only accepts handles for fields declared on non-generic types. To resolve handles for fields
// declared on generic types, you must pass the declaring type explicitly using the two-argument overload of GetFieldFromHandle.
//
// This is a vestige from desktop generic sharing that got itself enshrined in the code generated by the C# compiler for Linq Expressions.
//
public sealed override FieldInfo GetFieldFromHandle(RuntimeFieldHandle runtimeFieldHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
FieldHandle fieldHandle;
RuntimeTypeHandle declaringTypeHandle;
if (!executionEnvironment.TryGetFieldFromHandle(runtimeFieldHandle, out declaringTypeHandle, out fieldHandle))
throw new ArgumentException(SR.Argument_InvalidHandle);
FieldInfo fieldInfo = GetFieldInfo(declaringTypeHandle, fieldHandle);
if (fieldInfo.DeclaringType.IsConstructedGenericType) // For compat with desktop, insist that the caller pass us the declaring type to resolve members of generic types.
throw new ArgumentException(SR.Format(SR.Argument_FieldDeclaringTypeGeneric, fieldInfo));
return fieldInfo;
}
//
// This overload of GetFieldHandle can handle all field handles.
//
public sealed override FieldInfo GetFieldFromHandle(RuntimeFieldHandle runtimeFieldHandle, RuntimeTypeHandle declaringTypeHandle)
{
ExecutionEnvironment executionEnvironment = ReflectionCoreExecution.ExecutionEnvironment;
FieldHandle fieldHandle;
if (!executionEnvironment.TryGetFieldFromHandleAndType(runtimeFieldHandle, declaringTypeHandle, out fieldHandle))
{
// This may be a field declared on a non-generic type: this api accepts that too so try the other table.
RuntimeTypeHandle actualDeclaringTypeHandle;
if (!executionEnvironment.TryGetFieldFromHandle(runtimeFieldHandle, out actualDeclaringTypeHandle, out fieldHandle))
throw new ArgumentException(SR.Argument_InvalidHandle);
if (!actualDeclaringTypeHandle.Equals(declaringTypeHandle))
throw new ArgumentException(SR.Format(SR.Argument_ResolveFieldHandle,
declaringTypeHandle.GetTypeForRuntimeTypeHandle(),
actualDeclaringTypeHandle.GetTypeForRuntimeTypeHandle()));
}
FieldInfo fieldInfo = GetFieldInfo(declaringTypeHandle, fieldHandle);
return fieldInfo;
}
public sealed override EventInfo GetImplicitlyOverriddenBaseClassEvent(EventInfo e)
{
return e.GetImplicitlyOverriddenBaseClassMember();
}
public sealed override MethodInfo GetImplicitlyOverriddenBaseClassMethod(MethodInfo m)
{
return m.GetImplicitlyOverriddenBaseClassMember();
}
public sealed override PropertyInfo GetImplicitlyOverriddenBaseClassProperty(PropertyInfo p)
{
return p.GetImplicitlyOverriddenBaseClassMember();
}
private FieldInfo GetFieldInfo(RuntimeTypeHandle declaringTypeHandle, FieldHandle fieldHandle)
{
RuntimeTypeInfo contextTypeInfo = declaringTypeHandle.GetTypeForRuntimeTypeHandle();
NativeFormatRuntimeNamedTypeInfo definingTypeInfo = contextTypeInfo.AnchoringTypeDefinitionForDeclaredMembers.CastToNativeFormatRuntimeNamedTypeInfo();
// RuntimeFieldHandles always yield FieldInfo's whose ReflectedType equals the DeclaringType.
RuntimeTypeInfo reflectedType = contextTypeInfo;
return NativeFormatRuntimeFieldInfo.GetRuntimeFieldInfo(fieldHandle, definingTypeInfo, contextTypeInfo, reflectedType);
}
[DebuggerHidden]
[DebuggerStepThrough]
public sealed override object ActivatorCreateInstance(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
Type type, bool nonPublic)
{
return ActivatorImplementation.CreateInstance(type, nonPublic);
}
[DebuggerHidden]
[DebuggerStepThrough]
public sealed override object ActivatorCreateInstance(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
Type type, BindingFlags bindingAttr, Binder? binder, object[]? args, CultureInfo? culture, object[]? activationAttributes)
{
return ActivatorImplementation.CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
}
// V2 api: Creates open or closed delegates to static or instance methods - relaxed signature checking allowed.
public sealed override Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure)
{
return CreateDelegateWorker(type, firstArgument, method, throwOnBindFailure, allowClosed: true);
}
// V1 api: Creates open delegates to static or instance methods - relaxed signature checking allowed.
public sealed override Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure)
{
// This API existed in v1/v1.1 and only expected to create open
// instance delegates, so we forbid closed delegates for backward compatibility.
// But we'll allow relaxed signature checking and open static delegates because
// there's no ambiguity there (the caller would have to explicitly
// pass us a static method or a method with a non-exact signature
// and the only change in behavior from v1.1 there is that we won't
// fail the call).
return CreateDelegateWorker(type, null, method, throwOnBindFailure, allowClosed: false);
}
private static Delegate CreateDelegateWorker(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure, bool allowClosed)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!(method is RuntimeMethodInfo runtimeMethodInfo))
throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type));
Delegate result = runtimeMethodInfo.CreateDelegateNoThrowOnBindFailure(runtimeDelegateType, firstArgument, allowClosed);
if (result == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return result;
}
// V1 api: Creates closed delegates to instance methods only, relaxed signature checking disallowed.
[RequiresUnreferencedCode("The target method might be removed")]
public sealed override Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (target == null)
throw new ArgumentNullException(nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate);
RuntimeTypeInfo runtimeContainingType = target.GetType().CastToRuntimeTypeInfo();
RuntimeMethodInfo runtimeMethodInfo = LookupMethodForCreateDelegate(runtimeDelegateType, runtimeContainingType, method, isStatic: false, ignoreCase: ignoreCase);
if (runtimeMethodInfo == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return runtimeMethodInfo.CreateDelegateWithoutSignatureValidation(type, target, isStatic: false, isOpen: false);
}
// V1 api: Creates open delegates to static methods only, relaxed signature checking disallowed.
public sealed override Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target, string method, bool ignoreCase, bool throwOnBindFailure)
{
if (type == null)
throw new ArgumentNullException(nameof(type));
if (target == null)
throw new ArgumentNullException(nameof(target));
if (target.ContainsGenericParameters)
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
if (method == null)
throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeTypeInfo runtimeDelegateType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!(target is RuntimeTypeInfo runtimeContainingType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target));
if (!runtimeDelegateType.IsDelegate)
throw new ArgumentException(SR.Arg_MustBeDelegate);
RuntimeMethodInfo runtimeMethodInfo = LookupMethodForCreateDelegate(runtimeDelegateType, runtimeContainingType, method, isStatic: true, ignoreCase: ignoreCase);
if (runtimeMethodInfo == null)
{
if (throwOnBindFailure)
throw new ArgumentException(SR.Arg_DlgtTargMeth);
return null;
}
return runtimeMethodInfo.CreateDelegateWithoutSignatureValidation(type, target: null, isStatic: true, isOpen: true);
}
//
// Helper for the V1/V1.1 Delegate.CreateDelegate() api. These apis take method names rather than MethodInfo and only expect to create open static delegates
// or closed instance delegates. For backward compatibility, they don't allow relaxed signature matching (which could make the choice of target method ambiguous.)
//
private static RuntimeMethodInfo LookupMethodForCreateDelegate(RuntimeTypeInfo runtimeDelegateType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] RuntimeTypeInfo containingType, string method, bool isStatic, bool ignoreCase)
{
Debug.Assert(runtimeDelegateType.IsDelegate);
BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.ExactBinding;
if (isStatic)
{
bindingFlags |= BindingFlags.Static;
}
else
{
bindingFlags |= BindingFlags.Instance | BindingFlags.DeclaredOnly;
}
if (ignoreCase)
{
bindingFlags |= BindingFlags.IgnoreCase;
}
RuntimeMethodInfo invokeMethod = runtimeDelegateType.GetInvokeMethod();
ParameterInfo[] parameters = invokeMethod.GetParametersNoCopy();
int numParameters = parameters.Length;
Type[] parameterTypes = new Type[numParameters];
for (int i = 0; i < numParameters; i++)
{
parameterTypes[i] = parameters[i].ParameterType;
}
while (containingType != null)
{
MethodInfo methodInfo = containingType.GetMethod(method, 0, bindingFlags, null, parameterTypes, null);
if (methodInfo != null && methodInfo.ReturnType.Equals(invokeMethod.ReturnType))
return (RuntimeMethodInfo)methodInfo; // This cast is safe since we already verified that containingType is runtime implemented.
#pragma warning disable IL2072 // https://github.com/dotnet/linker/issues/2673
containingType = (RuntimeTypeInfo)(containingType.BaseType);
#pragma warning restore
}
return null;
}
#if FEATURE_COMINTEROP
public sealed override Type GetTypeFromCLSID(Guid clsid, string server, bool throwOnError)
{
// Note: "throwOnError" is a vacuous parameter. Any errors due to the CLSID not being registered or the server not being found will happen
// on the Activator.CreateInstance() call. GetTypeFromCLSID() merely wraps the data in a Type object without any validation.
return RuntimeCLSIDTypeInfo.GetRuntimeCLSIDTypeInfo(clsid, server);
}
#endif
public sealed override IntPtr GetFunctionPointer(RuntimeMethodHandle runtimeMethodHandle, RuntimeTypeHandle declaringTypeHandle)
{
MethodBase method = GetMethodFromHandle(runtimeMethodHandle, declaringTypeHandle);
switch (method)
{
case RuntimeMethodInfo methodInfo:
return methodInfo.LdFtnResult;
case RuntimeConstructorInfo constructorInfo:
return constructorInfo.LdFtnResult;
default:
Debug.Fail("RuntimeMethodHandle should only return a methodbase implemented by the runtime.");
throw new NotSupportedException();
}
}
public sealed override void RunModuleConstructor(Module module)
{
RuntimeAssemblyInfo assembly = (RuntimeAssemblyInfo)module.Assembly;
assembly.RunModuleConstructor();
}
public sealed override void MakeTypedReference(object target, FieldInfo[] flds, out Type type, out int offset)
{
if (target == null)
throw new ArgumentNullException(nameof(target));
if (flds == null)
throw new ArgumentNullException(nameof(flds));
if (flds.Length == 0)
throw new ArgumentException(SR.Arg_ArrayZeroError, nameof(flds));
offset = 0;
Type targetType = target.GetType();
for (int i = 0; i < flds.Length; i++)
{
if (!(flds[i] is RuntimeFieldInfo field))
throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo);
if (field.IsStatic)
throw new ArgumentException(SR.Argument_TypedReferenceInvalidField);
// For proper handling of Nullable<T> don't change to something like 'IsAssignableFrom'
// Currently we can't make a TypedReference to fields of Nullable<T>, which is fine.
Type declaringType = field.DeclaringType;
if (targetType != declaringType && !targetType.IsSubclassOf(declaringType))
throw new MissingMemberException(SR.MissingMemberTypeRef); // MissingMemberException is a strange exception to throw, but it is the compatible exception.
Type fieldType = field.FieldType;
if (fieldType.IsPrimitive)
throw new ArgumentException(SR.Arg_TypeRefPrimitve); // This check exists for compatibility (why such an ad-hoc restriction?)
if (i < (flds.Length - 1) && !fieldType.IsValueType)
throw new MissingMemberException(SR.MissingMemberNestErr); // MissingMemberException is a strange exception to throw, but it is the compatible exception.
targetType = fieldType;
offset = checked(offset + field.Offset);
}
type = targetType;
}
public sealed override Assembly[] GetLoadedAssemblies() => RuntimeAssemblyInfo.GetLoadedAssemblies();
public sealed override EnumInfo GetEnumInfo(Type type) => type.CastToRuntimeTypeInfo().EnumInfo;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Linq.Queryable/ref/System.Linq.Queryable.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Linq
{
public abstract partial class EnumerableExecutor
{
internal EnumerableExecutor() { }
}
public partial class EnumerableExecutor<T> : System.Linq.EnumerableExecutor
{
public EnumerableExecutor(System.Linq.Expressions.Expression expression) { }
}
public abstract partial class EnumerableQuery
{
internal EnumerableQuery() { }
}
public partial class EnumerableQuery<T> : System.Linq.EnumerableQuery, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable, System.Linq.IOrderedQueryable, System.Linq.IOrderedQueryable<T>, System.Linq.IQueryable, System.Linq.IQueryable<T>, System.Linq.IQueryProvider
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public EnumerableQuery(System.Collections.Generic.IEnumerable<T> enumerable) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public EnumerableQuery(System.Linq.Expressions.Expression expression) { }
System.Type System.Linq.IQueryable.ElementType { get { throw null; } }
System.Linq.Expressions.Expression System.Linq.IQueryable.Expression { get { throw null; } }
System.Linq.IQueryProvider System.Linq.IQueryable.Provider { get { throw null; } }
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
System.Linq.IQueryable System.Linq.IQueryProvider.CreateQuery(System.Linq.Expressions.Expression expression) { throw null; }
System.Linq.IQueryable<TElement> System.Linq.IQueryProvider.CreateQuery<TElement>(System.Linq.Expressions.Expression expression) { throw null; }
object System.Linq.IQueryProvider.Execute(System.Linq.Expressions.Expression expression) { throw null; }
TElement System.Linq.IQueryProvider.Execute<TElement>(System.Linq.Expressions.Expression expression) { throw null; }
public override string? ToString() { throw null; }
}
public static partial class Queryable
{
public static TSource Aggregate<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TSource, TSource>> func) { throw null; }
public static TAccumulate Aggregate<TSource, TAccumulate>(this System.Linq.IQueryable<TSource> source, TAccumulate seed, System.Linq.Expressions.Expression<System.Func<TAccumulate, TSource, TAccumulate>> func) { throw null; }
public static TResult Aggregate<TSource, TAccumulate, TResult>(this System.Linq.IQueryable<TSource> source, TAccumulate seed, System.Linq.Expressions.Expression<System.Func<TAccumulate, TSource, TAccumulate>> func, System.Linq.Expressions.Expression<System.Func<TAccumulate, TResult>> selector) { throw null; }
public static bool All<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static bool Any<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static bool Any<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Append<TSource>(this System.Linq.IQueryable<TSource> source, TSource element) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public static System.Linq.IQueryable AsQueryable(this System.Collections.IEnumerable source) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public static System.Linq.IQueryable<TElement> AsQueryable<TElement>(this System.Collections.Generic.IEnumerable<TElement> source) { throw null; }
public static decimal Average(this System.Linq.IQueryable<decimal> source) { throw null; }
public static double Average(this System.Linq.IQueryable<double> source) { throw null; }
public static double Average(this System.Linq.IQueryable<int> source) { throw null; }
public static double Average(this System.Linq.IQueryable<long> source) { throw null; }
public static decimal? Average(this System.Linq.IQueryable<decimal?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<double?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<int?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<long?> source) { throw null; }
public static float? Average(this System.Linq.IQueryable<float?> source) { throw null; }
public static float Average(this System.Linq.IQueryable<float> source) { throw null; }
public static decimal Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long>> selector) { throw null; }
public static decimal? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long?>> selector) { throw null; }
public static float? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float?>> selector) { throw null; }
public static float Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> Cast<TResult>(this System.Linq.IQueryable source) { throw null; }
public static System.Linq.IQueryable<TSource[]> Chunk<TSource>(this System.Linq.IQueryable<TSource> source, int size) { throw null; }
public static System.Linq.IQueryable<TSource> Concat<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static bool Contains<TSource>(this System.Linq.IQueryable<TSource> source, TSource item) { throw null; }
public static bool Contains<TSource>(this System.Linq.IQueryable<TSource> source, TSource item, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static int Count<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static int Count<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> DefaultIfEmpty<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TSource> DefaultIfEmpty<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static System.Linq.IQueryable<TSource> DistinctBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> DistinctBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Distinct<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TSource> Distinct<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? ElementAtOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Index index) { throw null; }
public static TSource? ElementAtOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, int index) { throw null; }
public static TSource ElementAt<TSource>(this System.Linq.IQueryable<TSource> source, System.Index index) { throw null; }
public static TSource ElementAt<TSource>(this System.Linq.IQueryable<TSource> source, int index) { throw null; }
public static System.Linq.IQueryable<TSource> ExceptBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> ExceptBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Except<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Except<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource First<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource First<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TSource>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TSource>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TElement>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TElement>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, System.Collections.Generic.IEnumerable<TInner>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, System.Collections.Generic.IEnumerable<TInner>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> IntersectBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> IntersectBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Intersect<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Intersect<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, TInner, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, TInner, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static TSource? LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource Last<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource Last<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static long LongCount<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static long LongCount<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource? MaxBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static TSource? MaxBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TSource? Max<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? Max<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TResult? Max<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static TSource? MinBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static TSource? MinBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TSource? Min<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? Min<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TResult? Min<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> OfType<TResult>(this System.Linq.IQueryable source) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Prepend<TSource>(this System.Linq.IQueryable<TSource> source, TSource element) { throw null; }
public static System.Linq.IQueryable<TSource> Reverse<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, System.Collections.Generic.IEnumerable<TResult>>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, System.Collections.Generic.IEnumerable<TResult>>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, System.Collections.Generic.IEnumerable<TCollection>>> collectionSelector, System.Linq.Expressions.Expression<System.Func<TSource, TCollection, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, System.Collections.Generic.IEnumerable<TCollection>>> collectionSelector, System.Linq.Expressions.Expression<System.Func<TSource, TCollection, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> Select<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, TResult>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> Select<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static bool SequenceEqual<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static bool SequenceEqual<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource Single<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource Single<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> SkipLast<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> SkipWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> SkipWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Skip<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static decimal Sum(this System.Linq.IQueryable<decimal> source) { throw null; }
public static double Sum(this System.Linq.IQueryable<double> source) { throw null; }
public static int Sum(this System.Linq.IQueryable<int> source) { throw null; }
public static long Sum(this System.Linq.IQueryable<long> source) { throw null; }
public static decimal? Sum(this System.Linq.IQueryable<decimal?> source) { throw null; }
public static double? Sum(this System.Linq.IQueryable<double?> source) { throw null; }
public static int? Sum(this System.Linq.IQueryable<int?> source) { throw null; }
public static long? Sum(this System.Linq.IQueryable<long?> source) { throw null; }
public static float? Sum(this System.Linq.IQueryable<float?> source) { throw null; }
public static float Sum(this System.Linq.IQueryable<float> source) { throw null; }
public static decimal Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal>> selector) { throw null; }
public static double Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double>> selector) { throw null; }
public static int Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int>> selector) { throw null; }
public static long Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long>> selector) { throw null; }
public static decimal? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal?>> selector) { throw null; }
public static double? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double?>> selector) { throw null; }
public static int? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int?>> selector) { throw null; }
public static long? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long?>> selector) { throw null; }
public static float? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float?>> selector) { throw null; }
public static float Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float>> selector) { throw null; }
public static System.Linq.IQueryable<TSource> TakeLast<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> TakeWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> TakeWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Take<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> Take<TSource>(this System.Linq.IQueryable<TSource> source, System.Range range) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> UnionBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> UnionBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Union<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Union<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Where<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Where<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2) { throw null; }
public static System.Linq.IQueryable<(TFirst First, TSecond Second, TThird Third)> Zip<TFirst, TSecond, TThird>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2, System.Collections.Generic.IEnumerable<TThird> source3) { throw null; }
public static System.Linq.IQueryable<TResult> Zip<TFirst, TSecond, TResult>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2, System.Linq.Expressions.Expression<System.Func<TFirst, TSecond, TResult>> resultSelector) { throw null; }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Linq
{
public abstract partial class EnumerableExecutor
{
internal EnumerableExecutor() { }
}
public partial class EnumerableExecutor<T> : System.Linq.EnumerableExecutor
{
public EnumerableExecutor(System.Linq.Expressions.Expression expression) { }
}
public abstract partial class EnumerableQuery
{
internal EnumerableQuery() { }
}
public partial class EnumerableQuery<T> : System.Linq.EnumerableQuery, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable, System.Linq.IOrderedQueryable, System.Linq.IOrderedQueryable<T>, System.Linq.IQueryable, System.Linq.IQueryable<T>, System.Linq.IQueryProvider
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public EnumerableQuery(System.Collections.Generic.IEnumerable<T> enumerable) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public EnumerableQuery(System.Linq.Expressions.Expression expression) { }
System.Type System.Linq.IQueryable.ElementType { get { throw null; } }
System.Linq.Expressions.Expression System.Linq.IQueryable.Expression { get { throw null; } }
System.Linq.IQueryProvider System.Linq.IQueryable.Provider { get { throw null; } }
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
System.Linq.IQueryable System.Linq.IQueryProvider.CreateQuery(System.Linq.Expressions.Expression expression) { throw null; }
System.Linq.IQueryable<TElement> System.Linq.IQueryProvider.CreateQuery<TElement>(System.Linq.Expressions.Expression expression) { throw null; }
object System.Linq.IQueryProvider.Execute(System.Linq.Expressions.Expression expression) { throw null; }
TElement System.Linq.IQueryProvider.Execute<TElement>(System.Linq.Expressions.Expression expression) { throw null; }
public override string? ToString() { throw null; }
}
public static partial class Queryable
{
public static TSource Aggregate<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TSource, TSource>> func) { throw null; }
public static TAccumulate Aggregate<TSource, TAccumulate>(this System.Linq.IQueryable<TSource> source, TAccumulate seed, System.Linq.Expressions.Expression<System.Func<TAccumulate, TSource, TAccumulate>> func) { throw null; }
public static TResult Aggregate<TSource, TAccumulate, TResult>(this System.Linq.IQueryable<TSource> source, TAccumulate seed, System.Linq.Expressions.Expression<System.Func<TAccumulate, TSource, TAccumulate>> func, System.Linq.Expressions.Expression<System.Func<TAccumulate, TResult>> selector) { throw null; }
public static bool All<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static bool Any<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static bool Any<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Append<TSource>(this System.Linq.IQueryable<TSource> source, TSource element) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public static System.Linq.IQueryable AsQueryable(this System.Collections.IEnumerable source) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.")]
public static System.Linq.IQueryable<TElement> AsQueryable<TElement>(this System.Collections.Generic.IEnumerable<TElement> source) { throw null; }
public static decimal Average(this System.Linq.IQueryable<decimal> source) { throw null; }
public static double Average(this System.Linq.IQueryable<double> source) { throw null; }
public static double Average(this System.Linq.IQueryable<int> source) { throw null; }
public static double Average(this System.Linq.IQueryable<long> source) { throw null; }
public static decimal? Average(this System.Linq.IQueryable<decimal?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<double?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<int?> source) { throw null; }
public static double? Average(this System.Linq.IQueryable<long?> source) { throw null; }
public static float? Average(this System.Linq.IQueryable<float?> source) { throw null; }
public static float Average(this System.Linq.IQueryable<float> source) { throw null; }
public static decimal Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int>> selector) { throw null; }
public static double Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long>> selector) { throw null; }
public static decimal? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int?>> selector) { throw null; }
public static double? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long?>> selector) { throw null; }
public static float? Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float?>> selector) { throw null; }
public static float Average<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> Cast<TResult>(this System.Linq.IQueryable source) { throw null; }
public static System.Linq.IQueryable<TSource[]> Chunk<TSource>(this System.Linq.IQueryable<TSource> source, int size) { throw null; }
public static System.Linq.IQueryable<TSource> Concat<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static bool Contains<TSource>(this System.Linq.IQueryable<TSource> source, TSource item) { throw null; }
public static bool Contains<TSource>(this System.Linq.IQueryable<TSource> source, TSource item, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static int Count<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static int Count<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> DefaultIfEmpty<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TSource> DefaultIfEmpty<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static System.Linq.IQueryable<TSource> DistinctBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> DistinctBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Distinct<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TSource> Distinct<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? ElementAtOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Index index) { throw null; }
public static TSource? ElementAtOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, int index) { throw null; }
public static TSource ElementAt<TSource>(this System.Linq.IQueryable<TSource> source, System.Index index) { throw null; }
public static TSource ElementAt<TSource>(this System.Linq.IQueryable<TSource> source, int index) { throw null; }
public static System.Linq.IQueryable<TSource> ExceptBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> ExceptBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Except<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Except<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource FirstOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource First<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource First<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector) { throw null; }
public static System.Linq.IQueryable<System.Linq.IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TSource>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TSource>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TElement>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Linq.Expressions.Expression<System.Func<TSource, TElement>> elementSelector, System.Linq.Expressions.Expression<System.Func<TKey, System.Collections.Generic.IEnumerable<TElement>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, System.Collections.Generic.IEnumerable<TInner>, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, System.Collections.Generic.IEnumerable<TInner>, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> IntersectBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> IntersectBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TKey> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Intersect<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Intersect<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static System.Linq.IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, TInner, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this System.Linq.IQueryable<TOuter> outer, System.Collections.Generic.IEnumerable<TInner> inner, System.Linq.Expressions.Expression<System.Func<TOuter, TKey>> outerKeySelector, System.Linq.Expressions.Expression<System.Func<TInner, TKey>> innerKeySelector, System.Linq.Expressions.Expression<System.Func<TOuter, TInner, TResult>> resultSelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static TSource? LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource LastOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource Last<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource Last<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static long LongCount<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static long LongCount<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource? MaxBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static TSource? MaxBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TSource? Max<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? Max<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TResult? Max<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static TSource? MinBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static TSource? MinBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TSource? Min<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? Min<TSource>(this System.Linq.IQueryable<TSource> source, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static TResult? Min<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> OfType<TResult>(this System.Linq.IQueryable source) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Prepend<TSource>(this System.Linq.IQueryable<TSource> source, TSource element) { throw null; }
public static System.Linq.IQueryable<TSource> Reverse<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, System.Collections.Generic.IEnumerable<TResult>>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, System.Collections.Generic.IEnumerable<TResult>>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, System.Collections.Generic.IEnumerable<TCollection>>> collectionSelector, System.Linq.Expressions.Expression<System.Func<TSource, TCollection, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, System.Collections.Generic.IEnumerable<TCollection>>> collectionSelector, System.Linq.Expressions.Expression<System.Func<TSource, TCollection, TResult>> resultSelector) { throw null; }
public static System.Linq.IQueryable<TResult> Select<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, TResult>> selector) { throw null; }
public static System.Linq.IQueryable<TResult> Select<TSource, TResult>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TResult>> selector) { throw null; }
public static bool SequenceEqual<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static bool SequenceEqual<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static TSource? SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource? SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static TSource SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate, TSource defaultValue) { throw null; }
public static TSource SingleOrDefault<TSource>(this System.Linq.IQueryable<TSource> source, TSource defaultValue) { throw null; }
public static TSource Single<TSource>(this System.Linq.IQueryable<TSource> source) { throw null; }
public static TSource Single<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> SkipLast<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> SkipWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> SkipWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Skip<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static decimal Sum(this System.Linq.IQueryable<decimal> source) { throw null; }
public static double Sum(this System.Linq.IQueryable<double> source) { throw null; }
public static int Sum(this System.Linq.IQueryable<int> source) { throw null; }
public static long Sum(this System.Linq.IQueryable<long> source) { throw null; }
public static decimal? Sum(this System.Linq.IQueryable<decimal?> source) { throw null; }
public static double? Sum(this System.Linq.IQueryable<double?> source) { throw null; }
public static int? Sum(this System.Linq.IQueryable<int?> source) { throw null; }
public static long? Sum(this System.Linq.IQueryable<long?> source) { throw null; }
public static float? Sum(this System.Linq.IQueryable<float?> source) { throw null; }
public static float Sum(this System.Linq.IQueryable<float> source) { throw null; }
public static decimal Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal>> selector) { throw null; }
public static double Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double>> selector) { throw null; }
public static int Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int>> selector) { throw null; }
public static long Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long>> selector) { throw null; }
public static decimal? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, decimal?>> selector) { throw null; }
public static double? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, double?>> selector) { throw null; }
public static int? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int?>> selector) { throw null; }
public static long? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, long?>> selector) { throw null; }
public static float? Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float?>> selector) { throw null; }
public static float Sum<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, float>> selector) { throw null; }
public static System.Linq.IQueryable<TSource> TakeLast<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> TakeWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> TakeWhile<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Take<TSource>(this System.Linq.IQueryable<TSource> source, int count) { throw null; }
public static System.Linq.IQueryable<TSource> Take<TSource>(this System.Linq.IQueryable<TSource> source, System.Range range) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this System.Linq.IOrderedQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> UnionBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector) { throw null; }
public static System.Linq.IQueryable<TSource> UnionBy<TSource, TKey>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Linq.Expressions.Expression<System.Func<TSource, TKey>> keySelector, System.Collections.Generic.IEqualityComparer<TKey>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Union<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2) { throw null; }
public static System.Linq.IQueryable<TSource> Union<TSource>(this System.Linq.IQueryable<TSource> source1, System.Collections.Generic.IEnumerable<TSource> source2, System.Collections.Generic.IEqualityComparer<TSource>? comparer) { throw null; }
public static System.Linq.IQueryable<TSource> Where<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<TSource> Where<TSource>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<System.Func<TSource, int, bool>> predicate) { throw null; }
public static System.Linq.IQueryable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2) { throw null; }
public static System.Linq.IQueryable<(TFirst First, TSecond Second, TThird Third)> Zip<TFirst, TSecond, TThird>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2, System.Collections.Generic.IEnumerable<TThird> source3) { throw null; }
public static System.Linq.IQueryable<TResult> Zip<TFirst, TSecond, TResult>(this System.Linq.IQueryable<TFirst> source1, System.Collections.Generic.IEnumerable<TSecond> source2, System.Linq.Expressions.Expression<System.Func<TFirst, TSecond, TResult>> resultSelector) { throw null; }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public Vector128<Int32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass)
{
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly byte Imm = 3;
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Int32[] _data3 = new Int32[Op3ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private static Vector128<Int32> _clsVar3;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private Vector128<Int32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Rdm.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
_clsVar1,
_clsVar2,
_clsVar3,
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
fixed (Vector128<Int32>* pClsVar3 = &_clsVar3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2)),
AdvSimd.LoadVector128((Int32*)(pClsVar3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr);
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
fixed (Vector64<Int32>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
fixed (Vector128<Int32>* pFld3 = &test._fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2)),
AdvSimd.LoadVector128((Int32*)(&test._fld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, Vector128<Int32> op3, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}<Int32>(Vector64<Int32>, Vector64<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public Vector128<Int32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass)
{
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly byte Imm = 3;
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Int32[] _data3 = new Int32[Op3ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private static Vector128<Int32> _clsVar3;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private Vector128<Int32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Rdm.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
_clsVar1,
_clsVar2,
_clsVar3,
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
fixed (Vector128<Int32>* pClsVar3 = &_clsVar3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2)),
AdvSimd.LoadVector128((Int32*)(pClsVar3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr);
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3();
fixed (Vector64<Int32>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
fixed (Vector128<Int32>* pFld3 = &test._fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(
AdvSimd.LoadVector64((Int32*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2)),
AdvSimd.LoadVector128((Int32*)(&test._fld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, Vector128<Int32> op3, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}<Int32>(Vector64<Int32>, Vector64<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53226/b53226a.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="b53226a.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="b53226a.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Linq.Parallel/tests/Combinatorial/ParallelQueryCombinationTests.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using Xunit;
namespace System.Linq.Parallel.Tests
{
[ConditionalClass(typeof(ParallelQueryCombinationTests), nameof(RunSlowTests))]
public static partial class ParallelQueryCombinationTests
{
// On ARM platforms, many available cores make this unbearably slow: https://github.com/dotnet/runtime/issues/29123
public static bool RunSlowTests => PlatformDetection.IsNotArmNorArm64Process || Environment.ProcessorCount <= 8;
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate((x, y) => x + y));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Seed(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (x, y) => x + y));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Result(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (x, y) => x + y, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Accumulator(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (a, x) => a + x, (l, r) => l + r, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_SeedFactory(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(() => 0, (a, x) => a + x, (l, r) => l + r, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void All_False(Labeled<Operation> operation)
{
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).All(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void All_True(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).All(x => seen.Add(x)));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Any_False(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).Any(x => !seen.Add(x)));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Any_True(Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).Any(x => true));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Average(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double)DefaultSize,
operation.Item(DefaultStart, DefaultSize, DefaultSource).Average());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Average_Nullable(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double?)DefaultSize,
operation.Item(DefaultStart, DefaultSize, DefaultSource).Average(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Cast(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int? i in operation.Item(DefaultStart, DefaultSize, source.Item).Cast<int?>())
{
Assert.True(i.HasValue);
Assert.Equal(seen++, i.Value);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Cast_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Cast<int?>().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Concat(Labeled<Operation> source, Labeled<Operation> operation)
{
void Concat(Operation left, Operation right)
{
int seen = DefaultStart;
foreach (int i in left(DefaultStart, DefaultSize / 2, source.Item)
.Concat(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item)))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Concat(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Concat(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Concat_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Concat(Operation left, Operation right)
{
int seen = DefaultStart;
Assert.All(
left(DefaultStart, DefaultSize / 2, source.Item)
.Concat(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item)).ToList(),
x => Assert.Equal(seen++, x)
);
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Concat(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Concat(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Contains_True(Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).Contains(DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Contains_False(Labeled<Operation> operation)
{
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).Contains(DefaultStart + DefaultSize));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Elements(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Predicate_Some(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Predicate_None(Labeled<Operation> operation)
{
Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count(x => x < DefaultStart));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void DefaultIfEmpty(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).DefaultIfEmpty())
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void DefaultIfEmpty_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).DefaultIfEmpty().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Distinct(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
ParallelQuery<int> query = operation.Item(DefaultStart * 2, DefaultSize * 2, source.Item).Select(x => x / 2).Distinct();
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Distinct_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
ParallelQuery<int> query = operation.Item(DefaultStart * 2, DefaultSize * 2, source.Item).Select(x => x / 2).Distinct();
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ElementAt(Labeled<Operation> source, Labeled<Operation> operation)
{
ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item);
int seen = DefaultStart;
for (int i = 0; i < DefaultSize; i++)
{
Assert.Equal(seen++, query.ElementAt(i));
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ElementAtOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item);
int seen = DefaultStart;
for (int i = 0; i < DefaultSize; i++)
{
Assert.Equal(seen++, query.ElementAtOrDefault(i));
}
Assert.Equal(DefaultStart + DefaultSize, seen);
Assert.Equal(default(int), query.ElementAtOrDefault(-1));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Except(Labeled<Operation> source, Labeled<Operation> operation)
{
void Except(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize + DefaultSize / 2, source.Item)
.Except(right(DefaultStart + DefaultSize, DefaultSize, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Except(operation.Item, DefaultSource);
Except(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Except_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Except(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize + DefaultSize / 2, source.Item)
.Except(right(DefaultStart + DefaultSize, DefaultSize, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Except(operation.Item, DefaultSource);
Except(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void First(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).First());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void First_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).First(x => x >= DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => x >= DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault_Predicate_None(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ForAll(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
operation.Item(DefaultStart, DefaultSize, source.Item).ForAll(x => seen.Add(x));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GetEnumerator(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
IEnumerator<int> enumerator = operation.Item(DefaultStart, DefaultSize, source.Item).GetEnumerator();
while (enumerator.MoveNext())
{
int current = enumerator.Current;
Assert.Equal(seen++, current);
Assert.Equal(current, enumerator.Current);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
Assert.Throws<NotSupportedException>(() => enumerator.Reset());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement++, x));
Assert.Equal(Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement++, x));
Assert.Equal(Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_ElementSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor, y => -y))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = -group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement--, x));
Assert.Equal(-Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_ElementSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor, y => -y).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = -group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement--, x));
Assert.Equal(-Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupJoin(Labeled<Operation> source, Labeled<Operation> operation)
{
void GroupJoin(Operation left, Operation right)
{
int seenKey = DefaultStart / GroupFactor;
foreach (KeyValuePair<int, IEnumerable<int>> group in left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.GroupJoin(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (k, g) => new KeyValuePair<int, IEnumerable<int>>(k, g)))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group.Value, x => Assert.Equal(seenElement++, x));
Assert.Equal((group.Key + 1) * GroupFactor, seenElement);
}
Assert.Equal((DefaultStart + DefaultSize) / GroupFactor, seenKey);
}
GroupJoin(operation.Item, LabeledDefaultSource.AsOrdered().Item);
GroupJoin(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupJoin_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void GroupJoin(Operation left, Operation right)
{
int seenKey = DefaultStart / GroupFactor;
foreach (KeyValuePair<int, IEnumerable<int>> group in left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.GroupJoin(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (k, g) => new KeyValuePair<int, IEnumerable<int>>(k, g)).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group.Value, x => Assert.Equal(seenElement++, x));
Assert.Equal((group.Key + 1) * GroupFactor, seenElement);
}
Assert.Equal((DefaultStart + DefaultSize) / GroupFactor, seenKey);
}
GroupJoin(operation.Item, LabeledDefaultSource.AsOrdered().Item);
GroupJoin(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Intersect(Labeled<Operation> source, Labeled<Operation> operation)
{
void Intersect(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart - DefaultSize / 2, DefaultSize + DefaultSize / 2, source.Item)
.Intersect(right(DefaultStart, DefaultSize + DefaultSize / 2, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Intersect(operation.Item, DefaultSource);
Intersect(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Intersect_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Intersect(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart - DefaultSize / 2, DefaultSize + DefaultSize / 2, source.Item)
.Intersect(right(DefaultStart, DefaultSize + DefaultSize / 2, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Intersect(operation.Item, DefaultSource);
Intersect(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Join(Labeled<Operation> source, Labeled<Operation> operation)
{
void Join(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<KeyValuePair<int, int>> query = left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.Join(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (x, y) => new KeyValuePair<int, int>(x, y));
foreach (KeyValuePair<int, int> p in query)
{
Assert.Equal(seen++, p.Value);
Assert.Equal(p.Key, p.Value / GroupFactor);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Join(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Join(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Join_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Join(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<KeyValuePair<int, int>> query = left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.Join(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (x, y) => new KeyValuePair<int, int>(x, y));
foreach (KeyValuePair<int, int> p in query.ToList())
{
Assert.Equal(seen++, p.Value);
Assert.Equal(p.Key, p.Value / GroupFactor);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Join(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Join(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Last(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Last_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault_Predicate_None(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Elements(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Predicate_Some(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Predicate_None(Labeled<Operation> operation)
{
Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount(x => x < DefaultStart));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Max(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, DefaultSource).Max());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Max_Nullable(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, DefaultSource).Max(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Min(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, DefaultSource).Min());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Min_Nullable(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, DefaultSource).Min(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OfType<int>())
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<int>().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_Other(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_Other_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>().ToList());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => -x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => -x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => -x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => -x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Reverse(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Reverse())
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Reverse_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Reverse().ToList())
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Select(x => -x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Select(x => -x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Select((x, index) => { Assert.Equal(DefaultStart + index, x); return -x; }))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Select((x, index) => { Assert.Equal(DefaultStart + index, x); return -x; }).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x)))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x)).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x); }))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x); }).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_ResultSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }, (x, y) => y + -DefaultStart - 2 * x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_ResultSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }, (x, y) => y + -DefaultStart - 2 * x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_ResultSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }; }, (x, y) => y + -DefaultStart - 2 * x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_ResultSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }; }, (x, y) => y + -DefaultStart - 2 * x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SequenceEqual(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).SequenceEqual(ParallelEnumerable.Range(DefaultStart, DefaultSize).AsOrdered()));
Assert.True(ParallelEnumerable.Range(DefaultStart, DefaultSize).AsOrdered().SequenceEqual(operation.Item(DefaultStart, DefaultSize, source.Item)));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Single(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, DefaultSource).Single());
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).Single(x => x == DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void SingleOrDefault(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, DefaultSource).SingleOrDefault());
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).SingleOrDefault(x => x == DefaultStart + DefaultSize / 2));
if (!operation.ToString().StartsWith("DefaultIfEmpty"))
{
Assert.Equal(default(int), operation.Item(DefaultStart, 0, DefaultSource).SingleOrDefault());
Assert.Equal(default(int), operation.Item(DefaultStart, 0, DefaultSource).SingleOrDefault(x => x == DefaultStart + DefaultSize / 2));
}
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Skip(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Skip(DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Skip_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Skip(DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Sum(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, DefaultSource).Sum());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Sum_Nullable(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, DefaultSource).Sum(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Take(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Take(DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Take_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Take(DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => -x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => -x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => -x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => -x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ToArray(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).ToArray(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void ToDictionary(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.All(operation.Item(DefaultStart, DefaultSize, DefaultSource).ToDictionary(x => x * 2),
p =>
{
seen.Add(p.Key / 2);
Assert.Equal(p.Key, p.Value * 2);
});
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void ToDictionary_ElementSelector(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.All(operation.Item(DefaultStart, DefaultSize, DefaultSource).ToDictionary(x => x, y => y * 2),
p =>
{
seen.Add(p.Key);
Assert.Equal(p.Key * 2, p.Value);
});
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ToList(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ToLookup(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2);
ILookup<int, int> lookup = operation.Item(DefaultStart, DefaultSize, source.Item).ToLookup(x => x % 2);
Assert.All(lookup,
group =>
{
seenOuter.Add(group.Key);
IntegerRangeSet seenInner = new IntegerRangeSet(DefaultStart / 2, (DefaultSize + ((1 + group.Key) % 2)) / 2);
Assert.All(group, y => { Assert.Equal(group.Key, y % 2); seenInner.Add(y / 2); });
seenInner.AssertComplete();
});
seenOuter.AssertComplete();
Assert.Empty(lookup[-1]);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ToLookup_ElementSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2);
ILookup<int, int> lookup = operation.Item(DefaultStart, DefaultSize, source.Item).ToLookup(x => x % 2, y => -y);
Assert.All(lookup,
group =>
{
seenOuter.Add(group.Key);
IntegerRangeSet seenInner = new IntegerRangeSet(DefaultStart / 2, (DefaultSize + ((1 + group.Key) % 2)) / 2);
Assert.All(group, y => { Assert.Equal(group.Key, -y % 2); seenInner.Add(-y / 2); });
seenInner.AssertComplete();
});
seenOuter.AssertComplete();
Assert.Empty(lookup[-1]);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Union(Labeled<Operation> source, Labeled<Operation> operation)
{
void Union(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize * 3 / 4, source.Item)
.Union(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Union(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Union(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Union_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Union(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize * 3 / 4, source.Item)
.Union(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Union(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Union(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Where(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Where(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Where((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Where((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Zip(Labeled<Operation> source, Labeled<Operation> operation)
{
void Zip(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart * 2, DefaultSize, source.Item)
.Zip(right(0, DefaultSize, source.Item), (x, y) => (x + y) / 2);
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Zip(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Zip(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Zip_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Zip(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart * 2, DefaultSize, source.Item)
.Zip(right(0, DefaultSize, source.Item), (x, y) => (x + y) / 2);
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Zip(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Zip(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using Xunit;
namespace System.Linq.Parallel.Tests
{
[ConditionalClass(typeof(ParallelQueryCombinationTests), nameof(RunSlowTests))]
public static partial class ParallelQueryCombinationTests
{
// On ARM platforms, many available cores make this unbearably slow: https://github.com/dotnet/runtime/issues/29123
public static bool RunSlowTests => PlatformDetection.IsNotArmNorArm64Process || Environment.ProcessorCount <= 8;
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate((x, y) => x + y));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Seed(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (x, y) => x + y));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Result(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (x, y) => x + y, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_Accumulator(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(0, (a, x) => a + x, (l, r) => l + r, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Aggregate_SeedFactory(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize),
operation.Item(DefaultStart, DefaultSize, DefaultSource).Aggregate(() => 0, (a, x) => a + x, (l, r) => l + r, r => r));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void All_False(Labeled<Operation> operation)
{
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).All(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void All_True(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).All(x => seen.Add(x)));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Any_False(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).Any(x => !seen.Add(x)));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Any_True(Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).Any(x => true));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Average(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double)DefaultSize,
operation.Item(DefaultStart, DefaultSize, DefaultSource).Average());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Average_Nullable(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize) / (double?)DefaultSize,
operation.Item(DefaultStart, DefaultSize, DefaultSource).Average(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Cast(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int? i in operation.Item(DefaultStart, DefaultSize, source.Item).Cast<int?>())
{
Assert.True(i.HasValue);
Assert.Equal(seen++, i.Value);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Cast_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Cast<int?>().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Concat(Labeled<Operation> source, Labeled<Operation> operation)
{
void Concat(Operation left, Operation right)
{
int seen = DefaultStart;
foreach (int i in left(DefaultStart, DefaultSize / 2, source.Item)
.Concat(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item)))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Concat(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Concat(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Concat_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Concat(Operation left, Operation right)
{
int seen = DefaultStart;
Assert.All(
left(DefaultStart, DefaultSize / 2, source.Item)
.Concat(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item)).ToList(),
x => Assert.Equal(seen++, x)
);
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Concat(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Concat(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Contains_True(Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, DefaultSource).Contains(DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Contains_False(Labeled<Operation> operation)
{
Assert.False(operation.Item(DefaultStart, DefaultSize, DefaultSource).Contains(DefaultStart + DefaultSize));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Elements(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Predicate_Some(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Count_Predicate_None(Labeled<Operation> operation)
{
Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, DefaultSource).Count(x => x < DefaultStart));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void DefaultIfEmpty(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).DefaultIfEmpty())
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void DefaultIfEmpty_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).DefaultIfEmpty().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Distinct(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
ParallelQuery<int> query = operation.Item(DefaultStart * 2, DefaultSize * 2, source.Item).Select(x => x / 2).Distinct();
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Distinct_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
ParallelQuery<int> query = operation.Item(DefaultStart * 2, DefaultSize * 2, source.Item).Select(x => x / 2).Distinct();
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ElementAt(Labeled<Operation> source, Labeled<Operation> operation)
{
ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item);
int seen = DefaultStart;
for (int i = 0; i < DefaultSize; i++)
{
Assert.Equal(seen++, query.ElementAt(i));
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ElementAtOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
ParallelQuery<int> query = operation.Item(DefaultStart, DefaultSize, source.Item);
int seen = DefaultStart;
for (int i = 0; i < DefaultSize; i++)
{
Assert.Equal(seen++, query.ElementAtOrDefault(i));
}
Assert.Equal(DefaultStart + DefaultSize, seen);
Assert.Equal(default(int), query.ElementAtOrDefault(-1));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Except(Labeled<Operation> source, Labeled<Operation> operation)
{
void Except(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize + DefaultSize / 2, source.Item)
.Except(right(DefaultStart + DefaultSize, DefaultSize, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Except(operation.Item, DefaultSource);
Except(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Except_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Except(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize + DefaultSize / 2, source.Item)
.Except(right(DefaultStart + DefaultSize, DefaultSize, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Except(operation.Item, DefaultSource);
Except(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void First(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).First());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void First_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).First(x => x >= DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => x >= DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void FirstOrDefault_Predicate_None(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ForAll(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
operation.Item(DefaultStart, DefaultSize, source.Item).ForAll(x => seen.Add(x));
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GetEnumerator(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
IEnumerator<int> enumerator = operation.Item(DefaultStart, DefaultSize, source.Item).GetEnumerator();
while (enumerator.MoveNext())
{
int current = enumerator.Current;
Assert.Equal(seen++, current);
Assert.Equal(current, enumerator.Current);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
Assert.Throws<NotSupportedException>(() => enumerator.Reset());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement++, x));
Assert.Equal(Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement++, x));
Assert.Equal(Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_ElementSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor, y => -y))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = -group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement--, x));
Assert.Equal(-Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupBy_ElementSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seenKey = DefaultStart / GroupFactor;
foreach (IGrouping<int, int> group in operation.Item(DefaultStart, DefaultSize, source.Item).GroupBy(x => x / GroupFactor, y => -y).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = -group.Key * GroupFactor;
Assert.All(group, x => Assert.Equal(seenElement--, x));
Assert.Equal(-Math.Min((group.Key + 1) * GroupFactor, DefaultStart + DefaultSize), seenElement);
}
Assert.Equal((DefaultSize + (GroupFactor - 1)) / GroupFactor + 1, seenKey);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupJoin(Labeled<Operation> source, Labeled<Operation> operation)
{
void GroupJoin(Operation left, Operation right)
{
int seenKey = DefaultStart / GroupFactor;
foreach (KeyValuePair<int, IEnumerable<int>> group in left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.GroupJoin(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (k, g) => new KeyValuePair<int, IEnumerable<int>>(k, g)))
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group.Value, x => Assert.Equal(seenElement++, x));
Assert.Equal((group.Key + 1) * GroupFactor, seenElement);
}
Assert.Equal((DefaultStart + DefaultSize) / GroupFactor, seenKey);
}
GroupJoin(operation.Item, LabeledDefaultSource.AsOrdered().Item);
GroupJoin(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void GroupJoin_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void GroupJoin(Operation left, Operation right)
{
int seenKey = DefaultStart / GroupFactor;
foreach (KeyValuePair<int, IEnumerable<int>> group in left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.GroupJoin(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (k, g) => new KeyValuePair<int, IEnumerable<int>>(k, g)).ToList())
{
Assert.Equal(seenKey++, group.Key);
int seenElement = group.Key * GroupFactor;
Assert.All(group.Value, x => Assert.Equal(seenElement++, x));
Assert.Equal((group.Key + 1) * GroupFactor, seenElement);
}
Assert.Equal((DefaultStart + DefaultSize) / GroupFactor, seenKey);
}
GroupJoin(operation.Item, LabeledDefaultSource.AsOrdered().Item);
GroupJoin(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Intersect(Labeled<Operation> source, Labeled<Operation> operation)
{
void Intersect(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart - DefaultSize / 2, DefaultSize + DefaultSize / 2, source.Item)
.Intersect(right(DefaultStart, DefaultSize + DefaultSize / 2, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Intersect(operation.Item, DefaultSource);
Intersect(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Intersect_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Intersect(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart - DefaultSize / 2, DefaultSize + DefaultSize / 2, source.Item)
.Intersect(right(DefaultStart, DefaultSize + DefaultSize / 2, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Intersect(operation.Item, DefaultSource);
Intersect(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Join(Labeled<Operation> source, Labeled<Operation> operation)
{
void Join(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<KeyValuePair<int, int>> query = left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.Join(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (x, y) => new KeyValuePair<int, int>(x, y));
foreach (KeyValuePair<int, int> p in query)
{
Assert.Equal(seen++, p.Value);
Assert.Equal(p.Key, p.Value / GroupFactor);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Join(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Join(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Join_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Join(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<KeyValuePair<int, int>> query = left(DefaultStart / GroupFactor, DefaultSize / GroupFactor, source.Item)
.Join(right(DefaultStart, DefaultSize, source.Item), x => x, y => y / GroupFactor, (x, y) => new KeyValuePair<int, int>(x, y));
foreach (KeyValuePair<int, int> p in query.ToList())
{
Assert.Equal(seen++, p.Value);
Assert.Equal(p.Key, p.Value / GroupFactor);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Join(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Join(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Last(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Last_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).Last(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault_Predicate(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize / 2 - 1, operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void LastOrDefault_Predicate_None(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Equal(default(int), operation.Item(DefaultStart, DefaultSize, source.Item).LastOrDefault(x => false));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Elements(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Predicate_Some(Labeled<Operation> operation)
{
Assert.Equal(DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount(x => x < DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void LongCount_Predicate_None(Labeled<Operation> operation)
{
Assert.Equal(0, operation.Item(DefaultStart, DefaultSize, DefaultSource).LongCount(x => x < DefaultStart));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Max(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, DefaultSource).Max());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Max_Nullable(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart + DefaultSize - 1, operation.Item(DefaultStart, DefaultSize, DefaultSource).Max(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Min(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, DefaultSource).Min());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Min_Nullable(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, DefaultSize, DefaultSource).Min(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OfType<int>())
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<int>().ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_Other(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void OfType_Other_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.Empty(operation.Item(DefaultStart, DefaultSize, source.Item).OfType<long>().ToList());
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => -x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderBy_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => -x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => -x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => -x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void OrderByDescending_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderByDescending(x => x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Reverse(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Reverse())
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Reverse_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Reverse().ToList())
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Select(x => -x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Select(x => -x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Select((x, index) => { Assert.Equal(DefaultStart + index, x); return -x; }))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Select_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Select((x, index) => { Assert.Equal(DefaultStart + index, x); return -x; }).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x)))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x)).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x); }))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }.Select(y => y + -DefaultStart - 2 * x); }).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_ResultSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }, (x, y) => y + -DefaultStart - 2 * x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_ResultSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany(x => new[] { 0, -1 }, (x, y) => y + -DefaultStart - 2 * x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_ResultSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
foreach (int i in operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }; }, (x, y) => y + -DefaultStart - 2 * x))
{
Assert.Equal(seen--, i);
}
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SelectMany_Indexed_ResultSelector_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = -DefaultStart;
Assert.All(operation.Item(0, DefaultSize, source.Item).SelectMany((x, index) => { Assert.Equal(index, x); return new[] { 0, -1 }; }, (x, y) => y + -DefaultStart - 2 * x).ToList(), x => Assert.Equal(seen--, x));
Assert.Equal(-DefaultStart - DefaultSize * 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SequenceEqual(Labeled<Operation> source, Labeled<Operation> operation)
{
Assert.True(operation.Item(DefaultStart, DefaultSize, source.Item).SequenceEqual(ParallelEnumerable.Range(DefaultStart, DefaultSize).AsOrdered()));
Assert.True(ParallelEnumerable.Range(DefaultStart, DefaultSize).AsOrdered().SequenceEqual(operation.Item(DefaultStart, DefaultSize, source.Item)));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Single(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, DefaultSource).Single());
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).Single(x => x == DefaultStart + DefaultSize / 2));
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void SingleOrDefault(Labeled<Operation> operation)
{
Assert.Equal(DefaultStart, operation.Item(DefaultStart, 1, DefaultSource).SingleOrDefault());
Assert.Equal(DefaultStart + DefaultSize / 2, operation.Item(DefaultStart, DefaultSize, DefaultSource).SingleOrDefault(x => x == DefaultStart + DefaultSize / 2));
if (!operation.ToString().StartsWith("DefaultIfEmpty"))
{
Assert.Equal(default(int), operation.Item(DefaultStart, 0, DefaultSource).SingleOrDefault());
Assert.Equal(default(int), operation.Item(DefaultStart, 0, DefaultSource).SingleOrDefault(x => x == DefaultStart + DefaultSize / 2));
}
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Skip(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Skip(DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Skip_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Skip(DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void SkipWhile_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize / 2;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).SkipWhile((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Sum(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, DefaultSource).Sum());
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void Sum_Nullable(Labeled<Operation> operation)
{
Assert.Equal(Functions.SumRange(DefaultStart, DefaultSize), operation.Item(DefaultStart, DefaultSize, DefaultSource).Sum(x => (int?)x));
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Take(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Take(DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Take_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Take(DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void TakeWhile_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).TakeWhile((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => -x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenBy_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenBy(x => -x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_Initial(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => -x))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_Initial_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => -x).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_OtherDirection(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => x))
{
Assert.Equal(--seen, i);
}
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ThenByDescending_OtherDirection_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart + DefaultSize;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).OrderBy(x => 0).ThenByDescending(x => x).ToList(), x => Assert.Equal(--seen, x));
Assert.Equal(DefaultStart, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ToArray(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).ToArray(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void ToDictionary(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.All(operation.Item(DefaultStart, DefaultSize, DefaultSource).ToDictionary(x => x * 2),
p =>
{
seen.Add(p.Key / 2);
Assert.Equal(p.Key, p.Value * 2);
});
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperations))]
[MemberData(nameof(BinaryOperations))]
public static void ToDictionary_ElementSelector(Labeled<Operation> operation)
{
IntegerRangeSet seen = new IntegerRangeSet(DefaultStart, DefaultSize);
Assert.All(operation.Item(DefaultStart, DefaultSize, DefaultSource).ToDictionary(x => x, y => y * 2),
p =>
{
seen.Add(p.Key);
Assert.Equal(p.Key * 2, p.Value);
});
seen.AssertComplete();
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void ToList(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ToLookup(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2);
ILookup<int, int> lookup = operation.Item(DefaultStart, DefaultSize, source.Item).ToLookup(x => x % 2);
Assert.All(lookup,
group =>
{
seenOuter.Add(group.Key);
IntegerRangeSet seenInner = new IntegerRangeSet(DefaultStart / 2, (DefaultSize + ((1 + group.Key) % 2)) / 2);
Assert.All(group, y => { Assert.Equal(group.Key, y % 2); seenInner.Add(y / 2); });
seenInner.AssertComplete();
});
seenOuter.AssertComplete();
Assert.Empty(lookup[-1]);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
[MemberData(nameof(UnaryUnorderedOperators))]
[MemberData(nameof(BinaryUnorderedOperators))]
public static void ToLookup_ElementSelector(Labeled<Operation> source, Labeled<Operation> operation)
{
IntegerRangeSet seenOuter = new IntegerRangeSet(0, 2);
ILookup<int, int> lookup = operation.Item(DefaultStart, DefaultSize, source.Item).ToLookup(x => x % 2, y => -y);
Assert.All(lookup,
group =>
{
seenOuter.Add(group.Key);
IntegerRangeSet seenInner = new IntegerRangeSet(DefaultStart / 2, (DefaultSize + ((1 + group.Key) % 2)) / 2);
Assert.All(group, y => { Assert.Equal(group.Key, -y % 2); seenInner.Add(-y / 2); });
seenInner.AssertComplete();
});
seenOuter.AssertComplete();
Assert.Empty(lookup[-1]);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Union(Labeled<Operation> source, Labeled<Operation> operation)
{
void Union(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize * 3 / 4, source.Item)
.Union(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item));
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Union(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Union(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Union_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Union(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart, DefaultSize * 3 / 4, source.Item)
.Union(right(DefaultStart + DefaultSize / 2, DefaultSize / 2, source.Item));
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Union(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Union(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Where(x => x < DefaultStart + DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Where(x => x < DefaultStart + DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_Indexed(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
foreach (int i in operation.Item(DefaultStart, DefaultSize, source.Item).Where((x, index) => index < DefaultSize / 2))
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Where_Indexed_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
int seen = DefaultStart;
Assert.All(operation.Item(DefaultStart, DefaultSize, source.Item).Where((x, index) => index < DefaultSize / 2).ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize / 2, seen);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Zip(Labeled<Operation> source, Labeled<Operation> operation)
{
void Zip(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart * 2, DefaultSize, source.Item)
.Zip(right(0, DefaultSize, source.Item), (x, y) => (x + y) / 2);
foreach (int i in query)
{
Assert.Equal(seen++, i);
}
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Zip(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Zip(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
[Theory]
[MemberData(nameof(UnaryOperators))]
[MemberData(nameof(BinaryOperators))]
public static void Zip_NotPipelined(Labeled<Operation> source, Labeled<Operation> operation)
{
void Zip(Operation left, Operation right)
{
int seen = DefaultStart;
ParallelQuery<int> query = left(DefaultStart * 2, DefaultSize, source.Item)
.Zip(right(0, DefaultSize, source.Item), (x, y) => (x + y) / 2);
Assert.All(query.ToList(), x => Assert.Equal(seen++, x));
Assert.Equal(DefaultStart + DefaultSize, seen);
}
Zip(operation.Item, LabeledDefaultSource.AsOrdered().Item);
Zip(LabeledDefaultSource.AsOrdered().Item, operation.Item);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.CoreLib/src/System/Int32.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace System
{
[Serializable]
[StructLayout(LayoutKind.Sequential)]
[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public readonly struct Int32 : IComparable, IConvertible, ISpanFormattable, IComparable<int>, IEquatable<int>
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001, CA2252 // SA1001: Comma positioning; CA2252: Preview Features
, IBinaryInteger<int>,
IMinMaxValue<int>,
ISignedNumber<int>
#pragma warning restore SA1001, CA2252
#endif // FEATURE_GENERIC_MATH
{
private readonly int m_value; // Do not rename (binary serialization)
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
// Compares this object to another object, returning an integer that
// indicates the relationship.
// Returns :
// 0 if the values are equal
// Negative number if _value is less than value
// Positive number if _value is more than value
// null is considered to be less than any instance, hence returns positive number
// If object is not of type Int32, this method throws an ArgumentException.
//
public int CompareTo(object? value)
{
if (value == null)
{
return 1;
}
// NOTE: Cannot use return (_value - value) as this causes a wrap
// around in cases where _value - value > MaxValue.
if (value is int i)
{
if (m_value < i) return -1;
if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeInt32);
}
public int CompareTo(int value)
{
// NOTE: Cannot use return (_value - value) as this causes a wrap
// around in cases where _value - value > MaxValue.
if (m_value < value) return -1;
if (m_value > value) return 1;
return 0;
}
public override bool Equals([NotNullWhen(true)] object? obj)
{
if (!(obj is int))
{
return false;
}
return m_value == ((int)obj).m_value;
}
[NonVersionable]
public bool Equals(int obj)
{
return m_value == obj;
}
// The absolute value of the int contained.
public override int GetHashCode()
{
return m_value;
}
public override string ToString()
{
return Number.Int32ToDecStr(m_value);
}
public string ToString(string? format)
{
return ToString(format, null);
}
public string ToString(IFormatProvider? provider)
{
return Number.FormatInt32(m_value, 0, null, provider);
}
public string ToString(string? format, IFormatProvider? provider)
{
return Number.FormatInt32(m_value, ~0, format, provider);
}
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
{
return Number.TryFormatInt32(m_value, ~0, format, provider, destination, out charsWritten);
}
public static int Parse(string s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo);
}
public static int Parse(string s, NumberStyles style)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, style, NumberFormatInfo.CurrentInfo);
}
// Parses an integer from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
//
public static int Parse(string s, IFormatProvider? provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider));
}
// Parses an integer from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
//
public static int Parse(string s, NumberStyles style, IFormatProvider? provider)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, style, NumberFormatInfo.GetInstance(provider));
}
public static int Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.ParseInt32(s, style, NumberFormatInfo.GetInstance(provider));
}
// Parses an integer from a String. Returns false rather
// than throwing an exception if input is invalid.
//
public static bool TryParse([NotNullWhen(true)] string? s, out int result)
{
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseInt32IntegerStyle(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result) == Number.ParsingStatus.OK;
}
public static bool TryParse(ReadOnlySpan<char> s, out int result)
{
return Number.TryParseInt32IntegerStyle(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result) == Number.ParsingStatus.OK;
}
// Parses an integer from a String in the given style. Returns false rather
// than throwing an exception if input is invalid.
//
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out int result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK;
}
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out int result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.TryParseInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK;
}
//
// IConvertible implementation
//
public TypeCode GetTypeCode()
{
return TypeCode.Int32;
}
bool IConvertible.ToBoolean(IFormatProvider? provider)
{
return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider? provider)
{
return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider? provider)
{
return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider? provider)
{
return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider? provider)
{
return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider? provider)
{
return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider? provider)
{
return m_value;
}
uint IConvertible.ToUInt32(IFormatProvider? provider)
{
return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider? provider)
{
return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider? provider)
{
return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider? provider)
{
return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider? provider)
{
return Convert.ToDouble(m_value);
}
decimal IConvertible.ToDecimal(IFormatProvider? provider)
{
return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider? provider)
{
throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime"));
}
object IConvertible.ToType(Type type, IFormatProvider? provider)
{
return Convert.DefaultToType((IConvertible)this, type, provider);
}
#if FEATURE_GENERIC_MATH
//
// IAdditionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IAdditionOperators<int, int, int>.operator +(int left, int right)
=> left + right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IAdditionOperators<int, int, int>.operator +(int left, int right)
// => checked(left + right);
//
// IAdditiveIdentity
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IAdditiveIdentity<int, int>.AdditiveIdentity => 0;
//
// IBinaryInteger
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.LeadingZeroCount(int value)
=> BitOperations.LeadingZeroCount((uint)value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.PopCount(int value)
=> BitOperations.PopCount((uint)value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.RotateLeft(int value, int rotateAmount)
=> (int)BitOperations.RotateLeft((uint)value, rotateAmount);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.RotateRight(int value, int rotateAmount)
=> (int)BitOperations.RotateRight((uint)value, rotateAmount);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.TrailingZeroCount(int value)
=> BitOperations.TrailingZeroCount(value);
//
// IBinaryNumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IBinaryNumber<int>.IsPow2(int value)
=> BitOperations.IsPow2(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryNumber<int>.Log2(int value)
{
if (value < 0)
{
ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException();
}
return BitOperations.Log2((uint)value);
}
//
// IBitwiseOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator &(int left, int right)
=> left & right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator |(int left, int right)
=> left | right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator ^(int left, int right)
=> left ^ right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator ~(int value)
=> ~value;
//
// IComparisonOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator <(int left, int right)
=> left < right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator <=(int left, int right)
=> left <= right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator >(int left, int right)
=> left > right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator >=(int left, int right)
=> left >= right;
//
// IDecrementOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IDecrementOperators<int>.operator --(int value)
=> --value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IDecrementOperators<int>.operator --(int value)
// => checked(--value);
//
// IDivisionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IDivisionOperators<int, int, int>.operator /(int left, int right)
=> left / right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IDivisionOperators<int, int, int>.operator /(int left, int right)
// => checked(left / right);
//
// IEqualityOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<int, int>.operator ==(int left, int right)
=> left == right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<int, int>.operator !=(int left, int right)
=> left != right;
//
// IIncrementOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IIncrementOperators<int>.operator ++(int value)
=> ++value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IIncrementOperators<int>.operator ++(int value)
// => checked(++value);
//
// IMinMaxValue
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMinMaxValue<int>.MinValue => MinValue;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMinMaxValue<int>.MaxValue => MaxValue;
//
// IModulusOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IModulusOperators<int, int, int>.operator %(int left, int right)
=> left % right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IModulusOperators<int, int, int>.operator %(int left, int right)
// => checked(left % right);
//
// IMultiplicativeIdentity
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMultiplicativeIdentity<int, int>.MultiplicativeIdentity => 1;
//
// IMultiplyOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMultiplyOperators<int, int, int>.operator *(int left, int right)
=> left * right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IMultiplyOperators<int, int, int>.operator *(int left, int right)
// => checked(left * right);
//
// INumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.One => 1;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Zero => 0;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Abs(int value)
=> Math.Abs(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Clamp(int value, int min, int max)
=> Math.Clamp(value, min, max);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
internal static int Create<TOther>(TOther value)
where TOther : INumber<TOther>
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
return checked((int)(decimal)(object)value);
}
else if (typeof(TOther) == typeof(double))
{
return checked((int)(double)(object)value);
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
return checked((int)(long)(object)value);
}
else if (typeof(TOther) == typeof(nint))
{
return checked((int)(nint)(object)value);
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
return checked((int)(float)(object)value);
}
else if (typeof(TOther) == typeof(ushort))
{
return checked((int)(ushort)(object)value);
}
else if (typeof(TOther) == typeof(uint))
{
return checked((int)(uint)(object)value);
}
else if (typeof(TOther) == typeof(ulong))
{
return checked((int)(ulong)(object)value);
}
else if (typeof(TOther) == typeof(nuint))
{
return checked((int)(nuint)(object)value);
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.Create<TOther>(TOther value)
=> Create(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.CreateSaturating<TOther>(TOther value)
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
var actualValue = (decimal)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(double))
{
var actualValue = (double)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
var actualValue = (long)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(nint))
{
var actualValue = (nint)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
var actualValue = (float)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(ushort))
{
return (ushort)(object)value;
}
else if (typeof(TOther) == typeof(uint))
{
var actualValue = (uint)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(ulong))
{
var actualValue = (ulong)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(nuint))
{
var actualValue = (nuint)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.CreateTruncating<TOther>(TOther value)
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
return (int)(decimal)(object)value;
}
else if (typeof(TOther) == typeof(double))
{
return (int)(double)(object)value;
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
return (int)(long)(object)value;
}
else if (typeof(TOther) == typeof(nint))
{
return (int)(nint)(object)value;
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
return (int)(float)(object)value;
}
else if (typeof(TOther) == typeof(ushort))
{
return (ushort)(object)value;
}
else if (typeof(TOther) == typeof(uint))
{
return (int)(uint)(object)value;
}
else if (typeof(TOther) == typeof(ulong))
{
return (int)(ulong)(object)value;
}
else if (typeof(TOther) == typeof(nuint))
{
return (int)(nuint)(object)value;
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static (int Quotient, int Remainder) INumber<int>.DivRem(int left, int right)
=> Math.DivRem(left, right);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Max(int x, int y)
=> Math.Max(x, y);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Min(int x, int y)
=> Math.Min(x, y);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Parse(string s, NumberStyles style, IFormatProvider? provider)
=> Parse(s, style, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider)
=> Parse(s, style, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Sign(int value)
=> Math.Sign(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool INumber<int>.TryCreate<TOther>(TOther value, out int result)
{
if (typeof(TOther) == typeof(byte))
{
result = (byte)(object)value;
return true;
}
else if (typeof(TOther) == typeof(char))
{
result = (char)(object)value;
return true;
}
else if (typeof(TOther) == typeof(decimal))
{
var actualValue = (decimal)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(double))
{
var actualValue = (double)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(short))
{
result = (short)(object)value;
return true;
}
else if (typeof(TOther) == typeof(int))
{
result = (int)(object)value;
return true;
}
else if (typeof(TOther) == typeof(long))
{
var actualValue = (long)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(nint))
{
var actualValue = (nint)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(sbyte))
{
result = (sbyte)(object)value;
return true;
}
else if (typeof(TOther) == typeof(float))
{
var actualValue = (float)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(ushort))
{
result = (ushort)(object)value;
return true;
}
else if (typeof(TOther) == typeof(uint))
{
var actualValue = (uint)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(ulong))
{
var actualValue = (ulong)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(nuint))
{
var actualValue = (nuint)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else
{
ThrowHelper.ThrowNotSupportedException();
result = default;
return false;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool INumber<int>.TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out int result)
=> TryParse(s, style, provider, out result);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool INumber<int>.TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out int result)
=> TryParse(s, style, provider, out result);
//
// IParseable
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IParseable<int>.Parse(string s, IFormatProvider? provider)
=> Parse(s, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IParseable<int>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out int result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
//
// IShiftOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IShiftOperators<int, int>.operator <<(int value, int shiftAmount)
=> value << shiftAmount;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IShiftOperators<int, int>.operator >>(int value, int shiftAmount)
=> value >> shiftAmount;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static int IShiftOperators<int, int>.operator >>>(int value, int shiftAmount)
// => (int)((uint)value >> shiftAmount);
//
// ISignedNumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISignedNumber<int>.NegativeOne => -1;
//
// ISpanParseable
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISpanParseable<int>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool ISpanParseable<int>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out int result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
//
// ISubtractionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISubtractionOperators<int, int, int>.operator -(int left, int right)
=> left - right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int ISubtractionOperators<int, int, int>.operator -(int left, int right)
// => checked(left - right);
//
// IUnaryNegationOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IUnaryNegationOperators<int, int>.operator -(int value)
=> -value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IUnaryNegationOperators<int, int>.operator -(int value)
// => checked(-value);
//
// IUnaryPlusOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IUnaryPlusOperators<int, int>.operator +(int value)
=> +value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IUnaryPlusOperators<int, int>.operator +(int value)
// => checked(+value);
#endif // FEATURE_GENERIC_MATH
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace System
{
[Serializable]
[StructLayout(LayoutKind.Sequential)]
[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public readonly struct Int32 : IComparable, IConvertible, ISpanFormattable, IComparable<int>, IEquatable<int>
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001, CA2252 // SA1001: Comma positioning; CA2252: Preview Features
, IBinaryInteger<int>,
IMinMaxValue<int>,
ISignedNumber<int>
#pragma warning restore SA1001, CA2252
#endif // FEATURE_GENERIC_MATH
{
private readonly int m_value; // Do not rename (binary serialization)
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
// Compares this object to another object, returning an integer that
// indicates the relationship.
// Returns :
// 0 if the values are equal
// Negative number if _value is less than value
// Positive number if _value is more than value
// null is considered to be less than any instance, hence returns positive number
// If object is not of type Int32, this method throws an ArgumentException.
//
public int CompareTo(object? value)
{
if (value == null)
{
return 1;
}
// NOTE: Cannot use return (_value - value) as this causes a wrap
// around in cases where _value - value > MaxValue.
if (value is int i)
{
if (m_value < i) return -1;
if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeInt32);
}
public int CompareTo(int value)
{
// NOTE: Cannot use return (_value - value) as this causes a wrap
// around in cases where _value - value > MaxValue.
if (m_value < value) return -1;
if (m_value > value) return 1;
return 0;
}
public override bool Equals([NotNullWhen(true)] object? obj)
{
if (!(obj is int))
{
return false;
}
return m_value == ((int)obj).m_value;
}
[NonVersionable]
public bool Equals(int obj)
{
return m_value == obj;
}
// The absolute value of the int contained.
public override int GetHashCode()
{
return m_value;
}
public override string ToString()
{
return Number.Int32ToDecStr(m_value);
}
public string ToString(string? format)
{
return ToString(format, null);
}
public string ToString(IFormatProvider? provider)
{
return Number.FormatInt32(m_value, 0, null, provider);
}
public string ToString(string? format, IFormatProvider? provider)
{
return Number.FormatInt32(m_value, ~0, format, provider);
}
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
{
return Number.TryFormatInt32(m_value, ~0, format, provider, destination, out charsWritten);
}
public static int Parse(string s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo);
}
public static int Parse(string s, NumberStyles style)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, style, NumberFormatInfo.CurrentInfo);
}
// Parses an integer from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
//
public static int Parse(string s, IFormatProvider? provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider));
}
// Parses an integer from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
//
public static int Parse(string s, NumberStyles style, IFormatProvider? provider)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseInt32(s, style, NumberFormatInfo.GetInstance(provider));
}
public static int Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.ParseInt32(s, style, NumberFormatInfo.GetInstance(provider));
}
// Parses an integer from a String. Returns false rather
// than throwing an exception if input is invalid.
//
public static bool TryParse([NotNullWhen(true)] string? s, out int result)
{
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseInt32IntegerStyle(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result) == Number.ParsingStatus.OK;
}
public static bool TryParse(ReadOnlySpan<char> s, out int result)
{
return Number.TryParseInt32IntegerStyle(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result) == Number.ParsingStatus.OK;
}
// Parses an integer from a String in the given style. Returns false rather
// than throwing an exception if input is invalid.
//
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out int result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK;
}
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out int result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.TryParseInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK;
}
//
// IConvertible implementation
//
public TypeCode GetTypeCode()
{
return TypeCode.Int32;
}
bool IConvertible.ToBoolean(IFormatProvider? provider)
{
return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider? provider)
{
return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider? provider)
{
return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider? provider)
{
return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider? provider)
{
return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider? provider)
{
return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider? provider)
{
return m_value;
}
uint IConvertible.ToUInt32(IFormatProvider? provider)
{
return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider? provider)
{
return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider? provider)
{
return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider? provider)
{
return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider? provider)
{
return Convert.ToDouble(m_value);
}
decimal IConvertible.ToDecimal(IFormatProvider? provider)
{
return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider? provider)
{
throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime"));
}
object IConvertible.ToType(Type type, IFormatProvider? provider)
{
return Convert.DefaultToType((IConvertible)this, type, provider);
}
#if FEATURE_GENERIC_MATH
//
// IAdditionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IAdditionOperators<int, int, int>.operator +(int left, int right)
=> left + right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IAdditionOperators<int, int, int>.operator +(int left, int right)
// => checked(left + right);
//
// IAdditiveIdentity
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IAdditiveIdentity<int, int>.AdditiveIdentity => 0;
//
// IBinaryInteger
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.LeadingZeroCount(int value)
=> BitOperations.LeadingZeroCount((uint)value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.PopCount(int value)
=> BitOperations.PopCount((uint)value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.RotateLeft(int value, int rotateAmount)
=> (int)BitOperations.RotateLeft((uint)value, rotateAmount);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.RotateRight(int value, int rotateAmount)
=> (int)BitOperations.RotateRight((uint)value, rotateAmount);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryInteger<int>.TrailingZeroCount(int value)
=> BitOperations.TrailingZeroCount(value);
//
// IBinaryNumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IBinaryNumber<int>.IsPow2(int value)
=> BitOperations.IsPow2(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBinaryNumber<int>.Log2(int value)
{
if (value < 0)
{
ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException();
}
return BitOperations.Log2((uint)value);
}
//
// IBitwiseOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator &(int left, int right)
=> left & right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator |(int left, int right)
=> left | right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator ^(int left, int right)
=> left ^ right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IBitwiseOperators<int, int, int>.operator ~(int value)
=> ~value;
//
// IComparisonOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator <(int left, int right)
=> left < right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator <=(int left, int right)
=> left <= right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator >(int left, int right)
=> left > right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<int, int>.operator >=(int left, int right)
=> left >= right;
//
// IDecrementOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IDecrementOperators<int>.operator --(int value)
=> --value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IDecrementOperators<int>.operator --(int value)
// => checked(--value);
//
// IDivisionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IDivisionOperators<int, int, int>.operator /(int left, int right)
=> left / right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IDivisionOperators<int, int, int>.operator /(int left, int right)
// => checked(left / right);
//
// IEqualityOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<int, int>.operator ==(int left, int right)
=> left == right;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<int, int>.operator !=(int left, int right)
=> left != right;
//
// IIncrementOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IIncrementOperators<int>.operator ++(int value)
=> ++value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IIncrementOperators<int>.operator ++(int value)
// => checked(++value);
//
// IMinMaxValue
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMinMaxValue<int>.MinValue => MinValue;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMinMaxValue<int>.MaxValue => MaxValue;
//
// IModulusOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IModulusOperators<int, int, int>.operator %(int left, int right)
=> left % right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IModulusOperators<int, int, int>.operator %(int left, int right)
// => checked(left % right);
//
// IMultiplicativeIdentity
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMultiplicativeIdentity<int, int>.MultiplicativeIdentity => 1;
//
// IMultiplyOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IMultiplyOperators<int, int, int>.operator *(int left, int right)
=> left * right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IMultiplyOperators<int, int, int>.operator *(int left, int right)
// => checked(left * right);
//
// INumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.One => 1;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Zero => 0;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Abs(int value)
=> Math.Abs(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Clamp(int value, int min, int max)
=> Math.Clamp(value, min, max);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
internal static int Create<TOther>(TOther value)
where TOther : INumber<TOther>
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
return checked((int)(decimal)(object)value);
}
else if (typeof(TOther) == typeof(double))
{
return checked((int)(double)(object)value);
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
return checked((int)(long)(object)value);
}
else if (typeof(TOther) == typeof(nint))
{
return checked((int)(nint)(object)value);
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
return checked((int)(float)(object)value);
}
else if (typeof(TOther) == typeof(ushort))
{
return checked((int)(ushort)(object)value);
}
else if (typeof(TOther) == typeof(uint))
{
return checked((int)(uint)(object)value);
}
else if (typeof(TOther) == typeof(ulong))
{
return checked((int)(ulong)(object)value);
}
else if (typeof(TOther) == typeof(nuint))
{
return checked((int)(nuint)(object)value);
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.Create<TOther>(TOther value)
=> Create(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.CreateSaturating<TOther>(TOther value)
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
var actualValue = (decimal)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(double))
{
var actualValue = (double)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
var actualValue = (long)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(nint))
{
var actualValue = (nint)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
var actualValue = (float)(object)value;
return (actualValue > MaxValue) ? MaxValue :
(actualValue < MinValue) ? MinValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(ushort))
{
return (ushort)(object)value;
}
else if (typeof(TOther) == typeof(uint))
{
var actualValue = (uint)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(ulong))
{
var actualValue = (ulong)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else if (typeof(TOther) == typeof(nuint))
{
var actualValue = (nuint)(object)value;
return (actualValue > MaxValue) ? MaxValue : (int)actualValue;
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static int INumber<int>.CreateTruncating<TOther>(TOther value)
{
if (typeof(TOther) == typeof(byte))
{
return (byte)(object)value;
}
else if (typeof(TOther) == typeof(char))
{
return (char)(object)value;
}
else if (typeof(TOther) == typeof(decimal))
{
return (int)(decimal)(object)value;
}
else if (typeof(TOther) == typeof(double))
{
return (int)(double)(object)value;
}
else if (typeof(TOther) == typeof(short))
{
return (short)(object)value;
}
else if (typeof(TOther) == typeof(int))
{
return (int)(object)value;
}
else if (typeof(TOther) == typeof(long))
{
return (int)(long)(object)value;
}
else if (typeof(TOther) == typeof(nint))
{
return (int)(nint)(object)value;
}
else if (typeof(TOther) == typeof(sbyte))
{
return (sbyte)(object)value;
}
else if (typeof(TOther) == typeof(float))
{
return (int)(float)(object)value;
}
else if (typeof(TOther) == typeof(ushort))
{
return (ushort)(object)value;
}
else if (typeof(TOther) == typeof(uint))
{
return (int)(uint)(object)value;
}
else if (typeof(TOther) == typeof(ulong))
{
return (int)(ulong)(object)value;
}
else if (typeof(TOther) == typeof(nuint))
{
return (int)(nuint)(object)value;
}
else
{
ThrowHelper.ThrowNotSupportedException();
return default;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static (int Quotient, int Remainder) INumber<int>.DivRem(int left, int right)
=> Math.DivRem(left, right);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Max(int x, int y)
=> Math.Max(x, y);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Min(int x, int y)
=> Math.Min(x, y);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Parse(string s, NumberStyles style, IFormatProvider? provider)
=> Parse(s, style, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider)
=> Parse(s, style, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int INumber<int>.Sign(int value)
=> Math.Sign(value);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool INumber<int>.TryCreate<TOther>(TOther value, out int result)
{
if (typeof(TOther) == typeof(byte))
{
result = (byte)(object)value;
return true;
}
else if (typeof(TOther) == typeof(char))
{
result = (char)(object)value;
return true;
}
else if (typeof(TOther) == typeof(decimal))
{
var actualValue = (decimal)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(double))
{
var actualValue = (double)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(short))
{
result = (short)(object)value;
return true;
}
else if (typeof(TOther) == typeof(int))
{
result = (int)(object)value;
return true;
}
else if (typeof(TOther) == typeof(long))
{
var actualValue = (long)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(nint))
{
var actualValue = (nint)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(sbyte))
{
result = (sbyte)(object)value;
return true;
}
else if (typeof(TOther) == typeof(float))
{
var actualValue = (float)(object)value;
if ((actualValue < MinValue) || (actualValue > MaxValue))
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(ushort))
{
result = (ushort)(object)value;
return true;
}
else if (typeof(TOther) == typeof(uint))
{
var actualValue = (uint)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(ulong))
{
var actualValue = (ulong)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else if (typeof(TOther) == typeof(nuint))
{
var actualValue = (nuint)(object)value;
if (actualValue > MaxValue)
{
result = default;
return false;
}
result = (int)actualValue;
return true;
}
else
{
ThrowHelper.ThrowNotSupportedException();
result = default;
return false;
}
}
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool INumber<int>.TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out int result)
=> TryParse(s, style, provider, out result);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool INumber<int>.TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out int result)
=> TryParse(s, style, provider, out result);
//
// IParseable
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IParseable<int>.Parse(string s, IFormatProvider? provider)
=> Parse(s, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IParseable<int>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out int result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
//
// IShiftOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IShiftOperators<int, int>.operator <<(int value, int shiftAmount)
=> value << shiftAmount;
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IShiftOperators<int, int>.operator >>(int value, int shiftAmount)
=> value >> shiftAmount;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static int IShiftOperators<int, int>.operator >>>(int value, int shiftAmount)
// => (int)((uint)value >> shiftAmount);
//
// ISignedNumber
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISignedNumber<int>.NegativeOne => -1;
//
// ISpanParseable
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISpanParseable<int>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, NumberStyles.Integer, provider);
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool ISpanParseable<int>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out int result)
=> TryParse(s, NumberStyles.Integer, provider, out result);
//
// ISubtractionOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int ISubtractionOperators<int, int, int>.operator -(int left, int right)
=> left - right;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int ISubtractionOperators<int, int, int>.operator -(int left, int right)
// => checked(left - right);
//
// IUnaryNegationOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IUnaryNegationOperators<int, int>.operator -(int value)
=> -value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IUnaryNegationOperators<int, int>.operator -(int value)
// => checked(-value);
//
// IUnaryPlusOperators
//
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static int IUnaryPlusOperators<int, int>.operator +(int value)
=> +value;
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked int IUnaryPlusOperators<int, int>.operator +(int value)
// => checked(+value);
#endif // FEATURE_GENERIC_MATH
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/API/GC/GetAllocatedBytesForCurrentThread.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Tests GC.Collect()
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Reflection;
public class Test_GetAllocatedBytesForCurrentThread
{
static Random Rand = new Random();
public static bool GetAllocatedBytesForCurrentThread(int size)
{
int startCount = GC.CollectionCount(0);
long start = GC.GetAllocatedBytesForCurrentThread();
GC.KeepAlive(new String('a', size));
long end = GC.GetAllocatedBytesForCurrentThread();
int endCount = GC.CollectionCount(0);
if (start == end)
{
Console.WriteLine("GetAllocatedBytesForCurrentThread: start and end same!");
return false;
}
return true;
}
static int Alloc(List<object> list, int size)
{
int toAlloc = Rand.Next(size / 2 , (int)((float)size * 1.5));
Console.WriteLine("allocating {0} bytes", toAlloc);
int allocated = 0;
while (allocated < toAlloc)
{
int s = Rand.Next(100, 1000);
allocated += s + 24;
byte[] b = new byte[s];
list.Add((object)b);
}
return allocated;
}
static bool TestWithAlloc()
{
int allocatedBytes = 0;
for (int i = 0; i < 100; i++)
{
List<object> list = new List<object>();
allocatedBytes = Alloc(list, 80*1024*1024);
if (!GetAllocatedBytesForCurrentThread (100000))
{
return false;
}
Console.WriteLine("iter {0} allocated {1} bytes", i, allocatedBytes);
}
return true;
}
// In core 1.0 we didn't have the API exposed so needed to use reflection to get it.
// This should be split into 2 tests, with and without GC.Collect.
static bool TestCore1(bool testWithCollection)
{
const string name = "GetAllocatedBytesForCurrentThread";
var typeInfo = typeof(GC).GetTypeInfo();
var method = typeInfo.GetMethod(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
long nBytesBefore = 0;
long nBytesAfter = 0;
int countBefore = GC.CollectionCount(0);
int bytesDiff = 0;
for (int i = 0; i < 10000; ++i)
{
nBytesBefore = (long)method.Invoke(null, null);
// Test with collection.
if (testWithCollection)
{
GC.Collect();
}
nBytesAfter = (long)method.Invoke(null, null);
if (nBytesAfter == nBytesBefore) // Shouldn't be the same
{
int countAfter = GC.CollectionCount(0);
Console.WriteLine("b: {0}, a: {1}, iter {2}, {3}->{4}", nBytesBefore, nBytesAfter, i, countBefore, countAfter);
return false;
}
}
return true;
}
public static int Main()
{
// First test with collection
if (!TestCore1(true))
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
// Test without collection
if (!TestCore1(false))
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
if (!TestWithAlloc())
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() passed!");
return 100;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Tests GC.Collect()
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Reflection;
public class Test_GetAllocatedBytesForCurrentThread
{
static Random Rand = new Random();
public static bool GetAllocatedBytesForCurrentThread(int size)
{
int startCount = GC.CollectionCount(0);
long start = GC.GetAllocatedBytesForCurrentThread();
GC.KeepAlive(new String('a', size));
long end = GC.GetAllocatedBytesForCurrentThread();
int endCount = GC.CollectionCount(0);
if (start == end)
{
Console.WriteLine("GetAllocatedBytesForCurrentThread: start and end same!");
return false;
}
return true;
}
static int Alloc(List<object> list, int size)
{
int toAlloc = Rand.Next(size / 2 , (int)((float)size * 1.5));
Console.WriteLine("allocating {0} bytes", toAlloc);
int allocated = 0;
while (allocated < toAlloc)
{
int s = Rand.Next(100, 1000);
allocated += s + 24;
byte[] b = new byte[s];
list.Add((object)b);
}
return allocated;
}
static bool TestWithAlloc()
{
int allocatedBytes = 0;
for (int i = 0; i < 100; i++)
{
List<object> list = new List<object>();
allocatedBytes = Alloc(list, 80*1024*1024);
if (!GetAllocatedBytesForCurrentThread (100000))
{
return false;
}
Console.WriteLine("iter {0} allocated {1} bytes", i, allocatedBytes);
}
return true;
}
// In core 1.0 we didn't have the API exposed so needed to use reflection to get it.
// This should be split into 2 tests, with and without GC.Collect.
static bool TestCore1(bool testWithCollection)
{
const string name = "GetAllocatedBytesForCurrentThread";
var typeInfo = typeof(GC).GetTypeInfo();
var method = typeInfo.GetMethod(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
long nBytesBefore = 0;
long nBytesAfter = 0;
int countBefore = GC.CollectionCount(0);
int bytesDiff = 0;
for (int i = 0; i < 10000; ++i)
{
nBytesBefore = (long)method.Invoke(null, null);
// Test with collection.
if (testWithCollection)
{
GC.Collect();
}
nBytesAfter = (long)method.Invoke(null, null);
if (nBytesAfter == nBytesBefore) // Shouldn't be the same
{
int countAfter = GC.CollectionCount(0);
Console.WriteLine("b: {0}, a: {1}, iter {2}, {3}->{4}", nBytesBefore, nBytesAfter, i, countBefore, countAfter);
return false;
}
}
return true;
}
public static int Main()
{
// First test with collection
if (!TestCore1(true))
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
// Test without collection
if (!TestCore1(false))
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
if (!TestWithAlloc())
{
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() failed!");
return 1;
}
Console.WriteLine("Test for GetAllocatedBytesForCurrentThread() passed!");
return 100;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Diagnostics.TraceSource/tests/TestTraceListener.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.IO;
namespace System.Diagnostics.TraceSourceTests
{
// mock TraceListener to make assertions against TraceSource behavior
internal class TestTraceListener : TraceListener
{
public enum Method
{
TraceEvent = 0,
TraceData,
TraceTransfer,
Dispose,
Write,
WriteLine,
Flush,
Fail,
Close
//NOTE: update MethodEnumCount if values are added
}
private const int MethodEnumCount = 9;
public TestTraceListener(bool threadSafe = false)
: this(null, threadSafe)
{
}
public TestTraceListener(string name, bool threadSafe = false)
: base(name)
{
_threadSafe = threadSafe;
_calls = new int[MethodEnumCount];
}
private bool _threadSafe;
private int[] _calls;
public override bool IsThreadSafe
{
get
{
return _threadSafe;
}
}
/// <summary>
/// Gets the number of times any of the public methods on this instance were called.
/// </summary>
public int GetCallCount(Method group)
{
return _calls[(int)group];
}
private void Call(Method method)
{
_calls[(int)method]++;
}
protected override void Dispose(bool disposing)
{
Call(Method.Dispose);
}
public override void Fail(string message)
{
Call(Method.Fail);
}
public override void Fail(string message, string detailMessage)
{
Call(Method.Fail);
}
public override void Flush()
{
Call(Method.Flush);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
{
Call(Method.TraceEvent);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
{
Call(Method.TraceEvent);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
{
Call(Method.TraceEvent);
}
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
{
Call(Method.TraceData);
}
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
{
Call(Method.TraceData);
}
public override void TraceTransfer(TraceEventCache eventCache, string source, int id, string message, Guid relatedActivityId)
{
Call(Method.TraceTransfer);
}
public override void Write(string message)
{
Call(Method.Write);
}
public override void WriteLine(string message)
{
Call(Method.WriteLine);
}
public override void Close()
{
Call(Method.Close);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.IO;
namespace System.Diagnostics.TraceSourceTests
{
// mock TraceListener to make assertions against TraceSource behavior
internal class TestTraceListener : TraceListener
{
public enum Method
{
TraceEvent = 0,
TraceData,
TraceTransfer,
Dispose,
Write,
WriteLine,
Flush,
Fail,
Close
//NOTE: update MethodEnumCount if values are added
}
private const int MethodEnumCount = 9;
public TestTraceListener(bool threadSafe = false)
: this(null, threadSafe)
{
}
public TestTraceListener(string name, bool threadSafe = false)
: base(name)
{
_threadSafe = threadSafe;
_calls = new int[MethodEnumCount];
}
private bool _threadSafe;
private int[] _calls;
public override bool IsThreadSafe
{
get
{
return _threadSafe;
}
}
/// <summary>
/// Gets the number of times any of the public methods on this instance were called.
/// </summary>
public int GetCallCount(Method group)
{
return _calls[(int)group];
}
private void Call(Method method)
{
_calls[(int)method]++;
}
protected override void Dispose(bool disposing)
{
Call(Method.Dispose);
}
public override void Fail(string message)
{
Call(Method.Fail);
}
public override void Fail(string message, string detailMessage)
{
Call(Method.Fail);
}
public override void Flush()
{
Call(Method.Flush);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
{
Call(Method.TraceEvent);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
{
Call(Method.TraceEvent);
}
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
{
Call(Method.TraceEvent);
}
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
{
Call(Method.TraceData);
}
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
{
Call(Method.TraceData);
}
public override void TraceTransfer(TraceEventCache eventCache, string source, int id, string message, Guid relatedActivityId)
{
Call(Method.TraceTransfer);
}
public override void Write(string message)
{
Call(Method.Write);
}
public override void WriteLine(string message)
{
Call(Method.WriteLine);
}
public override void Close()
{
Call(Method.Close);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/baseservices/threading/coverage/Nullref/CS_RWHNullRefEx.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Threading;
public class mytest {
public static int Main(String [] args) {
int rValue = 100;
RegisteredWaitHandle rwh = null;
Console.WriteLine("Test AutoResetEvent for expected NullRef Exceptions");
Console.WriteLine( );
try {
rwh.Equals(new ManualResetEvent(true));
rValue = 4;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.Equals(new ManualResetEvent()))");
}
try {
rwh.GetHashCode();
rValue = 5;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.GetHasCode())");
}
// try {
// rwh.GetLifetimeService();
// rValue = 6;
// }
// catch (NullReferenceException) {
// Console.WriteLine("Caught NullReferenceException (rwh.GetLifetimeService())");
// }
try {
rwh.GetType();
rValue = 7;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.GetType())");
}
// try {
// rwh.InitializeLifetimeService();
// rValue = 8;
// }
// catch (NullReferenceException) {
// Console.WriteLine("Caught NullReferenceException (rwh.InitializeLifeTimeService())");
// }
try {
rwh.ToString();
rValue = 11;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.ToString())");
}
try {
rwh.Unregister(new AutoResetEvent(true));
rValue = 12;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.Unregister())");
}
Console.WriteLine("Return Code == {0}",rValue);
return rValue;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Threading;
public class mytest {
public static int Main(String [] args) {
int rValue = 100;
RegisteredWaitHandle rwh = null;
Console.WriteLine("Test AutoResetEvent for expected NullRef Exceptions");
Console.WriteLine( );
try {
rwh.Equals(new ManualResetEvent(true));
rValue = 4;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.Equals(new ManualResetEvent()))");
}
try {
rwh.GetHashCode();
rValue = 5;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.GetHasCode())");
}
// try {
// rwh.GetLifetimeService();
// rValue = 6;
// }
// catch (NullReferenceException) {
// Console.WriteLine("Caught NullReferenceException (rwh.GetLifetimeService())");
// }
try {
rwh.GetType();
rValue = 7;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.GetType())");
}
// try {
// rwh.InitializeLifetimeService();
// rValue = 8;
// }
// catch (NullReferenceException) {
// Console.WriteLine("Caught NullReferenceException (rwh.InitializeLifeTimeService())");
// }
try {
rwh.ToString();
rValue = 11;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.ToString())");
}
try {
rwh.Unregister(new AutoResetEvent(true));
rValue = 12;
}
catch (NullReferenceException) {
Console.WriteLine("Caught NullReferenceException (rwh.Unregister())");
}
Console.WriteLine("Return Code == {0}",rValue);
return rValue;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/installer/tests/Assets/TestProjects/StandaloneApp20/Program.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace StandaloneApp
{
public static class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine(string.Join(Environment.NewLine, args));
// A small operation involving NewtonSoft.Json to ensure the assembly is loaded properly
var t = typeof(Newtonsoft.Json.JsonReader);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace StandaloneApp
{
public static class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine(string.Join(Environment.NewLine, args));
// A small operation involving NewtonSoft.Json to ensure the assembly is loaded properly
var t = typeof(Newtonsoft.Json.JsonReader);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/X86/Sse41/ConvertToVector128Int64.UInt32.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
private static void ConvertToVector128Int64UInt32()
{
var test = new SimpleUnaryOpTest__ConvertToVector128Int64UInt32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates basic functionality works, using the pointer overload
test.RunBasicScenario_Ptr();
if (Sse2.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
// Validates basic functionality works, using LoadAligned
test.RunBasicScenario_LoadAligned();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates calling via reflection works, using the pointer overload
test.RunReflectionScenario_Ptr();
if (Sse2.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
// Validates calling via reflection works, using LoadAligned
test.RunReflectionScenario_LoadAligned();
}
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
// Validates passing a local works, using LoadAligned
test.RunLclVarScenario_LoadAligned();
}
// Validates passing the field of a local works
test.RunLclFldScenario();
// Validates passing an instance member works
test.RunFldScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ConvertToVector128Int64UInt32
{
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
private static UInt32[] _data = new UInt32[Op1ElementCount];
private static Vector128<UInt32> _clsVar;
private Vector128<UInt32> _fld;
private SimpleUnaryOpTest__DataTable<Int64, UInt32> _dataTable;
static SimpleUnaryOpTest__ConvertToVector128Int64UInt32()
{
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar), ref Unsafe.As<UInt32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
}
public SimpleUnaryOpTest__ConvertToVector128Int64UInt32()
{
Succeeded = true;
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld), ref Unsafe.As<UInt32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
_dataTable = new SimpleUnaryOpTest__DataTable<Int64, UInt32>(_data, new Int64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Sse41.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
var result = Sse41.ConvertToVector128Int64(
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Ptr()
{
var result = Sse41.ConvertToVector128Int64(
(UInt32*)(_dataTable.inArrayPtr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
var result = Sse41.ConvertToVector128Int64(
Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_LoadAligned()
{
var result = Sse41.ConvertToVector128Int64(
Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Ptr()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(UInt32*) })
.Invoke(null, new object[] {
Pointer.Box(_dataTable.inArrayPtr, typeof(UInt32*))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_LoadAligned()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
var result = Sse41.ConvertToVector128Int64(
_clsVar
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
var firstOp = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr);
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
var firstOp = Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr));
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_LoadAligned()
{
var firstOp = Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr));
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclFldScenario()
{
var test = new SimpleUnaryOpTest__ConvertToVector128Int64UInt32();
var result = Sse41.ConvertToVector128Int64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunFldScenario()
{
var result = Sse41.ConvertToVector128Int64(_fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld, _dataTable.outArrayPtr);
}
public void RunUnsupportedScenario()
{
Succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
Succeeded = true;
}
}
private void ValidateResult(Vector128<UInt32> firstOp, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray = new UInt32[Op1ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray[0]), firstOp);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
ValidateResult(inArray, outArray, method);
}
private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray = new UInt32[Op1ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
ValidateResult(inArray, outArray, method);
}
private void ValidateResult(UInt32[] firstOp, Int64[] result, [CallerMemberName] string method = "")
{
if (result[0] != firstOp[0])
{
Succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != firstOp[i])
{
Succeeded = false;
break;
}
}
}
if (!Succeeded)
{
Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.ConvertToVector128Int64)}<Int64>(Vector128<UInt32>): {method} failed:");
Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
Console.WriteLine($" result: ({string.Join(", ", result)})");
Console.WriteLine();
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
private static void ConvertToVector128Int64UInt32()
{
var test = new SimpleUnaryOpTest__ConvertToVector128Int64UInt32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates basic functionality works, using the pointer overload
test.RunBasicScenario_Ptr();
if (Sse2.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
// Validates basic functionality works, using LoadAligned
test.RunBasicScenario_LoadAligned();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates calling via reflection works, using the pointer overload
test.RunReflectionScenario_Ptr();
if (Sse2.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
// Validates calling via reflection works, using LoadAligned
test.RunReflectionScenario_LoadAligned();
}
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
// Validates passing a local works, using LoadAligned
test.RunLclVarScenario_LoadAligned();
}
// Validates passing the field of a local works
test.RunLclFldScenario();
// Validates passing an instance member works
test.RunFldScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ConvertToVector128Int64UInt32
{
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
private static UInt32[] _data = new UInt32[Op1ElementCount];
private static Vector128<UInt32> _clsVar;
private Vector128<UInt32> _fld;
private SimpleUnaryOpTest__DataTable<Int64, UInt32> _dataTable;
static SimpleUnaryOpTest__ConvertToVector128Int64UInt32()
{
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar), ref Unsafe.As<UInt32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
}
public SimpleUnaryOpTest__ConvertToVector128Int64UInt32()
{
Succeeded = true;
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld), ref Unsafe.As<UInt32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (uint)(random.Next(0, int.MaxValue)); }
_dataTable = new SimpleUnaryOpTest__DataTable<Int64, UInt32>(_data, new Int64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Sse41.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
var result = Sse41.ConvertToVector128Int64(
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Ptr()
{
var result = Sse41.ConvertToVector128Int64(
(UInt32*)(_dataTable.inArrayPtr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
var result = Sse41.ConvertToVector128Int64(
Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_LoadAligned()
{
var result = Sse41.ConvertToVector128Int64(
Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Ptr()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(UInt32*) })
.Invoke(null, new object[] {
Pointer.Box(_dataTable.inArrayPtr, typeof(UInt32*))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_LoadAligned()
{
var result = typeof(Sse41).GetMethod(nameof(Sse41.ConvertToVector128Int64), new Type[] { typeof(Vector128<UInt32>) })
.Invoke(null, new object[] {
Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
var result = Sse41.ConvertToVector128Int64(
_clsVar
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
var firstOp = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArrayPtr);
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
var firstOp = Sse2.LoadVector128((UInt32*)(_dataTable.inArrayPtr));
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_LoadAligned()
{
var firstOp = Sse2.LoadAlignedVector128((UInt32*)(_dataTable.inArrayPtr));
var result = Sse41.ConvertToVector128Int64(firstOp);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(firstOp, _dataTable.outArrayPtr);
}
public void RunLclFldScenario()
{
var test = new SimpleUnaryOpTest__ConvertToVector128Int64UInt32();
var result = Sse41.ConvertToVector128Int64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunFldScenario()
{
var result = Sse41.ConvertToVector128Int64(_fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld, _dataTable.outArrayPtr);
}
public void RunUnsupportedScenario()
{
Succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
Succeeded = true;
}
}
private void ValidateResult(Vector128<UInt32> firstOp, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray = new UInt32[Op1ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray[0]), firstOp);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
ValidateResult(inArray, outArray, method);
}
private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray = new UInt32[Op1ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
ValidateResult(inArray, outArray, method);
}
private void ValidateResult(UInt32[] firstOp, Int64[] result, [CallerMemberName] string method = "")
{
if (result[0] != firstOp[0])
{
Succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != firstOp[i])
{
Succeeded = false;
break;
}
}
}
if (!Succeeded)
{
Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.ConvertToVector128Int64)}<Int64>(Vector128<UInt32>): {method} failed:");
Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})");
Console.WriteLine($" result: ({string.Join(", ", result)})");
Console.WriteLine();
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/CodeGenBringUpTests/AsgOr1_ro.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="AsgOr1.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="AsgOr1.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/CodeGenBringUpTests/FPConvF2I_r.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPConvF2I.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPConvF2I.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.HashBucket.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.Collections.Immutable
{
/// <content>
/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct.
/// </content>
public partial class ImmutableDictionary<TKey, TValue>
{
/// <summary>
/// Contains all the key/values in the collection that hash to the same value.
/// </summary>
#pragma warning disable CA1066 // Implement IEquatable when overriding Object.Equals
internal readonly struct HashBucket : IEnumerable<KeyValuePair<TKey, TValue>>
#pragma warning restore CA1066
{
/// <summary>
/// One of the values in this bucket.
/// </summary>
private readonly KeyValuePair<TKey, TValue> _firstValue;
/// <summary>
/// Any other elements that hash to the same value.
/// </summary>
/// <value>
/// This is null if and only if the entire bucket is empty (including <see cref="_firstValue"/>).
/// It's empty if <see cref="_firstValue"/> has an element but no additional elements.
/// </value>
private readonly ImmutableList<KeyValuePair<TKey, TValue>>.Node _additionalElements;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct.
/// </summary>
/// <param name="firstElement">The first element.</param>
/// <param name="additionalElements">The additional elements.</param>
private HashBucket(KeyValuePair<TKey, TValue> firstElement, ImmutableList<KeyValuePair<TKey, TValue>>.Node? additionalElements = null)
{
_firstValue = firstElement;
_additionalElements = additionalElements ?? ImmutableList<KeyValuePair<TKey, TValue>>.Node.EmptyNode;
}
/// <summary>
/// Gets a value indicating whether this instance is empty.
/// </summary>
/// <value>
/// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
/// </value>
internal bool IsEmpty
{
get { return _additionalElements == null; }
}
/// <summary>
/// Gets the first value in this bucket.
/// </summary>
internal KeyValuePair<TKey, TValue> FirstValue
{
get
{
if (this.IsEmpty)
{
throw new InvalidOperationException();
}
return _firstValue;
}
}
/// <summary>
/// Gets the list of additional (hash collision) elements.
/// </summary>
internal ImmutableList<KeyValuePair<TKey, TValue>>.Node AdditionalElements
{
get { return _additionalElements; }
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
public Enumerator GetEnumerator()
{
return new Enumerator(this);
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>
/// An <see cref="IEnumerator"/> object that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances.
/// </summary>
public override bool Equals(object? obj)
{
// This should never be called, as hash buckets don't know how to equate themselves.
throw new NotSupportedException();
}
/// <summary>
/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances.
/// </summary>
public override int GetHashCode()
{
// This should never be called, as hash buckets don't know how to hash themselves.
throw new NotSupportedException();
}
/// <summary>
/// Adds the specified key.
/// </summary>
/// <param name="key">The key to add.</param>
/// <param name="value">The value to add.</param>
/// <param name="keyOnlyComparer">The key comparer.</param>
/// <param name="valueComparer">The value comparer.</param>
/// <param name="behavior">The intended behavior for certain cases that may come up during the operation.</param>
/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param>
/// <returns>A new <see cref="HashBucket"/> that contains the added value and any values already held by this <see cref="HashBucket"/>.</returns>
internal HashBucket Add(TKey key, TValue value, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, IEqualityComparer<TValue> valueComparer, KeyCollisionBehavior behavior, out OperationResult result)
{
var kv = new KeyValuePair<TKey, TValue>(key, value);
if (this.IsEmpty)
{
result = OperationResult.SizeChanged;
return new HashBucket(kv);
}
if (keyOnlyComparer.Equals(kv, _firstValue))
{
switch (behavior)
{
case KeyCollisionBehavior.SetValue:
result = OperationResult.AppliedWithoutSizeChange;
return new HashBucket(kv, _additionalElements);
case KeyCollisionBehavior.Skip:
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowIfValueDifferent:
if (!valueComparer.Equals(_firstValue.Value, value))
{
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
}
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowAlways:
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
default:
throw new InvalidOperationException(); // unreachable
}
}
int keyCollisionIndex = _additionalElements.IndexOf(kv, keyOnlyComparer);
if (keyCollisionIndex < 0)
{
result = OperationResult.SizeChanged;
return new HashBucket(_firstValue, _additionalElements.Add(kv));
}
else
{
switch (behavior)
{
case KeyCollisionBehavior.SetValue:
result = OperationResult.AppliedWithoutSizeChange;
return new HashBucket(_firstValue, _additionalElements.ReplaceAt(keyCollisionIndex, kv));
case KeyCollisionBehavior.Skip:
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowIfValueDifferent:
ref readonly var existingEntry = ref _additionalElements.ItemRef(keyCollisionIndex);
if (!valueComparer.Equals(existingEntry.Value, value))
{
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
}
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowAlways:
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
default:
throw new InvalidOperationException(); // unreachable
}
}
}
/// <summary>
/// Removes the specified value if it exists in the collection.
/// </summary>
/// <param name="key">The key to remove.</param>
/// <param name="keyOnlyComparer">The equality comparer.</param>
/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param>
/// <returns>A new <see cref="HashBucket"/> that does not contain the removed value and any values already held by this <see cref="HashBucket"/>.</returns>
internal HashBucket Remove(TKey key, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, out OperationResult result)
{
if (this.IsEmpty)
{
result = OperationResult.NoChangeRequired;
return this;
}
var kv = new KeyValuePair<TKey, TValue>(key, default(TValue)!);
if (keyOnlyComparer.Equals(_firstValue, kv))
{
if (_additionalElements.IsEmpty)
{
result = OperationResult.SizeChanged;
return default;
}
else
{
// We can promote any element from the list into the first position, but it's most efficient
// to remove the root node in the binary tree that implements the list.
int indexOfRootNode = _additionalElements.Left!.Count;
result = OperationResult.SizeChanged;
return new HashBucket(_additionalElements.Key, _additionalElements.RemoveAt(indexOfRootNode));
}
}
int index = _additionalElements.IndexOf(kv, keyOnlyComparer);
if (index < 0)
{
result = OperationResult.NoChangeRequired;
return this;
}
else
{
result = OperationResult.SizeChanged;
return new HashBucket(_firstValue, _additionalElements.RemoveAt(index));
}
}
/// <summary>
/// Gets the value for the given key in the collection if one exists..
/// </summary>
/// <param name="key">The key to search for.</param>
/// <param name="comparers">The comparers.</param>
/// <param name="value">The value for the given key.</param>
/// <returns>A value indicating whether the key was found.</returns>
internal bool TryGetValue(TKey key, Comparers comparers, [MaybeNullWhen(false)] out TValue value)
{
if (this.IsEmpty)
{
value = default;
return false;
}
if (comparers.KeyComparer.Equals(_firstValue.Key, key))
{
value = _firstValue.Value;
return true;
}
var kv = new KeyValuePair<TKey, TValue>(key, default(TValue)!);
var index = _additionalElements.IndexOf(kv, comparers.KeyOnlyComparer);
if (index < 0)
{
value = default;
return false;
}
value = _additionalElements.ItemRef(index).Value;
return true;
}
/// <summary>
/// Searches the dictionary for a given key and returns the equal key it finds, if any.
/// </summary>
/// <param name="equalKey">The key to search for.</param>
/// <param name="comparers">The comparers.</param>
/// <param name="actualKey">The key from the dictionary that the search found, or <paramref name="equalKey"/> if the search yielded no match.</param>
/// <returns>A value indicating whether the search was successful.</returns>
/// <remarks>
/// This can be useful when you want to reuse a previously stored reference instead of
/// a newly constructed one (so that more sharing of references can occur) or to look up
/// the canonical value, or a value that has more complete data than the value you currently have,
/// although their comparer functions indicate they are equal.
/// </remarks>
internal bool TryGetKey(TKey equalKey, Comparers comparers, out TKey actualKey)
{
if (this.IsEmpty)
{
actualKey = equalKey;
return false;
}
if (comparers.KeyComparer.Equals(_firstValue.Key, equalKey))
{
actualKey = _firstValue.Key;
return true;
}
var kv = new KeyValuePair<TKey, TValue>(equalKey, default(TValue)!);
var index = _additionalElements.IndexOf(kv, comparers.KeyOnlyComparer);
if (index < 0)
{
actualKey = equalKey;
return false;
}
actualKey = _additionalElements.ItemRef(index).Key;
return true;
}
/// <summary>
/// Freezes this instance so that any further mutations require new memory allocations.
/// </summary>
internal void Freeze()
{
if (_additionalElements != null)
{
_additionalElements.Freeze();
}
}
/// <summary>
/// Enumerates all the elements in this instance.
/// </summary>
internal struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>>, IDisposable
{
/// <summary>
/// The bucket being enumerated.
/// </summary>
private readonly HashBucket _bucket;
/// <summary>
/// The current position of this enumerator.
/// </summary>
private Position _currentPosition;
/// <summary>
/// The enumerator that represents the current position over the <see cref="_additionalElements"/> of the <see cref="HashBucket"/>.
/// </summary>
private ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator _additionalEnumerator;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket.Enumerator"/> struct.
/// </summary>
/// <param name="bucket">The bucket.</param>
internal Enumerator(HashBucket bucket)
{
_bucket = bucket;
_currentPosition = Position.BeforeFirst;
_additionalEnumerator = default(ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator);
}
/// <summary>
/// Describes the positions the enumerator state machine may be in.
/// </summary>
private enum Position
{
/// <summary>
/// The first element has not yet been moved to.
/// </summary>
BeforeFirst,
/// <summary>
/// We're at the <see cref="_firstValue"/> of the containing bucket.
/// </summary>
First,
/// <summary>
/// We're enumerating the <see cref="_additionalElements"/> in the bucket.
/// </summary>
Additional,
/// <summary>
/// The end of enumeration has been reached.
/// </summary>
End,
}
/// <summary>
/// Gets the current element.
/// </summary>
object IEnumerator.Current
{
get { return this.Current; }
}
/// <summary>
/// Gets the current element.
/// </summary>
public KeyValuePair<TKey, TValue> Current
{
get
{
return _currentPosition switch
{
Position.First => _bucket._firstValue,
Position.Additional => _additionalEnumerator.Current,
_ => throw new InvalidOperationException(),
};
}
}
/// <summary>
/// Advances the enumerator to the next element of the collection.
/// </summary>
/// <returns>
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// </returns>
/// <exception cref="InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public bool MoveNext()
{
if (_bucket.IsEmpty)
{
_currentPosition = Position.End;
return false;
}
switch (_currentPosition)
{
case Position.BeforeFirst:
_currentPosition = Position.First;
return true;
case Position.First:
if (_bucket._additionalElements.IsEmpty)
{
_currentPosition = Position.End;
return false;
}
_currentPosition = Position.Additional;
_additionalEnumerator = new ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator(_bucket._additionalElements);
return _additionalEnumerator.MoveNext();
case Position.Additional:
return _additionalEnumerator.MoveNext();
case Position.End:
return false;
default:
throw new InvalidOperationException();
}
}
/// <summary>
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// </summary>
/// <exception cref="InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public void Reset()
{
// We can safely dispose of the additional enumerator because if the client reuses this enumerator
// we'll acquire a new one anyway (and so for that matter we should be sure to dispose of this).
_additionalEnumerator.Dispose();
_currentPosition = Position.BeforeFirst;
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
_additionalEnumerator.Dispose();
}
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.Collections.Immutable
{
/// <content>
/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct.
/// </content>
public partial class ImmutableDictionary<TKey, TValue>
{
/// <summary>
/// Contains all the key/values in the collection that hash to the same value.
/// </summary>
#pragma warning disable CA1066 // Implement IEquatable when overriding Object.Equals
internal readonly struct HashBucket : IEnumerable<KeyValuePair<TKey, TValue>>
#pragma warning restore CA1066
{
/// <summary>
/// One of the values in this bucket.
/// </summary>
private readonly KeyValuePair<TKey, TValue> _firstValue;
/// <summary>
/// Any other elements that hash to the same value.
/// </summary>
/// <value>
/// This is null if and only if the entire bucket is empty (including <see cref="_firstValue"/>).
/// It's empty if <see cref="_firstValue"/> has an element but no additional elements.
/// </value>
private readonly ImmutableList<KeyValuePair<TKey, TValue>>.Node _additionalElements;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct.
/// </summary>
/// <param name="firstElement">The first element.</param>
/// <param name="additionalElements">The additional elements.</param>
private HashBucket(KeyValuePair<TKey, TValue> firstElement, ImmutableList<KeyValuePair<TKey, TValue>>.Node? additionalElements = null)
{
_firstValue = firstElement;
_additionalElements = additionalElements ?? ImmutableList<KeyValuePair<TKey, TValue>>.Node.EmptyNode;
}
/// <summary>
/// Gets a value indicating whether this instance is empty.
/// </summary>
/// <value>
/// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
/// </value>
internal bool IsEmpty
{
get { return _additionalElements == null; }
}
/// <summary>
/// Gets the first value in this bucket.
/// </summary>
internal KeyValuePair<TKey, TValue> FirstValue
{
get
{
if (this.IsEmpty)
{
throw new InvalidOperationException();
}
return _firstValue;
}
}
/// <summary>
/// Gets the list of additional (hash collision) elements.
/// </summary>
internal ImmutableList<KeyValuePair<TKey, TValue>>.Node AdditionalElements
{
get { return _additionalElements; }
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
public Enumerator GetEnumerator()
{
return new Enumerator(this);
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>
/// An <see cref="IEnumerator"/> object that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances.
/// </summary>
public override bool Equals(object? obj)
{
// This should never be called, as hash buckets don't know how to equate themselves.
throw new NotSupportedException();
}
/// <summary>
/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances.
/// </summary>
public override int GetHashCode()
{
// This should never be called, as hash buckets don't know how to hash themselves.
throw new NotSupportedException();
}
/// <summary>
/// Adds the specified key.
/// </summary>
/// <param name="key">The key to add.</param>
/// <param name="value">The value to add.</param>
/// <param name="keyOnlyComparer">The key comparer.</param>
/// <param name="valueComparer">The value comparer.</param>
/// <param name="behavior">The intended behavior for certain cases that may come up during the operation.</param>
/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param>
/// <returns>A new <see cref="HashBucket"/> that contains the added value and any values already held by this <see cref="HashBucket"/>.</returns>
internal HashBucket Add(TKey key, TValue value, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, IEqualityComparer<TValue> valueComparer, KeyCollisionBehavior behavior, out OperationResult result)
{
var kv = new KeyValuePair<TKey, TValue>(key, value);
if (this.IsEmpty)
{
result = OperationResult.SizeChanged;
return new HashBucket(kv);
}
if (keyOnlyComparer.Equals(kv, _firstValue))
{
switch (behavior)
{
case KeyCollisionBehavior.SetValue:
result = OperationResult.AppliedWithoutSizeChange;
return new HashBucket(kv, _additionalElements);
case KeyCollisionBehavior.Skip:
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowIfValueDifferent:
if (!valueComparer.Equals(_firstValue.Value, value))
{
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
}
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowAlways:
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
default:
throw new InvalidOperationException(); // unreachable
}
}
int keyCollisionIndex = _additionalElements.IndexOf(kv, keyOnlyComparer);
if (keyCollisionIndex < 0)
{
result = OperationResult.SizeChanged;
return new HashBucket(_firstValue, _additionalElements.Add(kv));
}
else
{
switch (behavior)
{
case KeyCollisionBehavior.SetValue:
result = OperationResult.AppliedWithoutSizeChange;
return new HashBucket(_firstValue, _additionalElements.ReplaceAt(keyCollisionIndex, kv));
case KeyCollisionBehavior.Skip:
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowIfValueDifferent:
ref readonly var existingEntry = ref _additionalElements.ItemRef(keyCollisionIndex);
if (!valueComparer.Equals(existingEntry.Value, value))
{
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
}
result = OperationResult.NoChangeRequired;
return this;
case KeyCollisionBehavior.ThrowAlways:
throw new ArgumentException(SR.Format(SR.DuplicateKey, key));
default:
throw new InvalidOperationException(); // unreachable
}
}
}
/// <summary>
/// Removes the specified value if it exists in the collection.
/// </summary>
/// <param name="key">The key to remove.</param>
/// <param name="keyOnlyComparer">The equality comparer.</param>
/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param>
/// <returns>A new <see cref="HashBucket"/> that does not contain the removed value and any values already held by this <see cref="HashBucket"/>.</returns>
internal HashBucket Remove(TKey key, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, out OperationResult result)
{
if (this.IsEmpty)
{
result = OperationResult.NoChangeRequired;
return this;
}
var kv = new KeyValuePair<TKey, TValue>(key, default(TValue)!);
if (keyOnlyComparer.Equals(_firstValue, kv))
{
if (_additionalElements.IsEmpty)
{
result = OperationResult.SizeChanged;
return default;
}
else
{
// We can promote any element from the list into the first position, but it's most efficient
// to remove the root node in the binary tree that implements the list.
int indexOfRootNode = _additionalElements.Left!.Count;
result = OperationResult.SizeChanged;
return new HashBucket(_additionalElements.Key, _additionalElements.RemoveAt(indexOfRootNode));
}
}
int index = _additionalElements.IndexOf(kv, keyOnlyComparer);
if (index < 0)
{
result = OperationResult.NoChangeRequired;
return this;
}
else
{
result = OperationResult.SizeChanged;
return new HashBucket(_firstValue, _additionalElements.RemoveAt(index));
}
}
/// <summary>
/// Gets the value for the given key in the collection if one exists..
/// </summary>
/// <param name="key">The key to search for.</param>
/// <param name="comparers">The comparers.</param>
/// <param name="value">The value for the given key.</param>
/// <returns>A value indicating whether the key was found.</returns>
internal bool TryGetValue(TKey key, Comparers comparers, [MaybeNullWhen(false)] out TValue value)
{
if (this.IsEmpty)
{
value = default;
return false;
}
if (comparers.KeyComparer.Equals(_firstValue.Key, key))
{
value = _firstValue.Value;
return true;
}
var kv = new KeyValuePair<TKey, TValue>(key, default(TValue)!);
var index = _additionalElements.IndexOf(kv, comparers.KeyOnlyComparer);
if (index < 0)
{
value = default;
return false;
}
value = _additionalElements.ItemRef(index).Value;
return true;
}
/// <summary>
/// Searches the dictionary for a given key and returns the equal key it finds, if any.
/// </summary>
/// <param name="equalKey">The key to search for.</param>
/// <param name="comparers">The comparers.</param>
/// <param name="actualKey">The key from the dictionary that the search found, or <paramref name="equalKey"/> if the search yielded no match.</param>
/// <returns>A value indicating whether the search was successful.</returns>
/// <remarks>
/// This can be useful when you want to reuse a previously stored reference instead of
/// a newly constructed one (so that more sharing of references can occur) or to look up
/// the canonical value, or a value that has more complete data than the value you currently have,
/// although their comparer functions indicate they are equal.
/// </remarks>
internal bool TryGetKey(TKey equalKey, Comparers comparers, out TKey actualKey)
{
if (this.IsEmpty)
{
actualKey = equalKey;
return false;
}
if (comparers.KeyComparer.Equals(_firstValue.Key, equalKey))
{
actualKey = _firstValue.Key;
return true;
}
var kv = new KeyValuePair<TKey, TValue>(equalKey, default(TValue)!);
var index = _additionalElements.IndexOf(kv, comparers.KeyOnlyComparer);
if (index < 0)
{
actualKey = equalKey;
return false;
}
actualKey = _additionalElements.ItemRef(index).Key;
return true;
}
/// <summary>
/// Freezes this instance so that any further mutations require new memory allocations.
/// </summary>
internal void Freeze()
{
if (_additionalElements != null)
{
_additionalElements.Freeze();
}
}
/// <summary>
/// Enumerates all the elements in this instance.
/// </summary>
internal struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>>, IDisposable
{
/// <summary>
/// The bucket being enumerated.
/// </summary>
private readonly HashBucket _bucket;
/// <summary>
/// The current position of this enumerator.
/// </summary>
private Position _currentPosition;
/// <summary>
/// The enumerator that represents the current position over the <see cref="_additionalElements"/> of the <see cref="HashBucket"/>.
/// </summary>
private ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator _additionalEnumerator;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket.Enumerator"/> struct.
/// </summary>
/// <param name="bucket">The bucket.</param>
internal Enumerator(HashBucket bucket)
{
_bucket = bucket;
_currentPosition = Position.BeforeFirst;
_additionalEnumerator = default(ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator);
}
/// <summary>
/// Describes the positions the enumerator state machine may be in.
/// </summary>
private enum Position
{
/// <summary>
/// The first element has not yet been moved to.
/// </summary>
BeforeFirst,
/// <summary>
/// We're at the <see cref="_firstValue"/> of the containing bucket.
/// </summary>
First,
/// <summary>
/// We're enumerating the <see cref="_additionalElements"/> in the bucket.
/// </summary>
Additional,
/// <summary>
/// The end of enumeration has been reached.
/// </summary>
End,
}
/// <summary>
/// Gets the current element.
/// </summary>
object IEnumerator.Current
{
get { return this.Current; }
}
/// <summary>
/// Gets the current element.
/// </summary>
public KeyValuePair<TKey, TValue> Current
{
get
{
return _currentPosition switch
{
Position.First => _bucket._firstValue,
Position.Additional => _additionalEnumerator.Current,
_ => throw new InvalidOperationException(),
};
}
}
/// <summary>
/// Advances the enumerator to the next element of the collection.
/// </summary>
/// <returns>
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
/// </returns>
/// <exception cref="InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public bool MoveNext()
{
if (_bucket.IsEmpty)
{
_currentPosition = Position.End;
return false;
}
switch (_currentPosition)
{
case Position.BeforeFirst:
_currentPosition = Position.First;
return true;
case Position.First:
if (_bucket._additionalElements.IsEmpty)
{
_currentPosition = Position.End;
return false;
}
_currentPosition = Position.Additional;
_additionalEnumerator = new ImmutableList<KeyValuePair<TKey, TValue>>.Enumerator(_bucket._additionalElements);
return _additionalEnumerator.MoveNext();
case Position.Additional:
return _additionalEnumerator.MoveNext();
case Position.End:
return false;
default:
throw new InvalidOperationException();
}
}
/// <summary>
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// </summary>
/// <exception cref="InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public void Reset()
{
// We can safely dispose of the additional enumerator because if the client reuses this enumerator
// we'll acquire a new one anyway (and so for that matter we should be sure to dispose of this).
_additionalEnumerator.Dispose();
_currentPosition = Position.BeforeFirst;
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
_additionalEnumerator.Dispose();
}
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Composition.TypedParts/src/System/Composition/CompositionContextExtensions.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Composition.Convention;
using System.Composition.Hosting;
using System.Composition.TypedParts;
using System.Composition.TypedParts.ActivationFeatures;
using System.Composition.TypedParts.Util;
using System.Linq;
using System.Reflection;
namespace System.Composition
{
/// <summary>
/// Adds methods to <see cref="CompositionContext"/> that are specific to the
/// typed part model.
/// </summary>
public static class CompositionContextExtensions
{
private static readonly DirectAttributeContext s_directAttributeContext = new DirectAttributeContext();
/// <summary>
/// Set public properties decorated with the <see cref="ImportAttribute"/>.
/// </summary>
/// <remarks>Uses reflection, is slow - caching would help here.</remarks>
/// <param name="objectWithLooseImports">An object with decorated with import attributes.</param>
/// <param name="compositionContext">Export provider that will supply imported values.</param>
public static void SatisfyImports(this CompositionContext compositionContext, object objectWithLooseImports)
{
SatisfyImportsInternal(compositionContext, objectWithLooseImports, s_directAttributeContext);
}
/// <summary>
/// Set public properties decorated with the <see cref="ImportAttribute"/>.
/// </summary>
/// <remarks>Uses reflection, is slow - caching would help here.</remarks>
/// <param name="conventions">Conventions to apply when satisfying loose imports.</param>
/// <param name="objectWithLooseImports">An object with decorated with import attributes.</param>
/// <param name="compositionContext">Export provider that will supply imported values.</param>
public static void SatisfyImports(this CompositionContext compositionContext, object objectWithLooseImports, AttributedModelProvider conventions)
{
SatisfyImportsInternal(compositionContext, objectWithLooseImports, conventions);
}
private static void SatisfyImportsInternal(this CompositionContext exportProvider!!, object objectWithLooseImports!!, AttributedModelProvider conventions!!)
{
var objType = objectWithLooseImports.GetType();
foreach (var pi in objType.GetRuntimeProperties())
{
ImportInfo importInfo;
var site = new PropertyImportSite(pi);
if (ContractHelpers.TryGetExplicitImportInfo(pi.PropertyType, conventions.GetDeclaredAttributes(pi.DeclaringType, pi), site, out importInfo))
{
object value;
if (exportProvider.TryGetExport(importInfo.Contract, out value))
{
pi.SetValue(objectWithLooseImports, value);
}
else if (!importInfo.AllowDefault)
{
throw new CompositionFailedException(SR.Format(
SR.CompositionContextExtensions_MissingDependency, pi.Name, objectWithLooseImports));
}
}
}
var importsSatisfiedMethods = objectWithLooseImports.GetType().GetRuntimeMethods().Where(m =>
m.CustomAttributes.Any(ca => ca.AttributeType == typeof(OnImportsSatisfiedAttribute)));
foreach (var ois in importsSatisfiedMethods)
ois.Invoke(objectWithLooseImports, null);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Composition.Convention;
using System.Composition.Hosting;
using System.Composition.TypedParts;
using System.Composition.TypedParts.ActivationFeatures;
using System.Composition.TypedParts.Util;
using System.Linq;
using System.Reflection;
namespace System.Composition
{
/// <summary>
/// Adds methods to <see cref="CompositionContext"/> that are specific to the
/// typed part model.
/// </summary>
public static class CompositionContextExtensions
{
private static readonly DirectAttributeContext s_directAttributeContext = new DirectAttributeContext();
/// <summary>
/// Set public properties decorated with the <see cref="ImportAttribute"/>.
/// </summary>
/// <remarks>Uses reflection, is slow - caching would help here.</remarks>
/// <param name="objectWithLooseImports">An object with decorated with import attributes.</param>
/// <param name="compositionContext">Export provider that will supply imported values.</param>
public static void SatisfyImports(this CompositionContext compositionContext, object objectWithLooseImports)
{
SatisfyImportsInternal(compositionContext, objectWithLooseImports, s_directAttributeContext);
}
/// <summary>
/// Set public properties decorated with the <see cref="ImportAttribute"/>.
/// </summary>
/// <remarks>Uses reflection, is slow - caching would help here.</remarks>
/// <param name="conventions">Conventions to apply when satisfying loose imports.</param>
/// <param name="objectWithLooseImports">An object with decorated with import attributes.</param>
/// <param name="compositionContext">Export provider that will supply imported values.</param>
public static void SatisfyImports(this CompositionContext compositionContext, object objectWithLooseImports, AttributedModelProvider conventions)
{
SatisfyImportsInternal(compositionContext, objectWithLooseImports, conventions);
}
private static void SatisfyImportsInternal(this CompositionContext exportProvider!!, object objectWithLooseImports!!, AttributedModelProvider conventions!!)
{
var objType = objectWithLooseImports.GetType();
foreach (var pi in objType.GetRuntimeProperties())
{
ImportInfo importInfo;
var site = new PropertyImportSite(pi);
if (ContractHelpers.TryGetExplicitImportInfo(pi.PropertyType, conventions.GetDeclaredAttributes(pi.DeclaringType, pi), site, out importInfo))
{
object value;
if (exportProvider.TryGetExport(importInfo.Contract, out value))
{
pi.SetValue(objectWithLooseImports, value);
}
else if (!importInfo.AllowDefault)
{
throw new CompositionFailedException(SR.Format(
SR.CompositionContextExtensions_MissingDependency, pi.Name, objectWithLooseImports));
}
}
}
var importsSatisfiedMethods = objectWithLooseImports.GetType().GetRuntimeMethods().Where(m =>
m.CustomAttributes.Any(ca => ca.AttributeType == typeof(OnImportsSatisfiedAttribute)));
foreach (var ois in importsSatisfiedMethods)
ois.Invoke(objectWithLooseImports, null);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector128/CreateVector.Int32.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void CreateVectorInt32()
{
var test = new VectorCreate__CreateVectorInt32();
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorCreate__CreateVectorInt32
{
private static readonly int LargestVectorSize = 16;
private static readonly int ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
public bool Succeeded { get; set; } = true;
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
Int32 lowerValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> lower = Vector64.Create(lowerValue);
Int32 upperValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> upper = Vector64.Create(upperValue);
Vector128<Int32> result = Vector128.Create(lower, upper);
ValidateResult(result, lowerValue, upperValue);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
Int32 lowerValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> lower = Vector64.Create(lowerValue);
Int32 upperValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> upper = Vector64.Create(upperValue);
object result = typeof(Vector128)
.GetMethod(nameof(Vector128.Create), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] { lower, upper });
ValidateResult((Vector128<Int32>)(result), lowerValue, upperValue);
}
private void ValidateResult(Vector128<Int32> result, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "")
{
Int32[] resultElements = new Int32[ElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method);
}
private void ValidateResult(Int32[] resultElements, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < ElementCount / 2; i++)
{
if (resultElements[i] != expectedLowerValue)
{
succeeded = false;
break;
}
}
for (var i = ElementCount / 2; i < ElementCount; i++)
{
if (resultElements[i] != expectedUpperValue)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector128.Create(Int32): {method} failed:");
TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}");
TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void CreateVectorInt32()
{
var test = new VectorCreate__CreateVectorInt32();
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorCreate__CreateVectorInt32
{
private static readonly int LargestVectorSize = 16;
private static readonly int ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
public bool Succeeded { get; set; } = true;
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
Int32 lowerValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> lower = Vector64.Create(lowerValue);
Int32 upperValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> upper = Vector64.Create(upperValue);
Vector128<Int32> result = Vector128.Create(lower, upper);
ValidateResult(result, lowerValue, upperValue);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
Int32 lowerValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> lower = Vector64.Create(lowerValue);
Int32 upperValue = TestLibrary.Generator.GetInt32();
Vector64<Int32> upper = Vector64.Create(upperValue);
object result = typeof(Vector128)
.GetMethod(nameof(Vector128.Create), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] { lower, upper });
ValidateResult((Vector128<Int32>)(result), lowerValue, upperValue);
}
private void ValidateResult(Vector128<Int32> result, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "")
{
Int32[] resultElements = new Int32[ElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method);
}
private void ValidateResult(Int32[] resultElements, Int32 expectedLowerValue, Int32 expectedUpperValue, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < ElementCount / 2; i++)
{
if (resultElements[i] != expectedLowerValue)
{
succeeded = false;
break;
}
}
for (var i = ElementCount / 2; i < ElementCount; i++)
{
if (resultElements[i] != expectedUpperValue)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector128.Create(Int32): {method} failed:");
TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}");
TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/Loader/classloader/generics/Instantiation/Positive/MultipleInterface08.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
public interface IGenX<T>
{
string m(T t);
}
public interface IGenY<T>
{
string m(T[] t);
}
struct GenInt : IGenX<int[]>, IGenY<int>
{
public string m(int[] t)
{
return "m";
}
}
struct GenString : IGenX<string[]>, IGenY<string>
{
public string m(string[] t)
{
return "m";
}
}
public class Test_MultipleInterface08
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
GenInt IGenInt = new GenInt();
Eval(((IGenX<int[]>)IGenInt).m(null).Equals("m"));
Eval(((IGenY<int>)IGenInt).m(null).Equals("m"));
GenString IGenString = new GenString();
Eval(((IGenX<string[]>)IGenString).m(null).Equals("m"));
Eval(((IGenY<string>)IGenString).m(null).Equals("m"));
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
public interface IGenX<T>
{
string m(T t);
}
public interface IGenY<T>
{
string m(T[] t);
}
struct GenInt : IGenX<int[]>, IGenY<int>
{
public string m(int[] t)
{
return "m";
}
}
struct GenString : IGenX<string[]>, IGenY<string>
{
public string m(string[] t)
{
return "m";
}
}
public class Test_MultipleInterface08
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
GenInt IGenInt = new GenInt();
Eval(((IGenX<int[]>)IGenInt).m(null).Equals("m"));
Eval(((IGenY<int>)IGenInt).m(null).Equals("m"));
GenString IGenString = new GenString();
Eval(((IGenX<string[]>)IGenString).m(null).Equals("m"));
Eval(((IGenY<string>)IGenString).m(null).Equals("m"));
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
namespace System.Runtime.Intrinsics.X86
{
/// <summary>
/// This class provides access to Intel AES hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
public abstract class Aes : Sse2
{
internal Aes() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
public new abstract class X64 : Sse2.X64
{
internal X64() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
}
/// <summary>
/// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
/// AESDEC xmm, xmm/m128
/// </summary>
public static Vector128<byte> Decrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
/// AESDECLAST xmm, xmm/m128
/// </summary>
public static Vector128<byte> DecryptLast(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
/// AESENC xmm, xmm/m128
/// </summary>
public static Vector128<byte> Encrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
/// AESENCLAST xmm, xmm/m128
/// </summary>
public static Vector128<byte> EncryptLast(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesimc_si128 (__m128i a)
/// AESIMC xmm, xmm/m128
/// </summary>
public static Vector128<byte> InverseMixColumns(Vector128<byte> value) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
/// AESKEYGENASSIST xmm, xmm/m128, imm8
/// </summary>
public static Vector128<byte> KeygenAssist(Vector128<byte> value, byte control) { throw new PlatformNotSupportedException(); }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
namespace System.Runtime.Intrinsics.X86
{
/// <summary>
/// This class provides access to Intel AES hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
public abstract class Aes : Sse2
{
internal Aes() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
public new abstract class X64 : Sse2.X64
{
internal X64() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
}
/// <summary>
/// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
/// AESDEC xmm, xmm/m128
/// </summary>
public static Vector128<byte> Decrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
/// AESDECLAST xmm, xmm/m128
/// </summary>
public static Vector128<byte> DecryptLast(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
/// AESENC xmm, xmm/m128
/// </summary>
public static Vector128<byte> Encrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
/// AESENCLAST xmm, xmm/m128
/// </summary>
public static Vector128<byte> EncryptLast(Vector128<byte> value, Vector128<byte> roundKey) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aesimc_si128 (__m128i a)
/// AESIMC xmm, xmm/m128
/// </summary>
public static Vector128<byte> InverseMixColumns(Vector128<byte> value) { throw new PlatformNotSupportedException(); }
/// <summary>
/// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
/// AESKEYGENASSIST xmm, xmm/m128, imm8
/// </summary>
public static Vector128<byte> KeygenAssist(Vector128<byte> value, byte control) { throw new PlatformNotSupportedException(); }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Drawing.Common/src/System/Drawing/SystemFonts.Windows.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Drawing
{
public static partial class SystemFonts
{
private static unsafe bool GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics)
{
metrics = new Interop.User32.NONCLIENTMETRICS { cbSize = (uint)sizeof(Interop.User32.NONCLIENTMETRICS) };
fixed (void* m = &metrics)
{
return Interop.User32.SystemParametersInfoW(Interop.User32.SystemParametersAction.SPI_GETNONCLIENTMETRICS, metrics.cbSize, m, 0);
}
}
public static Font? CaptionFont
{
get
{
Font? captionFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
captionFont = GetFontFromData(metrics.lfCaptionFont);
captionFont.SetSystemFontName(nameof(CaptionFont));
}
return captionFont;
}
}
public static Font? SmallCaptionFont
{
get
{
Font? smcaptionFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
smcaptionFont = GetFontFromData(metrics.lfSmCaptionFont);
smcaptionFont.SetSystemFontName(nameof(SmallCaptionFont));
}
return smcaptionFont;
}
}
public static Font? MenuFont
{
get
{
Font? menuFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
menuFont = GetFontFromData(metrics.lfMenuFont);
menuFont.SetSystemFontName(nameof(MenuFont));
}
return menuFont;
}
}
public static Font? StatusFont
{
get
{
Font? statusFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
statusFont = GetFontFromData(metrics.lfStatusFont);
statusFont.SetSystemFontName(nameof(StatusFont));
}
return statusFont;
}
}
public static Font? MessageBoxFont
{
get
{
Font? messageBoxFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
messageBoxFont = GetFontFromData(metrics.lfMessageFont);
messageBoxFont.SetSystemFontName(nameof(MessageBoxFont));
}
return messageBoxFont;
}
}
private static bool IsCriticalFontException(Exception ex)
{
return !(
// In any of these cases we'll handle the exception.
ex is ExternalException ||
ex is ArgumentException ||
ex is OutOfMemoryException || // GDI+ throws this one for many reasons other than actual OOM.
ex is InvalidOperationException ||
ex is NotImplementedException ||
ex is FileNotFoundException);
}
public static unsafe Font? IconTitleFont
{
get
{
Font? iconTitleFont = null;
Interop.User32.LOGFONT itfont = default;
if (Interop.User32.SystemParametersInfoW(Interop.User32.SystemParametersAction.SPI_GETICONTITLELOGFONT, (uint)sizeof(Interop.User32.LOGFONT), &itfont, 0))
{
iconTitleFont = GetFontFromData(itfont);
iconTitleFont.SetSystemFontName(nameof(IconTitleFont));
}
return iconTitleFont;
}
}
public static Font DefaultFont
{
get
{
Font? defaultFont = null;
// For Arabic systems, always return Tahoma 8.
if ((ushort)Interop.Kernel32.GetSystemDefaultLCID() == 0x0001)
{
try
{
defaultFont = new Font("Tahoma", 8);
}
catch (Exception ex) when (!IsCriticalFontException(ex)) { }
}
// First try DEFAULT_GUI.
if (defaultFont == null)
{
IntPtr handle = Interop.Gdi32.GetStockObject(Interop.Gdi32.StockObject.DEFAULT_GUI_FONT);
try
{
using (Font fontInWorldUnits = Font.FromHfont(handle))
{
defaultFont = FontInPoints(fontInWorldUnits);
}
}
catch (ArgumentException)
{
// This can happen in theory if we end up pulling a non-TrueType font
}
}
// If DEFAULT_GUI didn't work, try Tahoma.
if (defaultFont == null)
{
try
{
defaultFont = new Font("Tahoma", 8);
}
catch (ArgumentException)
{
}
}
// Use GenericSansSerif as a last resort - this will always work.
if (defaultFont == null)
{
defaultFont = new Font(FontFamily.GenericSansSerif, 8);
}
if (defaultFont.Unit != GraphicsUnit.Point)
{
defaultFont = FontInPoints(defaultFont);
}
Debug.Assert(defaultFont != null, "defaultFont wasn't set.");
defaultFont.SetSystemFontName(nameof(DefaultFont));
return defaultFont;
}
}
public static Font DialogFont
{
get
{
Font? dialogFont = null;
if ((ushort)Interop.Kernel32.GetSystemDefaultLCID() == 0x0011)
{
// Always return DefaultFont for Japanese cultures.
dialogFont = DefaultFont;
}
else
{
try
{
// Use MS Shell Dlg 2, 8pt for anything other than Japanese.
dialogFont = new Font("MS Shell Dlg 2", 8);
}
catch (ArgumentException)
{
// This can happen in theory if we end up pulling a non-TrueType font
}
}
if (dialogFont == null)
{
dialogFont = DefaultFont;
}
else if (dialogFont.Unit != GraphicsUnit.Point)
{
dialogFont = FontInPoints(dialogFont);
}
// For Japanese cultures, SystemFonts.DefaultFont returns a new Font object every time it is invoked.
// So for Japanese we return the DefaultFont with its SystemFontName set to DialogFont.
dialogFont!.SetSystemFontName(nameof(DialogFont));
return dialogFont;
}
}
private static Font FontInPoints(Font font)
{
return new Font(font.FontFamily, font.SizeInPoints, font.Style, GraphicsUnit.Point, font.GdiCharSet, font.GdiVerticalFont);
}
private static Font GetFontFromData(Interop.User32.LOGFONT logFont)
{
Font? font = null;
try
{
font = Font.FromLogFont(ref logFont);
}
catch (Exception ex) when (!IsCriticalFontException(ex)) { }
return
font == null ? DefaultFont :
font.Unit != GraphicsUnit.Point ? FontInPoints(font) :
font;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace System.Drawing
{
public static partial class SystemFonts
{
private static unsafe bool GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics)
{
metrics = new Interop.User32.NONCLIENTMETRICS { cbSize = (uint)sizeof(Interop.User32.NONCLIENTMETRICS) };
fixed (void* m = &metrics)
{
return Interop.User32.SystemParametersInfoW(Interop.User32.SystemParametersAction.SPI_GETNONCLIENTMETRICS, metrics.cbSize, m, 0);
}
}
public static Font? CaptionFont
{
get
{
Font? captionFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
captionFont = GetFontFromData(metrics.lfCaptionFont);
captionFont.SetSystemFontName(nameof(CaptionFont));
}
return captionFont;
}
}
public static Font? SmallCaptionFont
{
get
{
Font? smcaptionFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
smcaptionFont = GetFontFromData(metrics.lfSmCaptionFont);
smcaptionFont.SetSystemFontName(nameof(SmallCaptionFont));
}
return smcaptionFont;
}
}
public static Font? MenuFont
{
get
{
Font? menuFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
menuFont = GetFontFromData(metrics.lfMenuFont);
menuFont.SetSystemFontName(nameof(MenuFont));
}
return menuFont;
}
}
public static Font? StatusFont
{
get
{
Font? statusFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
statusFont = GetFontFromData(metrics.lfStatusFont);
statusFont.SetSystemFontName(nameof(StatusFont));
}
return statusFont;
}
}
public static Font? MessageBoxFont
{
get
{
Font? messageBoxFont = null;
if (GetNonClientMetrics(out Interop.User32.NONCLIENTMETRICS metrics))
{
messageBoxFont = GetFontFromData(metrics.lfMessageFont);
messageBoxFont.SetSystemFontName(nameof(MessageBoxFont));
}
return messageBoxFont;
}
}
private static bool IsCriticalFontException(Exception ex)
{
return !(
// In any of these cases we'll handle the exception.
ex is ExternalException ||
ex is ArgumentException ||
ex is OutOfMemoryException || // GDI+ throws this one for many reasons other than actual OOM.
ex is InvalidOperationException ||
ex is NotImplementedException ||
ex is FileNotFoundException);
}
public static unsafe Font? IconTitleFont
{
get
{
Font? iconTitleFont = null;
Interop.User32.LOGFONT itfont = default;
if (Interop.User32.SystemParametersInfoW(Interop.User32.SystemParametersAction.SPI_GETICONTITLELOGFONT, (uint)sizeof(Interop.User32.LOGFONT), &itfont, 0))
{
iconTitleFont = GetFontFromData(itfont);
iconTitleFont.SetSystemFontName(nameof(IconTitleFont));
}
return iconTitleFont;
}
}
public static Font DefaultFont
{
get
{
Font? defaultFont = null;
// For Arabic systems, always return Tahoma 8.
if ((ushort)Interop.Kernel32.GetSystemDefaultLCID() == 0x0001)
{
try
{
defaultFont = new Font("Tahoma", 8);
}
catch (Exception ex) when (!IsCriticalFontException(ex)) { }
}
// First try DEFAULT_GUI.
if (defaultFont == null)
{
IntPtr handle = Interop.Gdi32.GetStockObject(Interop.Gdi32.StockObject.DEFAULT_GUI_FONT);
try
{
using (Font fontInWorldUnits = Font.FromHfont(handle))
{
defaultFont = FontInPoints(fontInWorldUnits);
}
}
catch (ArgumentException)
{
// This can happen in theory if we end up pulling a non-TrueType font
}
}
// If DEFAULT_GUI didn't work, try Tahoma.
if (defaultFont == null)
{
try
{
defaultFont = new Font("Tahoma", 8);
}
catch (ArgumentException)
{
}
}
// Use GenericSansSerif as a last resort - this will always work.
if (defaultFont == null)
{
defaultFont = new Font(FontFamily.GenericSansSerif, 8);
}
if (defaultFont.Unit != GraphicsUnit.Point)
{
defaultFont = FontInPoints(defaultFont);
}
Debug.Assert(defaultFont != null, "defaultFont wasn't set.");
defaultFont.SetSystemFontName(nameof(DefaultFont));
return defaultFont;
}
}
public static Font DialogFont
{
get
{
Font? dialogFont = null;
if ((ushort)Interop.Kernel32.GetSystemDefaultLCID() == 0x0011)
{
// Always return DefaultFont for Japanese cultures.
dialogFont = DefaultFont;
}
else
{
try
{
// Use MS Shell Dlg 2, 8pt for anything other than Japanese.
dialogFont = new Font("MS Shell Dlg 2", 8);
}
catch (ArgumentException)
{
// This can happen in theory if we end up pulling a non-TrueType font
}
}
if (dialogFont == null)
{
dialogFont = DefaultFont;
}
else if (dialogFont.Unit != GraphicsUnit.Point)
{
dialogFont = FontInPoints(dialogFont);
}
// For Japanese cultures, SystemFonts.DefaultFont returns a new Font object every time it is invoked.
// So for Japanese we return the DefaultFont with its SystemFontName set to DialogFont.
dialogFont!.SetSystemFontName(nameof(DialogFont));
return dialogFont;
}
}
private static Font FontInPoints(Font font)
{
return new Font(font.FontFamily, font.SizeInPoints, font.Style, GraphicsUnit.Point, font.GdiCharSet, font.GdiVerticalFont);
}
private static Font GetFontFromData(Interop.User32.LOGFONT logFont)
{
Font? font = null;
try
{
font = Font.FromLogFont(ref logFont);
}
catch (Exception ex) when (!IsCriticalFontException(ex)) { }
return
font == null ? DefaultFont :
font.Unit != GraphicsUnit.Point ? FontInPoints(font) :
font;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Create.NotSupported.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
public partial class DSA : AsymmetricAlgorithm
{
private static DSA CreateCore()
{
throw new PlatformNotSupportedException();
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
public partial class DSA : AsymmetricAlgorithm
{
private static DSA CreateCore()
{
throw new PlatformNotSupportedException();
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/Common/tests/System/Diagnostics/Tracing/ConsoleEventListener.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Diagnostics.Tracing
{
internal sealed class ConsoleEventListener : EventListener
{
private readonly string _eventFilter;
public ConsoleEventListener() : this(string.Empty) { }
public ConsoleEventListener(string filter)
{
if (filter == null)
throw new ArgumentNullException(nameof(filter));
_eventFilter = filter;
foreach (EventSource source in EventSource.GetSources())
EnableEvents(source, EventLevel.LogAlways);
}
protected override void OnEventSourceCreated(EventSource eventSource)
{
base.OnEventSourceCreated(eventSource);
EnableEvents(eventSource, EventLevel.LogAlways, EventKeywords.All);
}
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
lock (Console.Out)
{
string text = $"[{eventData.EventSource.Name}-{eventData.EventName}]{(eventData.Payload != null ? $" ({string.Join(", ", eventData.Payload)})." : "")}";
if (_eventFilter != null && text.Contains(_eventFilter))
{
ConsoleColor origForeground = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.WriteLine(text);
Console.ForegroundColor = origForeground;
}
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Diagnostics.Tracing
{
internal sealed class ConsoleEventListener : EventListener
{
private readonly string _eventFilter;
public ConsoleEventListener() : this(string.Empty) { }
public ConsoleEventListener(string filter)
{
if (filter == null)
throw new ArgumentNullException(nameof(filter));
_eventFilter = filter;
foreach (EventSource source in EventSource.GetSources())
EnableEvents(source, EventLevel.LogAlways);
}
protected override void OnEventSourceCreated(EventSource eventSource)
{
base.OnEventSourceCreated(eventSource);
EnableEvents(eventSource, EventLevel.LogAlways, EventKeywords.All);
}
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
lock (Console.Out)
{
string text = $"[{eventData.EventSource.Name}-{eventData.EventName}]{(eventData.Payload != null ? $" ({string.Join(", ", eventData.Payload)})." : "")}";
if (_eventFilter != null && text.Contains(_eventFilter))
{
ConsoleColor origForeground = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.WriteLine(text);
Console.ForegroundColor = origForeground;
}
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/tools/GCLogParser/parse-hb-log.csproj | <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6AE26CD6-C971-48D6-8C03-2FFA272B942C}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>parse_hb_log</RootNamespace>
<AssemblyName>parse-hb-log</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>artifacts\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>artifacts\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>artifacts\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>artifacts\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="parse-hb-log.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
| <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6AE26CD6-C971-48D6-8C03-2FFA272B942C}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>parse_hb_log</RootNamespace>
<AssemblyName>parse-hb-log</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>artifacts\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>artifacts\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>artifacts\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>artifacts\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="parse-hb-log.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedDataCollection.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace System.Security.Cryptography
{
public sealed class AsnEncodedDataCollection : ICollection
{
public AsnEncodedDataCollection()
{
_list = new List<AsnEncodedData>();
}
public AsnEncodedDataCollection(AsnEncodedData asnEncodedData)
: this()
{
_list.Add(asnEncodedData);
}
public int Add(AsnEncodedData asnEncodedData!!)
{
int indexOfNewItem = _list.Count;
_list.Add(asnEncodedData);
return indexOfNewItem;
}
public void Remove(AsnEncodedData asnEncodedData!!)
{
_list.Remove(asnEncodedData);
}
public AsnEncodedData this[int index]
{
get
{
return _list[index];
}
}
public int Count
{
get
{
return _list.Count;
}
}
public AsnEncodedDataEnumerator GetEnumerator()
{
return new AsnEncodedDataEnumerator(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
void ICollection.CopyTo(Array array!!, int index)
{
if (array.Rank != 1)
throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (index < 0 || index >= array.Length)
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
if (Count > array.Length - index)
throw new ArgumentException(SR.Argument_InvalidOffLen);
for (int i = 0; i < Count; i++)
{
array.SetValue(this[i], index);
index++;
}
}
public void CopyTo(AsnEncodedData[] array!!, int index)
{
// Need to do part of the argument validation ourselves as AsnEncodedDataCollection throws
// ArgumentOutOfRangeException where List<>.CopyTo() throws ArgumentException.
if (index < 0 || index >= array.Length)
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
_list.CopyTo(array, index);
}
public bool IsSynchronized
{
get
{
return false;
}
}
public object SyncRoot
{
get
{
return this;
}
}
private readonly List<AsnEncodedData> _list;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace System.Security.Cryptography
{
public sealed class AsnEncodedDataCollection : ICollection
{
public AsnEncodedDataCollection()
{
_list = new List<AsnEncodedData>();
}
public AsnEncodedDataCollection(AsnEncodedData asnEncodedData)
: this()
{
_list.Add(asnEncodedData);
}
public int Add(AsnEncodedData asnEncodedData!!)
{
int indexOfNewItem = _list.Count;
_list.Add(asnEncodedData);
return indexOfNewItem;
}
public void Remove(AsnEncodedData asnEncodedData!!)
{
_list.Remove(asnEncodedData);
}
public AsnEncodedData this[int index]
{
get
{
return _list[index];
}
}
public int Count
{
get
{
return _list.Count;
}
}
public AsnEncodedDataEnumerator GetEnumerator()
{
return new AsnEncodedDataEnumerator(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
void ICollection.CopyTo(Array array!!, int index)
{
if (array.Rank != 1)
throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
if (index < 0 || index >= array.Length)
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
if (Count > array.Length - index)
throw new ArgumentException(SR.Argument_InvalidOffLen);
for (int i = 0; i < Count; i++)
{
array.SetValue(this[i], index);
index++;
}
}
public void CopyTo(AsnEncodedData[] array!!, int index)
{
// Need to do part of the argument validation ourselves as AsnEncodedDataCollection throws
// ArgumentOutOfRangeException where List<>.CopyTo() throws ArgumentException.
if (index < 0 || index >= array.Length)
throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index);
_list.CopyTo(array, index);
}
public bool IsSynchronized
{
get
{
return false;
}
}
public object SyncRoot
{
get
{
return this;
}
}
private readonly List<AsnEncodedData> _list;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b52839/b52839.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Methodical/VT/etc/knight_ro.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="knight.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="knight.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/AbsoluteDifferenceWideningUpper.Vector128.Byte.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Byte[] inArray1, Byte[] inArray2, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Byte> _fld1;
public Vector128<Byte> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte testClass)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte testClass)
{
fixed (Vector128<Byte>* pFld1 = &_fld1)
fixed (Vector128<Byte>* pFld2 = &_fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static Byte[] _data1 = new Byte[Op1ElementCount];
private static Byte[] _data2 = new Byte[Op2ElementCount];
private static Vector128<Byte> _clsVar1;
private static Vector128<Byte> _clsVar2;
private Vector128<Byte> _fld1;
private Vector128<Byte> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
}
public SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
_dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AbsoluteDifferenceWideningUpper), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AbsoluteDifferenceWideningUpper), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Byte>* pClsVar1 = &_clsVar1)
fixed (Vector128<Byte>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pClsVar1)),
AdvSimd.LoadVector128((Byte*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr);
var result = AdvSimd.AbsoluteDifferenceWideningUpper(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
fixed (Vector128<Byte>* pFld1 = &test._fld1)
fixed (Vector128<Byte>* pFld2 = &test._fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Byte>* pFld1 = &_fld1)
fixed (Vector128<Byte>* pFld2 = &_fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(&test._fld1)),
AdvSimd.LoadVector128((Byte*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Byte> op1, Vector128<Byte> op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Byte[] left, Byte[] right, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.AbsoluteDifferenceWideningUpper)}<UInt16>(Vector128<Byte>, Vector128<Byte>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Byte[] inArray1, Byte[] inArray2, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Byte> _fld1;
public Vector128<Byte> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte testClass)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte testClass)
{
fixed (Vector128<Byte>* pFld1 = &_fld1)
fixed (Vector128<Byte>* pFld2 = &_fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static Byte[] _data1 = new Byte[Op1ElementCount];
private static Byte[] _data2 = new Byte[Op2ElementCount];
private static Vector128<Byte> _clsVar1;
private static Vector128<Byte> _clsVar2;
private Vector128<Byte> _fld1;
private Vector128<Byte> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
}
public SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
_dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AbsoluteDifferenceWideningUpper), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.AbsoluteDifferenceWideningUpper), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Byte>* pClsVar1 = &_clsVar1)
fixed (Vector128<Byte>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pClsVar1)),
AdvSimd.LoadVector128((Byte*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr);
var result = AdvSimd.AbsoluteDifferenceWideningUpper(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__AbsoluteDifferenceWideningUpper_Vector128_Byte();
fixed (Vector128<Byte>* pFld1 = &test._fld1)
fixed (Vector128<Byte>* pFld2 = &test._fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.AbsoluteDifferenceWideningUpper(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Byte>* pFld1 = &_fld1)
fixed (Vector128<Byte>* pFld2 = &_fld2)
{
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(pFld1)),
AdvSimd.LoadVector128((Byte*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.AbsoluteDifferenceWideningUpper(
AdvSimd.LoadVector128((Byte*)(&test._fld1)),
AdvSimd.LoadVector128((Byte*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Byte> op1, Vector128<Byte> op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Byte[] left, Byte[] right, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.AbsoluteDifferenceWideningUpper)}<UInt16>(Vector128<Byte>, Vector128<Byte>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using System.Diagnostics;
using System.Security;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Versioning;
namespace System.Runtime.Caching
{
internal sealed class MemoryCacheStore : IDisposable
{
private const int INSERT_BLOCK_WAIT = 10000;
private const int MAX_COUNT = int.MaxValue / 2;
private readonly Hashtable _entries;
private readonly object _entriesLock;
private readonly CacheExpires _expires;
private readonly CacheUsage _usage;
private int _disposed;
private ManualResetEvent _insertBlock;
private volatile bool _useInsertBlock;
private readonly MemoryCache _cache;
private readonly Counters _perfCounters;
#if NETCOREAPP
[UnsupportedOSPlatformGuard("browser")]
private static bool _countersSupported => !OperatingSystem.IsBrowser();
#else
private static bool _countersSupported => true;
#endif
internal MemoryCacheStore(MemoryCache cache, Counters perfCounters)
{
_cache = cache;
_perfCounters = perfCounters;
_entries = new Hashtable(new MemoryCacheEqualityComparer());
_entriesLock = new object();
_expires = new CacheExpires(this);
_usage = new CacheUsage(this);
InitDisposableMembers();
}
// private members
private void AddToCache(MemoryCacheEntry entry)
{
// add outside of lock
if (entry == null)
{
return;
}
if (entry.HasExpiration())
{
_expires.Add(entry);
}
if (entry.HasUsage()
&& (!entry.HasExpiration() || entry.UtcAbsExp - DateTime.UtcNow >= CacheUsage.MIN_LIFETIME_FOR_USAGE))
{
_usage.Add(entry);
}
// One last sanity check to be sure we didn't fall victim to an Add concurrency
if (!entry.CompareExchangeState(EntryState.AddedToCache, EntryState.AddingToCache))
{
if (entry.InExpires())
{
_expires.Remove(entry);
}
if (entry.InUsage())
{
_usage.Remove(entry);
}
}
entry.CallNotifyOnChanged();
if (_perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Entries);
_perfCounters.Increment(CounterName.Turnover);
}
}
private void InitDisposableMembers()
{
_insertBlock = new ManualResetEvent(true);
_expires.EnableExpirationTimer(true);
}
private void RemoveFromCache(MemoryCacheEntry entry, CacheEntryRemovedReason reason, bool delayRelease = false)
{
// release outside of lock
if (entry != null)
{
if (entry.InExpires())
{
_expires.Remove(entry);
}
if (entry.InUsage())
{
_usage.Remove(entry);
}
Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache");
entry.State = EntryState.RemovedFromCache;
if (!delayRelease)
{
entry.Release(_cache, reason);
}
if (_perfCounters != null && _countersSupported)
{
_perfCounters.Decrement(CounterName.Entries);
_perfCounters.Increment(CounterName.Turnover);
}
}
}
// 'updatePerfCounters' defaults to true since this method is called by all Get() operations
// to update both the performance counters and the sliding expiration. Callers that perform
// nested sliding expiration updates (like a MemoryCacheEntry touching its update sentinel)
// can pass false to prevent these from unintentionally showing up in the perf counters.
internal void UpdateExpAndUsage(MemoryCacheEntry entry, bool updatePerfCounters = true)
{
if (entry != null)
{
if (entry.InUsage() || entry.SlidingExp > TimeSpan.Zero)
{
DateTime utcNow = DateTime.UtcNow;
entry.UpdateSlidingExp(utcNow, _expires);
entry.UpdateUsage(utcNow, _usage);
}
// If this entry has an update sentinel, the sliding expiration is actually associated
// with that sentinel, not with this entry. We need to update the sentinel's sliding expiration to
// keep the sentinel from expiring, which in turn would force a removal of this entry from the cache.
entry.UpdateSlidingExpForUpdateSentinel();
if (updatePerfCounters && _perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Hits);
_perfCounters.Increment(CounterName.HitRatio);
_perfCounters.Increment(CounterName.HitRatioBase);
}
}
else
{
if (updatePerfCounters && _perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Misses);
_perfCounters.Increment(CounterName.HitRatioBase);
}
}
}
private void WaitInsertBlock()
{
_insertBlock.WaitOne(INSERT_BLOCK_WAIT, false);
}
// public/internal members
internal CacheUsage Usage { get { return _usage; } }
internal MemoryCacheEntry AddOrGetExisting(MemoryCacheKey key, MemoryCacheEntry entry)
{
if (_useInsertBlock && entry.HasUsage())
{
WaitInsertBlock();
}
MemoryCacheEntry existingEntry = null;
MemoryCacheEntry toBeReleasedEntry = null;
bool added = false;
lock (_entriesLock)
{
if (_disposed == 0)
{
existingEntry = _entries[key] as MemoryCacheEntry;
// has it expired?
if (existingEntry != null && existingEntry.UtcAbsExp <= DateTime.UtcNow)
{
toBeReleasedEntry = existingEntry;
toBeReleasedEntry.State = EntryState.RemovingFromCache;
existingEntry = null;
}
// can we add entry to the cache?
if (existingEntry == null)
{
entry.State = EntryState.AddingToCache;
added = true;
_entries[key] = entry;
}
}
}
// release outside of lock
RemoveFromCache(toBeReleasedEntry, CacheEntryRemovedReason.Expired, delayRelease: true);
if (added)
{
// add outside of lock
AddToCache(entry);
}
// update outside of lock
UpdateExpAndUsage(existingEntry);
// Call Release after the new entry has been completely added so
// that the CacheItemRemovedCallback can take a dependency on the newly inserted item.
if (toBeReleasedEntry != null)
{
toBeReleasedEntry.Release(_cache, CacheEntryRemovedReason.Expired);
}
return existingEntry;
}
internal void BlockInsert()
{
_insertBlock.Reset();
_useInsertBlock = true;
}
internal void CopyTo(IDictionary h)
{
lock (_entriesLock)
{
if (_disposed == 0)
{
foreach (DictionaryEntry e in _entries)
{
MemoryCacheKey key = e.Key as MemoryCacheKey;
MemoryCacheEntry entry = e.Value as MemoryCacheEntry;
if (entry.UtcAbsExp > DateTime.UtcNow)
{
h[key.Key] = entry.Value;
}
}
}
}
}
internal int Count
{
get
{
return _entries.Count;
}
}
public void Dispose()
{
if (Interlocked.Exchange(ref _disposed, 1) == 0)
{
// disable CacheExpires timer
_expires.EnableExpirationTimer(false);
// build array list of entries
ArrayList entries = new ArrayList(_entries.Count);
lock (_entriesLock)
{
foreach (DictionaryEntry e in _entries)
{
MemoryCacheEntry entry = e.Value as MemoryCacheEntry;
entries.Add(entry);
}
foreach (MemoryCacheEntry entry in entries)
{
MemoryCacheKey key = entry as MemoryCacheKey;
entry.State = EntryState.RemovingFromCache;
_entries.Remove(key);
}
}
// release entries outside of lock
foreach (MemoryCacheEntry entry in entries)
{
RemoveFromCache(entry, CacheEntryRemovedReason.CacheSpecificEviction);
}
// MemoryCacheStatistics has been disposed, and therefore nobody should be using
// _insertBlock except for potential threads in WaitInsertBlock (which won't care if we call Close).
Debug.Assert(_useInsertBlock == false, "_useInsertBlock == false");
_insertBlock.Close();
// Don't need to call GC.SuppressFinalize(this) for sealed types without finalizers.
}
}
internal MemoryCacheEntry Get(MemoryCacheKey key)
{
MemoryCacheEntry entry = _entries[key] as MemoryCacheEntry;
// has it expired?
if (entry != null && entry.UtcAbsExp <= DateTime.UtcNow)
{
Remove(key, entry, CacheEntryRemovedReason.Expired);
entry = null;
}
// update outside of lock
UpdateExpAndUsage(entry);
return entry;
}
internal MemoryCacheEntry Remove(MemoryCacheKey key, MemoryCacheEntry entryToRemove, CacheEntryRemovedReason reason)
{
MemoryCacheEntry entry = null;
lock (_entriesLock)
{
if (_disposed == 0)
{
// get current entry
entry = _entries[key] as MemoryCacheEntry;
// remove if it matches the entry to be removed (but always remove if entryToRemove is null)
if (entryToRemove == null || object.ReferenceEquals(entry, entryToRemove))
{
if (entry != null)
{
entry.State = EntryState.RemovingFromCache;
_entries.Remove(key);
}
}
else
{
entry = null;
}
}
}
// release outside of lock
RemoveFromCache(entry, reason);
return entry;
}
internal void Set(MemoryCacheKey key, MemoryCacheEntry entry)
{
if (_useInsertBlock && entry.HasUsage())
{
WaitInsertBlock();
}
MemoryCacheEntry existingEntry = null;
bool added = false;
lock (_entriesLock)
{
if (_disposed == 0)
{
existingEntry = _entries[key] as MemoryCacheEntry;
if (existingEntry != null)
{
existingEntry.State = EntryState.RemovingFromCache;
}
entry.State = EntryState.AddingToCache;
added = true;
_entries[key] = entry;
}
}
CacheEntryRemovedReason reason = CacheEntryRemovedReason.Removed;
if (existingEntry != null)
{
if (existingEntry.UtcAbsExp <= DateTime.UtcNow)
{
reason = CacheEntryRemovedReason.Expired;
}
RemoveFromCache(existingEntry, reason, delayRelease: true);
}
if (added)
{
AddToCache(entry);
}
// Call Release after the new entry has been completely added so
// that the CacheItemRemovedCallback can take a dependency on the newly inserted item.
if (existingEntry != null)
{
existingEntry.Release(_cache, reason);
}
}
internal long TrimInternal(int percent)
{
Debug.Assert(percent <= 100, "percent <= 100");
int count = Count;
int toTrim = 0;
// do we need to drop a percentage of entries?
if (percent > 0)
{
toTrim = (int)Math.Ceiling(((long)count * (long)percent) / 100D);
// would this leave us above MAX_COUNT?
int minTrim = count - MAX_COUNT;
if (toTrim < minTrim)
{
toTrim = minTrim;
}
}
// do we need to trim?
if (toTrim <= 0 || _disposed == 1)
{
return 0;
}
int trimmed = 0; // total number of entries trimmed
int trimmedOrExpired = 0;
#if DEBUG
int beginTotalCount = count;
#endif
trimmedOrExpired = _expires.FlushExpiredItems(true);
if (trimmedOrExpired < toTrim)
{
trimmed = _usage.FlushUnderUsedItems(toTrim - trimmedOrExpired);
trimmedOrExpired += trimmed;
}
if (trimmed > 0 && _perfCounters != null && _countersSupported)
{
// Update values for perfcounters
_perfCounters.IncrementBy(CounterName.Trims, trimmed);
}
#if DEBUG
Dbg.Trace("MemoryCacheStore", "TrimInternal:"
+ " beginTotalCount=" + beginTotalCount
+ ", endTotalCount=" + count
+ ", percent=" + percent
+ ", trimmed=" + trimmed);
#endif
return trimmedOrExpired;
}
internal void UnblockInsert()
{
_useInsertBlock = false;
_insertBlock.Set();
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using System.Diagnostics;
using System.Security;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Versioning;
namespace System.Runtime.Caching
{
internal sealed class MemoryCacheStore : IDisposable
{
private const int INSERT_BLOCK_WAIT = 10000;
private const int MAX_COUNT = int.MaxValue / 2;
private readonly Hashtable _entries;
private readonly object _entriesLock;
private readonly CacheExpires _expires;
private readonly CacheUsage _usage;
private int _disposed;
private ManualResetEvent _insertBlock;
private volatile bool _useInsertBlock;
private readonly MemoryCache _cache;
private readonly Counters _perfCounters;
#if NETCOREAPP
[UnsupportedOSPlatformGuard("browser")]
private static bool _countersSupported => !OperatingSystem.IsBrowser();
#else
private static bool _countersSupported => true;
#endif
internal MemoryCacheStore(MemoryCache cache, Counters perfCounters)
{
_cache = cache;
_perfCounters = perfCounters;
_entries = new Hashtable(new MemoryCacheEqualityComparer());
_entriesLock = new object();
_expires = new CacheExpires(this);
_usage = new CacheUsage(this);
InitDisposableMembers();
}
// private members
private void AddToCache(MemoryCacheEntry entry)
{
// add outside of lock
if (entry == null)
{
return;
}
if (entry.HasExpiration())
{
_expires.Add(entry);
}
if (entry.HasUsage()
&& (!entry.HasExpiration() || entry.UtcAbsExp - DateTime.UtcNow >= CacheUsage.MIN_LIFETIME_FOR_USAGE))
{
_usage.Add(entry);
}
// One last sanity check to be sure we didn't fall victim to an Add concurrency
if (!entry.CompareExchangeState(EntryState.AddedToCache, EntryState.AddingToCache))
{
if (entry.InExpires())
{
_expires.Remove(entry);
}
if (entry.InUsage())
{
_usage.Remove(entry);
}
}
entry.CallNotifyOnChanged();
if (_perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Entries);
_perfCounters.Increment(CounterName.Turnover);
}
}
private void InitDisposableMembers()
{
_insertBlock = new ManualResetEvent(true);
_expires.EnableExpirationTimer(true);
}
private void RemoveFromCache(MemoryCacheEntry entry, CacheEntryRemovedReason reason, bool delayRelease = false)
{
// release outside of lock
if (entry != null)
{
if (entry.InExpires())
{
_expires.Remove(entry);
}
if (entry.InUsage())
{
_usage.Remove(entry);
}
Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache");
entry.State = EntryState.RemovedFromCache;
if (!delayRelease)
{
entry.Release(_cache, reason);
}
if (_perfCounters != null && _countersSupported)
{
_perfCounters.Decrement(CounterName.Entries);
_perfCounters.Increment(CounterName.Turnover);
}
}
}
// 'updatePerfCounters' defaults to true since this method is called by all Get() operations
// to update both the performance counters and the sliding expiration. Callers that perform
// nested sliding expiration updates (like a MemoryCacheEntry touching its update sentinel)
// can pass false to prevent these from unintentionally showing up in the perf counters.
internal void UpdateExpAndUsage(MemoryCacheEntry entry, bool updatePerfCounters = true)
{
if (entry != null)
{
if (entry.InUsage() || entry.SlidingExp > TimeSpan.Zero)
{
DateTime utcNow = DateTime.UtcNow;
entry.UpdateSlidingExp(utcNow, _expires);
entry.UpdateUsage(utcNow, _usage);
}
// If this entry has an update sentinel, the sliding expiration is actually associated
// with that sentinel, not with this entry. We need to update the sentinel's sliding expiration to
// keep the sentinel from expiring, which in turn would force a removal of this entry from the cache.
entry.UpdateSlidingExpForUpdateSentinel();
if (updatePerfCounters && _perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Hits);
_perfCounters.Increment(CounterName.HitRatio);
_perfCounters.Increment(CounterName.HitRatioBase);
}
}
else
{
if (updatePerfCounters && _perfCounters != null && _countersSupported)
{
_perfCounters.Increment(CounterName.Misses);
_perfCounters.Increment(CounterName.HitRatioBase);
}
}
}
private void WaitInsertBlock()
{
_insertBlock.WaitOne(INSERT_BLOCK_WAIT, false);
}
// public/internal members
internal CacheUsage Usage { get { return _usage; } }
internal MemoryCacheEntry AddOrGetExisting(MemoryCacheKey key, MemoryCacheEntry entry)
{
if (_useInsertBlock && entry.HasUsage())
{
WaitInsertBlock();
}
MemoryCacheEntry existingEntry = null;
MemoryCacheEntry toBeReleasedEntry = null;
bool added = false;
lock (_entriesLock)
{
if (_disposed == 0)
{
existingEntry = _entries[key] as MemoryCacheEntry;
// has it expired?
if (existingEntry != null && existingEntry.UtcAbsExp <= DateTime.UtcNow)
{
toBeReleasedEntry = existingEntry;
toBeReleasedEntry.State = EntryState.RemovingFromCache;
existingEntry = null;
}
// can we add entry to the cache?
if (existingEntry == null)
{
entry.State = EntryState.AddingToCache;
added = true;
_entries[key] = entry;
}
}
}
// release outside of lock
RemoveFromCache(toBeReleasedEntry, CacheEntryRemovedReason.Expired, delayRelease: true);
if (added)
{
// add outside of lock
AddToCache(entry);
}
// update outside of lock
UpdateExpAndUsage(existingEntry);
// Call Release after the new entry has been completely added so
// that the CacheItemRemovedCallback can take a dependency on the newly inserted item.
if (toBeReleasedEntry != null)
{
toBeReleasedEntry.Release(_cache, CacheEntryRemovedReason.Expired);
}
return existingEntry;
}
internal void BlockInsert()
{
_insertBlock.Reset();
_useInsertBlock = true;
}
internal void CopyTo(IDictionary h)
{
lock (_entriesLock)
{
if (_disposed == 0)
{
foreach (DictionaryEntry e in _entries)
{
MemoryCacheKey key = e.Key as MemoryCacheKey;
MemoryCacheEntry entry = e.Value as MemoryCacheEntry;
if (entry.UtcAbsExp > DateTime.UtcNow)
{
h[key.Key] = entry.Value;
}
}
}
}
}
internal int Count
{
get
{
return _entries.Count;
}
}
public void Dispose()
{
if (Interlocked.Exchange(ref _disposed, 1) == 0)
{
// disable CacheExpires timer
_expires.EnableExpirationTimer(false);
// build array list of entries
ArrayList entries = new ArrayList(_entries.Count);
lock (_entriesLock)
{
foreach (DictionaryEntry e in _entries)
{
MemoryCacheEntry entry = e.Value as MemoryCacheEntry;
entries.Add(entry);
}
foreach (MemoryCacheEntry entry in entries)
{
MemoryCacheKey key = entry as MemoryCacheKey;
entry.State = EntryState.RemovingFromCache;
_entries.Remove(key);
}
}
// release entries outside of lock
foreach (MemoryCacheEntry entry in entries)
{
RemoveFromCache(entry, CacheEntryRemovedReason.CacheSpecificEviction);
}
// MemoryCacheStatistics has been disposed, and therefore nobody should be using
// _insertBlock except for potential threads in WaitInsertBlock (which won't care if we call Close).
Debug.Assert(_useInsertBlock == false, "_useInsertBlock == false");
_insertBlock.Close();
// Don't need to call GC.SuppressFinalize(this) for sealed types without finalizers.
}
}
internal MemoryCacheEntry Get(MemoryCacheKey key)
{
MemoryCacheEntry entry = _entries[key] as MemoryCacheEntry;
// has it expired?
if (entry != null && entry.UtcAbsExp <= DateTime.UtcNow)
{
Remove(key, entry, CacheEntryRemovedReason.Expired);
entry = null;
}
// update outside of lock
UpdateExpAndUsage(entry);
return entry;
}
internal MemoryCacheEntry Remove(MemoryCacheKey key, MemoryCacheEntry entryToRemove, CacheEntryRemovedReason reason)
{
MemoryCacheEntry entry = null;
lock (_entriesLock)
{
if (_disposed == 0)
{
// get current entry
entry = _entries[key] as MemoryCacheEntry;
// remove if it matches the entry to be removed (but always remove if entryToRemove is null)
if (entryToRemove == null || object.ReferenceEquals(entry, entryToRemove))
{
if (entry != null)
{
entry.State = EntryState.RemovingFromCache;
_entries.Remove(key);
}
}
else
{
entry = null;
}
}
}
// release outside of lock
RemoveFromCache(entry, reason);
return entry;
}
internal void Set(MemoryCacheKey key, MemoryCacheEntry entry)
{
if (_useInsertBlock && entry.HasUsage())
{
WaitInsertBlock();
}
MemoryCacheEntry existingEntry = null;
bool added = false;
lock (_entriesLock)
{
if (_disposed == 0)
{
existingEntry = _entries[key] as MemoryCacheEntry;
if (existingEntry != null)
{
existingEntry.State = EntryState.RemovingFromCache;
}
entry.State = EntryState.AddingToCache;
added = true;
_entries[key] = entry;
}
}
CacheEntryRemovedReason reason = CacheEntryRemovedReason.Removed;
if (existingEntry != null)
{
if (existingEntry.UtcAbsExp <= DateTime.UtcNow)
{
reason = CacheEntryRemovedReason.Expired;
}
RemoveFromCache(existingEntry, reason, delayRelease: true);
}
if (added)
{
AddToCache(entry);
}
// Call Release after the new entry has been completely added so
// that the CacheItemRemovedCallback can take a dependency on the newly inserted item.
if (existingEntry != null)
{
existingEntry.Release(_cache, reason);
}
}
internal long TrimInternal(int percent)
{
Debug.Assert(percent <= 100, "percent <= 100");
int count = Count;
int toTrim = 0;
// do we need to drop a percentage of entries?
if (percent > 0)
{
toTrim = (int)Math.Ceiling(((long)count * (long)percent) / 100D);
// would this leave us above MAX_COUNT?
int minTrim = count - MAX_COUNT;
if (toTrim < minTrim)
{
toTrim = minTrim;
}
}
// do we need to trim?
if (toTrim <= 0 || _disposed == 1)
{
return 0;
}
int trimmed = 0; // total number of entries trimmed
int trimmedOrExpired = 0;
#if DEBUG
int beginTotalCount = count;
#endif
trimmedOrExpired = _expires.FlushExpiredItems(true);
if (trimmedOrExpired < toTrim)
{
trimmed = _usage.FlushUnderUsedItems(toTrim - trimmedOrExpired);
trimmedOrExpired += trimmed;
}
if (trimmed > 0 && _perfCounters != null && _countersSupported)
{
// Update values for perfcounters
_perfCounters.IncrementBy(CounterName.Trims, trimmed);
}
#if DEBUG
Dbg.Trace("MemoryCacheStore", "TrimInternal:"
+ " beginTotalCount=" + beginTotalCount
+ ", endTotalCount=" + count
+ ", percent=" + percent
+ ", trimmed=" + trimmed);
#endif
return trimmedOrExpired;
}
internal void UnblockInsert()
{
_useInsertBlock = false;
_insertBlock.Set();
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/ITestTypedClient.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Http;
namespace Microsoft.Extensions.Http
{
// Simple typed client for use in tests
public interface ITestTypedClient
{
HttpClient HttpClient { get; }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Http;
namespace Microsoft.Extensions.Http
{
// Simple typed client for use in tests
public interface ITestTypedClient
{
HttpClient HttpClient { get; }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Performance/CodeQuality/Bytemark/neuraljagged.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*
** This program was translated to C# and adapted for xunit-performance.
** New variants of several tests were added to compare class versus
** struct and to compare jagged arrays vs multi-dimensional arrays.
*/
/*
** BYTEmark (tm)
** BYTE Magazine's Native Mode benchmarks
** Rick Grehan, BYTE Magazine
**
** Create:
** Revision: 3/95
**
** DISCLAIMER
** The source, executable, and documentation files that comprise
** the BYTEmark benchmarks are made available on an "as is" basis.
** This means that we at BYTE Magazine have made every reasonable
** effort to verify that the there are no errors in the source and
** executable code. We cannot, however, guarantee that the programs
** are error-free. Consequently, McGraw-HIll and BYTE Magazine make
** no claims in regard to the fitness of the source code, executable
** code, and documentation of the BYTEmark.
**
** Furthermore, BYTE Magazine, McGraw-Hill, and all employees
** of McGraw-Hill cannot be held responsible for any damages resulting
** from the use of this code or the results obtained from using
** this code.
*/
/********************************
** BACK PROPAGATION NEURAL NET **
*********************************
** This code is a modified version of the code
** that was submitted to BYTE Magazine by
** Maureen Caudill. It accomanied an article
** that I CANNOT NOW RECALL.
** The author's original heading/comment was
** as follows:
**
** Backpropagation Network
** Written by Maureen Caudill
** in Think C 4.0 on a Macintosh
**
** (c) Maureen Caudill 1988-1991
** This network will accept 5x7 input patterns
** and produce 8 bit output patterns.
** The source code may be copied or modified without restriction,
** but no fee may be charged for its use.
**
** ++++++++++++++
** I have modified the code so that it will work
** on systems other than a Macintosh -- RG
*/
/***********
** DoNNet **
************
** Perform the neural net benchmark.
** Note that this benchmark is one of the few that
** requires an input file. That file is "NNET.DAT" and
** should be on the local directory (from which the
** benchmark program in launched).
*/
using System;
using System.IO;
public class NeuralJagged : NNetStruct
{
public override string Name()
{
return "NEURAL NET(jagged)";
}
/*
** DEFINES
*/
public static int T = 1; /* TRUE */
public static int F = 0; /* FALSE */
public static int ERR = -1;
public static int MAXPATS = 10; /* max number of patterns in data file */
public static int IN_X_SIZE = 5; /* number of neurodes/row of input layer */
public static int IN_Y_SIZE = 7; /* number of neurodes/col of input layer */
public static int IN_SIZE = 35; /* equals IN_X_SIZE*IN_Y_SIZE */
public static int MID_SIZE = 8; /* number of neurodes in middle layer */
public static int OUT_SIZE = 8; /* number of neurodes in output layer */
public static double MARGIN = 0.1; /* how near to 1,0 do we have to come to stop? */
public static double BETA = 0.09; /* beta learning constant */
public static double ALPHA = 0.09; /* momentum term constant */
public static double STOP = 0.1; /* when worst_error less than STOP, training is done */
/*
** MAXNNETLOOPS
**
** This constant sets the max number of loops through the neural
** net that the system will attempt before giving up. This
** is not a critical constant. You can alter it if your system
** has sufficient horsepower.
*/
public static int MAXNNETLOOPS = 50000;
/*
** GLOBALS
*/
public static double[][] mid_wts = new double[MID_SIZE][];
public static double[][] out_wts = new double[OUT_SIZE][];
public static double[] mid_out = new double[MID_SIZE];
public static double[] out_out = new double[OUT_SIZE];
public static double[] mid_error = new double[MID_SIZE];
public static double[] out_error = new double[OUT_SIZE];
public static double[][] mid_wt_change = new double[MID_SIZE][];
public static double[][] out_wt_change = new double[OUT_SIZE][];
public static double[][] in_pats = new double[MAXPATS][];
public static double[][] out_pats = new double[MAXPATS][];
public static double[] tot_out_error = new double[MAXPATS];
public static double[][] out_wt_cum_change = new double[OUT_SIZE][];
public static double[][] mid_wt_cum_change = new double[MID_SIZE][];
public static double worst_error = 0.0; /* worst error each pass through the data */
public static double average_error = 0.0; /* average error each pass through the data */
public static double[] avg_out_error = new double[MAXPATS];
public static int iteration_count = 0; /* number of passes thru network so far */
public static int numpats = 0; /* number of patterns in data file */
public static int numpasses = 0; /* number of training passes through data file */
public static int learned = 0; /* flag--if TRUE, network has learned all patterns */
/*
** The Neural Net test requires an input data file.
** The name is specified here.
*/
public static string inpath = "NNET.DAT";
public static void Init()
{
for (int i = 0; i < MID_SIZE; i++)
{
mid_wts[i] = new double[IN_SIZE];
mid_wt_cum_change[i] = new double[IN_SIZE];
mid_wt_change[i] = new double[IN_SIZE];
}
for (int i = 0; i < OUT_SIZE; i++)
{
out_wt_change[i] = new double[MID_SIZE];
out_wts[i] = new double[MID_SIZE];
out_wt_cum_change[i] = new double[MID_SIZE];
}
for (int i = 0; i < MAXPATS; i++)
{
in_pats[i] = new double[IN_SIZE];
out_pats[i] = new double[OUT_SIZE];
}
}
public override
double Run()
{
Init();
return DoNNET(this);
}
/*********************
** read_data_file() **
**********************
** Read in the input data file and store the patterns in
** in_pats and out_pats.
** The format for the data file is as follows:
**
** line# data expected
** ----- ------------------------------
** 1 In-X-size,in-y-size,out-size
** 2 number of patterns in file
** 3 1st X row of 1st input pattern
** 4.. following rows of 1st input pattern pattern
** in-x+2 y-out pattern
** 1st X row of 2nd pattern
** etc.
**
** Each row of data is separated by commas or spaces.
** The data is expected to be ascii text corresponding to
** either a +1 or a 0.
**
** Sample input for a 1-pattern file (The comments to the
** right may NOT be in the file unless more sophisticated
** parsing of the input is done.):
**
** 5,7,8 input is 5x7 grid, output is 8 bits
** 1 one pattern in file
** 0,1,1,1,0 beginning of pattern for "O"
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,0
** 0,1,1,1,0
** 0,1,0,0,1,1,1,1 ASCII code for "O" -- 0100 1111
**
** Clearly, this simple scheme can be expanded or enhanced
** any way you like.
**
** Returns -1 if any file error occurred, otherwise 0.
**/
private
void read_data_file()
{
int xinsize = 0, yinsize = 0, youtsize = 0;
int patt = 0, element = 0, i = 0, row = 0;
int vals_read = 0;
int val1 = 0, val2 = 0, val3 = 0, val4 = 0, val5 = 0, val6 = 0, val7 = 0, val8 = 0;
Object[] results = new Object[8];
string input = NeuralData.Input;
StringReader infile = new StringReader(input);
vals_read = Utility.fscanf(infile, "%d %d %d", results);
xinsize = (int)results[0];
yinsize = (int)results[1];
youtsize = (int)results[2];
if (vals_read != 3)
{
throw new Exception("NNET: error reading input");
}
vals_read = Utility.fscanf(infile, "%d", results);
numpats = (int)results[0];
if (vals_read != 1)
{
throw new Exception("NNET: error reading input");
}
if (numpats > MAXPATS)
numpats = MAXPATS;
for (patt = 0; patt < numpats; patt++)
{
element = 0;
for (row = 0; row < yinsize; row++)
{
vals_read = Utility.fscanf(infile, "%d %d %d %d %d", results);
val1 = (int)results[0];
val2 = (int)results[1];
val3 = (int)results[2];
val4 = (int)results[3];
val5 = (int)results[4];
if (vals_read != 5)
{
throw new Exception("NNET: error reading input");
}
element = row * xinsize;
in_pats[patt][element] = (double)val1; element++;
in_pats[patt][element] = (double)val2; element++;
in_pats[patt][element] = (double)val3; element++;
in_pats[patt][element] = (double)val4; element++;
in_pats[patt][element] = (double)val5; element++;
}
for (i = 0; i < IN_SIZE; i++)
{
if (in_pats[patt][i] >= 0.9)
in_pats[patt][i] = 0.9;
if (in_pats[patt][i] <= 0.1)
in_pats[patt][i] = 0.1;
}
element = 0;
vals_read = Utility.fscanf(infile, "%d %d %d %d %d %d %d %d", results);
val1 = (int)results[0];
val2 = (int)results[1];
val3 = (int)results[2];
val4 = (int)results[3];
val5 = (int)results[4];
val6 = (int)results[5];
val7 = (int)results[6];
val8 = (int)results[7];
out_pats[patt][element] = (double)val1; element++;
out_pats[patt][element] = (double)val2; element++;
out_pats[patt][element] = (double)val3; element++;
out_pats[patt][element] = (double)val4; element++;
out_pats[patt][element] = (double)val5; element++;
out_pats[patt][element] = (double)val6; element++;
out_pats[patt][element] = (double)val7; element++;
out_pats[patt][element] = (double)val8; element++;
}
}
private
double DoNNET(NNetStruct locnnetstruct)
{
// string errorcontext = "CPU:NNET";
// int systemerror = 0;
long accumtime = 0;
double iterations = 0.0;
/*
** Init random number generator.
** NOTE: It is important that the random number generator
** be re-initialized for every pass through this test.
** The NNET algorithm uses the random number generator
** to initialize the net. Results are sensitive to
** the initial neural net state.
*/
ByteMark.randnum(3);
/*
** Read in the input and output patterns. We'll do this
** only once here at the beginning. These values don't
** change once loaded.
*/
read_data_file();
/*
** See if we need to perform self adjustment loop.
*/
if (locnnetstruct.adjust == 0)
{
/*
** Do self-adjustment. This involves initializing the
** # of loops and increasing the loop count until we
** get a number of loops that we can use.
*/
for (locnnetstruct.loops = 1;
locnnetstruct.loops < MAXNNETLOOPS;
locnnetstruct.loops++)
{
ByteMark.randnum(3);
if (DoNNetIteration(locnnetstruct.loops) > global.min_ticks)
break;
}
}
/*
** All's well if we get here. Do the test.
*/
accumtime = 0L;
iterations = (double)0.0;
do
{
ByteMark.randnum(3); /* Gotta do this for Neural Net */
accumtime += DoNNetIteration(locnnetstruct.loops);
iterations += (double)locnnetstruct.loops;
} while (ByteMark.TicksToSecs(accumtime) < locnnetstruct.request_secs);
/*
** Clean up, calculate results, and go home. Be sure to
** show that we don't have to rerun adjustment code.
*/
locnnetstruct.iterspersec = iterations / ByteMark.TicksToFracSecs(accumtime);
if (locnnetstruct.adjust == 0)
locnnetstruct.adjust = 1;
return locnnetstruct.iterspersec;
}
/********************
** DoNNetIteration **
*********************
** Do a single iteration of the neural net benchmark.
** By iteration, we mean a "learning" pass.
*/
public static long DoNNetIteration(long nloops)
{
long elapsed; /* Elapsed time */
int patt;
/*
** Run nloops learning cycles. Notice that, counted with
** the learning cycle is the weight randomization and
** zeroing of changes. This should reduce clock jitter,
** since we don't have to stop and start the clock for
** each iteration.
*/
elapsed = ByteMark.StartStopwatch();
while (nloops-- != 0)
{
randomize_wts();
zero_changes();
iteration_count = 1;
learned = F;
numpasses = 0;
while (learned == F)
{
for (patt = 0; patt < numpats; patt++)
{
worst_error = 0.0; /* reset this every pass through data */
move_wt_changes(); /* move last pass's wt changes to momentum array */
do_forward_pass(patt);
do_back_pass(patt);
iteration_count++;
}
numpasses++;
learned = check_out_error();
}
}
return (ByteMark.StopStopwatch(elapsed));
}
/*************************
** do_mid_forward(patt) **
**************************
** Process the middle layer's forward pass
** The activation of middle layer's neurode is the weighted
** sum of the inputs from the input pattern, with sigmoid
** function applied to the inputs.
**/
public static void do_mid_forward(int patt)
{
double sum;
int neurode, i;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < IN_SIZE; i++)
{ /* compute weighted sum of input signals */
sum += mid_wts[neurode][i] * in_pats[patt][i];
}
/*
** apply sigmoid function f(x) = 1/(1+exp(-x)) to weighted sum
*/
sum = 1.0 / (1.0 + Math.Exp(-sum));
mid_out[neurode] = sum;
}
return;
}
/*********************
** do_out_forward() **
**********************
** process the forward pass through the output layer
** The activation of the output layer is the weighted sum of
** the inputs (outputs from middle layer), modified by the
** sigmoid function.
**/
public static void do_out_forward()
{
double sum;
int neurode, i;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < MID_SIZE; i++)
{ /*
** compute weighted sum of input signals
** from middle layer
*/
sum += out_wts[neurode][i] * mid_out[i];
}
/*
** Apply f(x) = 1/(1+Math.Exp(-x)) to weighted input
*/
sum = 1.0 / (1.0 + Math.Exp(-sum));
out_out[neurode] = sum;
}
return;
}
/*************************
** display_output(patt) **
**************************
** Display the actual output vs. the desired output of the
** network.
** Once the training is complete, and the "learned" flag set
** to TRUE, then display_output sends its output to both
** the screen and to a text output file.
**
** NOTE: This routine has been disabled in the benchmark
** version. -- RG
**/
/*
public static void display_output(int patt)
{
int i;
fprintf(outfile,"\n Iteration # %d",iteration_count);
fprintf(outfile,"\n Desired Output: ");
for (i=0; i<OUT_SIZE; i++)
{
fprintf(outfile,"%6.3f ",out_pats[patt][i]);
}
fprintf(outfile,"\n Actual Output: ");
for (i=0; i<OUT_SIZE; i++)
{
fprintf(outfile,"%6.3f ",out_out[i]);
}
fprintf(outfile,"\n");
return;
}
*/
/**********************
** do_forward_pass() **
***********************
** control function for the forward pass through the network
** NOTE: I have disabled the call to display_output() in
** the benchmark version -- RG.
**/
public static void do_forward_pass(int patt)
{
do_mid_forward(patt); /* process forward pass, middle layer */
do_out_forward(); /* process forward pass, output layer */
/* display_output(patt); ** display results of forward pass */
return;
}
/***********************
** do_out_error(patt) **
************************
** Compute the error for the output layer neurodes.
** This is simply Desired - Actual.
**/
public static void do_out_error(int patt)
{
int neurode;
double error, tot_error, sum;
tot_error = 0.0;
sum = 0.0;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
out_error[neurode] = out_pats[patt][neurode] - out_out[neurode];
/*
** while we're here, also compute magnitude
** of total error and worst error in this pass.
** We use these to decide if we are done yet.
*/
error = out_error[neurode];
if (error < 0.0)
{
sum += -error;
if (-error > tot_error)
tot_error = -error; /* worst error this pattern */
}
else
{
sum += error;
if (error > tot_error)
tot_error = error; /* worst error this pattern */
}
}
avg_out_error[patt] = sum / OUT_SIZE;
tot_out_error[patt] = tot_error;
return;
}
/***********************
** worst_pass_error() **
************************
** Find the worst and average error in the pass and save it
**/
public static void worst_pass_error()
{
double error, sum;
int i;
error = 0.0;
sum = 0.0;
for (i = 0; i < numpats; i++)
{
if (tot_out_error[i] > error) error = tot_out_error[i];
sum += avg_out_error[i];
}
worst_error = error;
average_error = sum / numpats;
return;
}
/*******************
** do_mid_error() **
********************
** Compute the error for the middle layer neurodes
** This is based on the output errors computed above.
** Note that the derivative of the sigmoid f(x) is
** f'(x) = f(x)(1 - f(x))
** Recall that f(x) is merely the output of the middle
** layer neurode on the forward pass.
**/
public static void do_mid_error()
{
double sum;
int neurode, i;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < OUT_SIZE; i++)
sum += out_wts[i][neurode] * out_error[i];
/*
** apply the derivative of the sigmoid here
** Because of the choice of sigmoid f(I), the derivative
** of the sigmoid is f'(I) = f(I)(1 - f(I))
*/
mid_error[neurode] = mid_out[neurode] * (1 - mid_out[neurode]) * sum;
}
return;
}
/*********************
** adjust_out_wts() **
**********************
** Adjust the weights of the output layer. The error for
** the output layer has been previously propagated back to
** the middle layer.
** Use the Delta Rule with momentum term to adjust the weights.
**/
public static void adjust_out_wts()
{
int weight, neurode;
double learn, delta, alph;
learn = BETA;
alph = ALPHA;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
for (weight = 0; weight < MID_SIZE; weight++)
{
/* standard delta rule */
delta = learn * out_error[neurode] * mid_out[weight];
/* now the momentum term */
delta += alph * out_wt_change[neurode][weight];
out_wts[neurode][weight] += delta;
/* keep track of this pass's cum wt changes for next pass's momentum */
out_wt_cum_change[neurode][weight] += delta;
}
}
return;
}
/*************************
** adjust_mid_wts(patt) **
**************************
** Adjust the middle layer weights using the previously computed
** errors.
** We use the Generalized Delta Rule with momentum term
**/
public static void adjust_mid_wts(int patt)
{
int weight, neurode;
double learn, alph, delta;
learn = BETA;
alph = ALPHA;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
for (weight = 0; weight < IN_SIZE; weight++)
{
/* first the basic delta rule */
delta = learn * mid_error[neurode] * in_pats[patt][weight];
/* with the momentum term */
delta += alph * mid_wt_change[neurode][weight];
mid_wts[neurode][weight] += delta;
/* keep track of this pass's cum wt changes for next pass's momentum */
mid_wt_cum_change[neurode][weight] += delta;
}
}
return;
}
/*******************
** do_back_pass() **
********************
** Process the backward propagation of error through network.
**/
public static void do_back_pass(int patt)
{
do_out_error(patt);
do_mid_error();
adjust_out_wts();
adjust_mid_wts(patt);
return;
}
/**********************
** move_wt_changes() **
***********************
** Move the weight changes accumulated last pass into the wt-change
** array for use by the momentum term in this pass. Also zero out
** the accumulating arrays after the move.
**/
public static void move_wt_changes()
{
int i, j;
for (i = 0; i < MID_SIZE; i++)
for (j = 0; j < IN_SIZE; j++)
{
mid_wt_change[i][j] = mid_wt_cum_change[i][j];
/*
** Zero it out for next pass accumulation.
*/
mid_wt_cum_change[i][j] = 0.0;
}
for (i = 0; i < OUT_SIZE; i++)
for (j = 0; j < MID_SIZE; j++)
{
out_wt_change[i][j] = out_wt_cum_change[i][j];
out_wt_cum_change[i][j] = 0.0;
}
return;
}
/**********************
** check_out_error() **
***********************
** Check to see if the error in the output layer is below
** MARGIN*OUT_SIZE for all output patterns. If so, then
** assume the network has learned acceptably well. This
** is simply an arbitrary measure of how well the network
** has learned -- many other standards are possible.
**/
public static int check_out_error()
{
int result, i, error;
result = T;
error = F;
worst_pass_error(); /* identify the worst error in this pass */
for (i = 0; i < numpats; i++)
{
if (worst_error >= STOP) result = F;
if (tot_out_error[i] >= 16.0) error = T;
}
if (error == T) result = ERR;
return (result);
}
/*******************
** zero_changes() **
********************
** Zero out all the wt change arrays
**/
public static void zero_changes()
{
int i, j;
for (i = 0; i < MID_SIZE; i++)
{
for (j = 0; j < IN_SIZE; j++)
{
mid_wt_change[i][j] = 0.0;
mid_wt_cum_change[i][j] = 0.0;
}
}
for (i = 0; i < OUT_SIZE; i++)
{
for (j = 0; j < MID_SIZE; j++)
{
out_wt_change[i][j] = 0.0;
out_wt_cum_change[i][j] = 0.0;
}
}
return;
}
/********************
** randomize_wts() **
*********************
** Intialize the weights in the middle and output layers to
** random values between -0.25..+0.25
** Function rand() returns a value between 0 and 32767.
**
** NOTE: Had to make alterations to how the random numbers were
** created. -- RG.
**/
public static void randomize_wts()
{
int neurode, i;
double value;
/*
** Following not used int benchmark version -- RG
**
** printf("\n Please enter a random number seed (1..32767): ");
** scanf("%d", &i);
** srand(i);
*/
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
for (i = 0; i < IN_SIZE; i++)
{
value = (double)ByteMark.abs_randwc(100000);
value = value / (double)100000.0 - (double)0.5;
mid_wts[neurode][i] = value / 2;
}
}
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
for (i = 0; i < MID_SIZE; i++)
{
value = (double)ByteMark.abs_randwc(100000);
value = value / (double)10000.0 - (double)0.5;
out_wts[neurode][i] = value / 2;
}
}
return;
}
/**********************
** display_mid_wts() **
***********************
** Display the weights on the middle layer neurodes
** NOTE: This routine is not used in the benchmark
** test -- RG
**/
/* static void display_mid_wts()
{
int neurode, weight, row, col;
fprintf(outfile,"\n Weights of Middle Layer neurodes:");
for (neurode=0; neurode<MID_SIZE; neurode++)
{
fprintf(outfile,"\n Mid Neurode # %d",neurode);
for (row=0; row<IN_Y_SIZE; row++)
{
fprintf(outfile,"\n ");
for (col=0; col<IN_X_SIZE; col++)
{
weight = IN_X_SIZE * row + col;
fprintf(outfile," %8.3f ", mid_wts[neurode,weight]);
}
}
}
return;
}
*/
/**********************
** display_out_wts() **
***********************
** Display the weights on the output layer neurodes
** NOTE: This code is not used in the benchmark
** test -- RG
*/
/* void display_out_wts()
{
int neurode, weight;
fprintf(outfile,"\n Weights of Output Layer neurodes:");
for (neurode=0; neurode<OUT_SIZE; neurode++)
{
fprintf(outfile,"\n Out Neurode # %d \n",neurode);
for (weight=0; weight<MID_SIZE; weight++)
{
fprintf(outfile," %8.3f ", out_wts[neurode,weight]);
}
}
return;
}
*/
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*
** This program was translated to C# and adapted for xunit-performance.
** New variants of several tests were added to compare class versus
** struct and to compare jagged arrays vs multi-dimensional arrays.
*/
/*
** BYTEmark (tm)
** BYTE Magazine's Native Mode benchmarks
** Rick Grehan, BYTE Magazine
**
** Create:
** Revision: 3/95
**
** DISCLAIMER
** The source, executable, and documentation files that comprise
** the BYTEmark benchmarks are made available on an "as is" basis.
** This means that we at BYTE Magazine have made every reasonable
** effort to verify that the there are no errors in the source and
** executable code. We cannot, however, guarantee that the programs
** are error-free. Consequently, McGraw-HIll and BYTE Magazine make
** no claims in regard to the fitness of the source code, executable
** code, and documentation of the BYTEmark.
**
** Furthermore, BYTE Magazine, McGraw-Hill, and all employees
** of McGraw-Hill cannot be held responsible for any damages resulting
** from the use of this code or the results obtained from using
** this code.
*/
/********************************
** BACK PROPAGATION NEURAL NET **
*********************************
** This code is a modified version of the code
** that was submitted to BYTE Magazine by
** Maureen Caudill. It accomanied an article
** that I CANNOT NOW RECALL.
** The author's original heading/comment was
** as follows:
**
** Backpropagation Network
** Written by Maureen Caudill
** in Think C 4.0 on a Macintosh
**
** (c) Maureen Caudill 1988-1991
** This network will accept 5x7 input patterns
** and produce 8 bit output patterns.
** The source code may be copied or modified without restriction,
** but no fee may be charged for its use.
**
** ++++++++++++++
** I have modified the code so that it will work
** on systems other than a Macintosh -- RG
*/
/***********
** DoNNet **
************
** Perform the neural net benchmark.
** Note that this benchmark is one of the few that
** requires an input file. That file is "NNET.DAT" and
** should be on the local directory (from which the
** benchmark program in launched).
*/
using System;
using System.IO;
public class NeuralJagged : NNetStruct
{
public override string Name()
{
return "NEURAL NET(jagged)";
}
/*
** DEFINES
*/
public static int T = 1; /* TRUE */
public static int F = 0; /* FALSE */
public static int ERR = -1;
public static int MAXPATS = 10; /* max number of patterns in data file */
public static int IN_X_SIZE = 5; /* number of neurodes/row of input layer */
public static int IN_Y_SIZE = 7; /* number of neurodes/col of input layer */
public static int IN_SIZE = 35; /* equals IN_X_SIZE*IN_Y_SIZE */
public static int MID_SIZE = 8; /* number of neurodes in middle layer */
public static int OUT_SIZE = 8; /* number of neurodes in output layer */
public static double MARGIN = 0.1; /* how near to 1,0 do we have to come to stop? */
public static double BETA = 0.09; /* beta learning constant */
public static double ALPHA = 0.09; /* momentum term constant */
public static double STOP = 0.1; /* when worst_error less than STOP, training is done */
/*
** MAXNNETLOOPS
**
** This constant sets the max number of loops through the neural
** net that the system will attempt before giving up. This
** is not a critical constant. You can alter it if your system
** has sufficient horsepower.
*/
public static int MAXNNETLOOPS = 50000;
/*
** GLOBALS
*/
public static double[][] mid_wts = new double[MID_SIZE][];
public static double[][] out_wts = new double[OUT_SIZE][];
public static double[] mid_out = new double[MID_SIZE];
public static double[] out_out = new double[OUT_SIZE];
public static double[] mid_error = new double[MID_SIZE];
public static double[] out_error = new double[OUT_SIZE];
public static double[][] mid_wt_change = new double[MID_SIZE][];
public static double[][] out_wt_change = new double[OUT_SIZE][];
public static double[][] in_pats = new double[MAXPATS][];
public static double[][] out_pats = new double[MAXPATS][];
public static double[] tot_out_error = new double[MAXPATS];
public static double[][] out_wt_cum_change = new double[OUT_SIZE][];
public static double[][] mid_wt_cum_change = new double[MID_SIZE][];
public static double worst_error = 0.0; /* worst error each pass through the data */
public static double average_error = 0.0; /* average error each pass through the data */
public static double[] avg_out_error = new double[MAXPATS];
public static int iteration_count = 0; /* number of passes thru network so far */
public static int numpats = 0; /* number of patterns in data file */
public static int numpasses = 0; /* number of training passes through data file */
public static int learned = 0; /* flag--if TRUE, network has learned all patterns */
/*
** The Neural Net test requires an input data file.
** The name is specified here.
*/
public static string inpath = "NNET.DAT";
public static void Init()
{
for (int i = 0; i < MID_SIZE; i++)
{
mid_wts[i] = new double[IN_SIZE];
mid_wt_cum_change[i] = new double[IN_SIZE];
mid_wt_change[i] = new double[IN_SIZE];
}
for (int i = 0; i < OUT_SIZE; i++)
{
out_wt_change[i] = new double[MID_SIZE];
out_wts[i] = new double[MID_SIZE];
out_wt_cum_change[i] = new double[MID_SIZE];
}
for (int i = 0; i < MAXPATS; i++)
{
in_pats[i] = new double[IN_SIZE];
out_pats[i] = new double[OUT_SIZE];
}
}
public override
double Run()
{
Init();
return DoNNET(this);
}
/*********************
** read_data_file() **
**********************
** Read in the input data file and store the patterns in
** in_pats and out_pats.
** The format for the data file is as follows:
**
** line# data expected
** ----- ------------------------------
** 1 In-X-size,in-y-size,out-size
** 2 number of patterns in file
** 3 1st X row of 1st input pattern
** 4.. following rows of 1st input pattern pattern
** in-x+2 y-out pattern
** 1st X row of 2nd pattern
** etc.
**
** Each row of data is separated by commas or spaces.
** The data is expected to be ascii text corresponding to
** either a +1 or a 0.
**
** Sample input for a 1-pattern file (The comments to the
** right may NOT be in the file unless more sophisticated
** parsing of the input is done.):
**
** 5,7,8 input is 5x7 grid, output is 8 bits
** 1 one pattern in file
** 0,1,1,1,0 beginning of pattern for "O"
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,1
** 1,0,0,0,0
** 0,1,1,1,0
** 0,1,0,0,1,1,1,1 ASCII code for "O" -- 0100 1111
**
** Clearly, this simple scheme can be expanded or enhanced
** any way you like.
**
** Returns -1 if any file error occurred, otherwise 0.
**/
private
void read_data_file()
{
int xinsize = 0, yinsize = 0, youtsize = 0;
int patt = 0, element = 0, i = 0, row = 0;
int vals_read = 0;
int val1 = 0, val2 = 0, val3 = 0, val4 = 0, val5 = 0, val6 = 0, val7 = 0, val8 = 0;
Object[] results = new Object[8];
string input = NeuralData.Input;
StringReader infile = new StringReader(input);
vals_read = Utility.fscanf(infile, "%d %d %d", results);
xinsize = (int)results[0];
yinsize = (int)results[1];
youtsize = (int)results[2];
if (vals_read != 3)
{
throw new Exception("NNET: error reading input");
}
vals_read = Utility.fscanf(infile, "%d", results);
numpats = (int)results[0];
if (vals_read != 1)
{
throw new Exception("NNET: error reading input");
}
if (numpats > MAXPATS)
numpats = MAXPATS;
for (patt = 0; patt < numpats; patt++)
{
element = 0;
for (row = 0; row < yinsize; row++)
{
vals_read = Utility.fscanf(infile, "%d %d %d %d %d", results);
val1 = (int)results[0];
val2 = (int)results[1];
val3 = (int)results[2];
val4 = (int)results[3];
val5 = (int)results[4];
if (vals_read != 5)
{
throw new Exception("NNET: error reading input");
}
element = row * xinsize;
in_pats[patt][element] = (double)val1; element++;
in_pats[patt][element] = (double)val2; element++;
in_pats[patt][element] = (double)val3; element++;
in_pats[patt][element] = (double)val4; element++;
in_pats[patt][element] = (double)val5; element++;
}
for (i = 0; i < IN_SIZE; i++)
{
if (in_pats[patt][i] >= 0.9)
in_pats[patt][i] = 0.9;
if (in_pats[patt][i] <= 0.1)
in_pats[patt][i] = 0.1;
}
element = 0;
vals_read = Utility.fscanf(infile, "%d %d %d %d %d %d %d %d", results);
val1 = (int)results[0];
val2 = (int)results[1];
val3 = (int)results[2];
val4 = (int)results[3];
val5 = (int)results[4];
val6 = (int)results[5];
val7 = (int)results[6];
val8 = (int)results[7];
out_pats[patt][element] = (double)val1; element++;
out_pats[patt][element] = (double)val2; element++;
out_pats[patt][element] = (double)val3; element++;
out_pats[patt][element] = (double)val4; element++;
out_pats[patt][element] = (double)val5; element++;
out_pats[patt][element] = (double)val6; element++;
out_pats[patt][element] = (double)val7; element++;
out_pats[patt][element] = (double)val8; element++;
}
}
private
double DoNNET(NNetStruct locnnetstruct)
{
// string errorcontext = "CPU:NNET";
// int systemerror = 0;
long accumtime = 0;
double iterations = 0.0;
/*
** Init random number generator.
** NOTE: It is important that the random number generator
** be re-initialized for every pass through this test.
** The NNET algorithm uses the random number generator
** to initialize the net. Results are sensitive to
** the initial neural net state.
*/
ByteMark.randnum(3);
/*
** Read in the input and output patterns. We'll do this
** only once here at the beginning. These values don't
** change once loaded.
*/
read_data_file();
/*
** See if we need to perform self adjustment loop.
*/
if (locnnetstruct.adjust == 0)
{
/*
** Do self-adjustment. This involves initializing the
** # of loops and increasing the loop count until we
** get a number of loops that we can use.
*/
for (locnnetstruct.loops = 1;
locnnetstruct.loops < MAXNNETLOOPS;
locnnetstruct.loops++)
{
ByteMark.randnum(3);
if (DoNNetIteration(locnnetstruct.loops) > global.min_ticks)
break;
}
}
/*
** All's well if we get here. Do the test.
*/
accumtime = 0L;
iterations = (double)0.0;
do
{
ByteMark.randnum(3); /* Gotta do this for Neural Net */
accumtime += DoNNetIteration(locnnetstruct.loops);
iterations += (double)locnnetstruct.loops;
} while (ByteMark.TicksToSecs(accumtime) < locnnetstruct.request_secs);
/*
** Clean up, calculate results, and go home. Be sure to
** show that we don't have to rerun adjustment code.
*/
locnnetstruct.iterspersec = iterations / ByteMark.TicksToFracSecs(accumtime);
if (locnnetstruct.adjust == 0)
locnnetstruct.adjust = 1;
return locnnetstruct.iterspersec;
}
/********************
** DoNNetIteration **
*********************
** Do a single iteration of the neural net benchmark.
** By iteration, we mean a "learning" pass.
*/
public static long DoNNetIteration(long nloops)
{
long elapsed; /* Elapsed time */
int patt;
/*
** Run nloops learning cycles. Notice that, counted with
** the learning cycle is the weight randomization and
** zeroing of changes. This should reduce clock jitter,
** since we don't have to stop and start the clock for
** each iteration.
*/
elapsed = ByteMark.StartStopwatch();
while (nloops-- != 0)
{
randomize_wts();
zero_changes();
iteration_count = 1;
learned = F;
numpasses = 0;
while (learned == F)
{
for (patt = 0; patt < numpats; patt++)
{
worst_error = 0.0; /* reset this every pass through data */
move_wt_changes(); /* move last pass's wt changes to momentum array */
do_forward_pass(patt);
do_back_pass(patt);
iteration_count++;
}
numpasses++;
learned = check_out_error();
}
}
return (ByteMark.StopStopwatch(elapsed));
}
/*************************
** do_mid_forward(patt) **
**************************
** Process the middle layer's forward pass
** The activation of middle layer's neurode is the weighted
** sum of the inputs from the input pattern, with sigmoid
** function applied to the inputs.
**/
public static void do_mid_forward(int patt)
{
double sum;
int neurode, i;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < IN_SIZE; i++)
{ /* compute weighted sum of input signals */
sum += mid_wts[neurode][i] * in_pats[patt][i];
}
/*
** apply sigmoid function f(x) = 1/(1+exp(-x)) to weighted sum
*/
sum = 1.0 / (1.0 + Math.Exp(-sum));
mid_out[neurode] = sum;
}
return;
}
/*********************
** do_out_forward() **
**********************
** process the forward pass through the output layer
** The activation of the output layer is the weighted sum of
** the inputs (outputs from middle layer), modified by the
** sigmoid function.
**/
public static void do_out_forward()
{
double sum;
int neurode, i;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < MID_SIZE; i++)
{ /*
** compute weighted sum of input signals
** from middle layer
*/
sum += out_wts[neurode][i] * mid_out[i];
}
/*
** Apply f(x) = 1/(1+Math.Exp(-x)) to weighted input
*/
sum = 1.0 / (1.0 + Math.Exp(-sum));
out_out[neurode] = sum;
}
return;
}
/*************************
** display_output(patt) **
**************************
** Display the actual output vs. the desired output of the
** network.
** Once the training is complete, and the "learned" flag set
** to TRUE, then display_output sends its output to both
** the screen and to a text output file.
**
** NOTE: This routine has been disabled in the benchmark
** version. -- RG
**/
/*
public static void display_output(int patt)
{
int i;
fprintf(outfile,"\n Iteration # %d",iteration_count);
fprintf(outfile,"\n Desired Output: ");
for (i=0; i<OUT_SIZE; i++)
{
fprintf(outfile,"%6.3f ",out_pats[patt][i]);
}
fprintf(outfile,"\n Actual Output: ");
for (i=0; i<OUT_SIZE; i++)
{
fprintf(outfile,"%6.3f ",out_out[i]);
}
fprintf(outfile,"\n");
return;
}
*/
/**********************
** do_forward_pass() **
***********************
** control function for the forward pass through the network
** NOTE: I have disabled the call to display_output() in
** the benchmark version -- RG.
**/
public static void do_forward_pass(int patt)
{
do_mid_forward(patt); /* process forward pass, middle layer */
do_out_forward(); /* process forward pass, output layer */
/* display_output(patt); ** display results of forward pass */
return;
}
/***********************
** do_out_error(patt) **
************************
** Compute the error for the output layer neurodes.
** This is simply Desired - Actual.
**/
public static void do_out_error(int patt)
{
int neurode;
double error, tot_error, sum;
tot_error = 0.0;
sum = 0.0;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
out_error[neurode] = out_pats[patt][neurode] - out_out[neurode];
/*
** while we're here, also compute magnitude
** of total error and worst error in this pass.
** We use these to decide if we are done yet.
*/
error = out_error[neurode];
if (error < 0.0)
{
sum += -error;
if (-error > tot_error)
tot_error = -error; /* worst error this pattern */
}
else
{
sum += error;
if (error > tot_error)
tot_error = error; /* worst error this pattern */
}
}
avg_out_error[patt] = sum / OUT_SIZE;
tot_out_error[patt] = tot_error;
return;
}
/***********************
** worst_pass_error() **
************************
** Find the worst and average error in the pass and save it
**/
public static void worst_pass_error()
{
double error, sum;
int i;
error = 0.0;
sum = 0.0;
for (i = 0; i < numpats; i++)
{
if (tot_out_error[i] > error) error = tot_out_error[i];
sum += avg_out_error[i];
}
worst_error = error;
average_error = sum / numpats;
return;
}
/*******************
** do_mid_error() **
********************
** Compute the error for the middle layer neurodes
** This is based on the output errors computed above.
** Note that the derivative of the sigmoid f(x) is
** f'(x) = f(x)(1 - f(x))
** Recall that f(x) is merely the output of the middle
** layer neurode on the forward pass.
**/
public static void do_mid_error()
{
double sum;
int neurode, i;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
sum = 0.0;
for (i = 0; i < OUT_SIZE; i++)
sum += out_wts[i][neurode] * out_error[i];
/*
** apply the derivative of the sigmoid here
** Because of the choice of sigmoid f(I), the derivative
** of the sigmoid is f'(I) = f(I)(1 - f(I))
*/
mid_error[neurode] = mid_out[neurode] * (1 - mid_out[neurode]) * sum;
}
return;
}
/*********************
** adjust_out_wts() **
**********************
** Adjust the weights of the output layer. The error for
** the output layer has been previously propagated back to
** the middle layer.
** Use the Delta Rule with momentum term to adjust the weights.
**/
public static void adjust_out_wts()
{
int weight, neurode;
double learn, delta, alph;
learn = BETA;
alph = ALPHA;
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
for (weight = 0; weight < MID_SIZE; weight++)
{
/* standard delta rule */
delta = learn * out_error[neurode] * mid_out[weight];
/* now the momentum term */
delta += alph * out_wt_change[neurode][weight];
out_wts[neurode][weight] += delta;
/* keep track of this pass's cum wt changes for next pass's momentum */
out_wt_cum_change[neurode][weight] += delta;
}
}
return;
}
/*************************
** adjust_mid_wts(patt) **
**************************
** Adjust the middle layer weights using the previously computed
** errors.
** We use the Generalized Delta Rule with momentum term
**/
public static void adjust_mid_wts(int patt)
{
int weight, neurode;
double learn, alph, delta;
learn = BETA;
alph = ALPHA;
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
for (weight = 0; weight < IN_SIZE; weight++)
{
/* first the basic delta rule */
delta = learn * mid_error[neurode] * in_pats[patt][weight];
/* with the momentum term */
delta += alph * mid_wt_change[neurode][weight];
mid_wts[neurode][weight] += delta;
/* keep track of this pass's cum wt changes for next pass's momentum */
mid_wt_cum_change[neurode][weight] += delta;
}
}
return;
}
/*******************
** do_back_pass() **
********************
** Process the backward propagation of error through network.
**/
public static void do_back_pass(int patt)
{
do_out_error(patt);
do_mid_error();
adjust_out_wts();
adjust_mid_wts(patt);
return;
}
/**********************
** move_wt_changes() **
***********************
** Move the weight changes accumulated last pass into the wt-change
** array for use by the momentum term in this pass. Also zero out
** the accumulating arrays after the move.
**/
public static void move_wt_changes()
{
int i, j;
for (i = 0; i < MID_SIZE; i++)
for (j = 0; j < IN_SIZE; j++)
{
mid_wt_change[i][j] = mid_wt_cum_change[i][j];
/*
** Zero it out for next pass accumulation.
*/
mid_wt_cum_change[i][j] = 0.0;
}
for (i = 0; i < OUT_SIZE; i++)
for (j = 0; j < MID_SIZE; j++)
{
out_wt_change[i][j] = out_wt_cum_change[i][j];
out_wt_cum_change[i][j] = 0.0;
}
return;
}
/**********************
** check_out_error() **
***********************
** Check to see if the error in the output layer is below
** MARGIN*OUT_SIZE for all output patterns. If so, then
** assume the network has learned acceptably well. This
** is simply an arbitrary measure of how well the network
** has learned -- many other standards are possible.
**/
public static int check_out_error()
{
int result, i, error;
result = T;
error = F;
worst_pass_error(); /* identify the worst error in this pass */
for (i = 0; i < numpats; i++)
{
if (worst_error >= STOP) result = F;
if (tot_out_error[i] >= 16.0) error = T;
}
if (error == T) result = ERR;
return (result);
}
/*******************
** zero_changes() **
********************
** Zero out all the wt change arrays
**/
public static void zero_changes()
{
int i, j;
for (i = 0; i < MID_SIZE; i++)
{
for (j = 0; j < IN_SIZE; j++)
{
mid_wt_change[i][j] = 0.0;
mid_wt_cum_change[i][j] = 0.0;
}
}
for (i = 0; i < OUT_SIZE; i++)
{
for (j = 0; j < MID_SIZE; j++)
{
out_wt_change[i][j] = 0.0;
out_wt_cum_change[i][j] = 0.0;
}
}
return;
}
/********************
** randomize_wts() **
*********************
** Intialize the weights in the middle and output layers to
** random values between -0.25..+0.25
** Function rand() returns a value between 0 and 32767.
**
** NOTE: Had to make alterations to how the random numbers were
** created. -- RG.
**/
public static void randomize_wts()
{
int neurode, i;
double value;
/*
** Following not used int benchmark version -- RG
**
** printf("\n Please enter a random number seed (1..32767): ");
** scanf("%d", &i);
** srand(i);
*/
for (neurode = 0; neurode < MID_SIZE; neurode++)
{
for (i = 0; i < IN_SIZE; i++)
{
value = (double)ByteMark.abs_randwc(100000);
value = value / (double)100000.0 - (double)0.5;
mid_wts[neurode][i] = value / 2;
}
}
for (neurode = 0; neurode < OUT_SIZE; neurode++)
{
for (i = 0; i < MID_SIZE; i++)
{
value = (double)ByteMark.abs_randwc(100000);
value = value / (double)10000.0 - (double)0.5;
out_wts[neurode][i] = value / 2;
}
}
return;
}
/**********************
** display_mid_wts() **
***********************
** Display the weights on the middle layer neurodes
** NOTE: This routine is not used in the benchmark
** test -- RG
**/
/* static void display_mid_wts()
{
int neurode, weight, row, col;
fprintf(outfile,"\n Weights of Middle Layer neurodes:");
for (neurode=0; neurode<MID_SIZE; neurode++)
{
fprintf(outfile,"\n Mid Neurode # %d",neurode);
for (row=0; row<IN_Y_SIZE; row++)
{
fprintf(outfile,"\n ");
for (col=0; col<IN_X_SIZE; col++)
{
weight = IN_X_SIZE * row + col;
fprintf(outfile," %8.3f ", mid_wts[neurode,weight]);
}
}
}
return;
}
*/
/**********************
** display_out_wts() **
***********************
** Display the weights on the output layer neurodes
** NOTE: This code is not used in the benchmark
** test -- RG
*/
/* void display_out_wts()
{
int neurode, weight;
fprintf(outfile,"\n Weights of Output Layer neurodes:");
for (neurode=0; neurode<OUT_SIZE; neurode++)
{
fprintf(outfile,"\n Out Neurode # %d \n",neurode);
for (weight=0; weight<MID_SIZE; weight++)
{
fprintf(outfile," %8.3f ", out_wts[neurode,weight]);
}
}
return;
}
*/
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector128/ConvertToDouble.UInt64.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void ConvertToDoubleUInt64()
{
var test = new VectorUnaryOpTest__ConvertToDoubleUInt64();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__ConvertToDoubleUInt64
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, Double[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Double>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__ConvertToDoubleUInt64 testClass)
{
var result = Vector128.ConvertToDouble(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static Vector128<UInt64> _clsVar1;
private Vector128<UInt64> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__ConvertToDoubleUInt64()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
}
public VectorUnaryOpTest__ConvertToDoubleUInt64()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
_dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.ConvertToDouble(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.ConvertToDouble), new Type[] {
typeof(Vector128<UInt64>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.ConvertToDouble), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Double));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Double>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.ConvertToDouble(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var result = Vector128.ConvertToDouble(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__ConvertToDoubleUInt64();
var result = Vector128.ConvertToDouble(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.ConvertToDouble(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.ConvertToDouble(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt64> op1, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Double[] outArray = new Double[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Double[] outArray = new Double[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (double)(firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (double)(firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.ConvertToDouble)}<Double>(Vector128<UInt64>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void ConvertToDoubleUInt64()
{
var test = new VectorUnaryOpTest__ConvertToDoubleUInt64();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__ConvertToDoubleUInt64
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, Double[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Double>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__ConvertToDoubleUInt64 testClass)
{
var result = Vector128.ConvertToDouble(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static Vector128<UInt64> _clsVar1;
private Vector128<UInt64> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__ConvertToDoubleUInt64()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
}
public VectorUnaryOpTest__ConvertToDoubleUInt64()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = Math.Min(long.MaxValue, TestLibrary.Generator.GetUInt64()); }
_dataTable = new DataTable(_data1, new Double[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.ConvertToDouble(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.ConvertToDouble), new Type[] {
typeof(Vector128<UInt64>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.ConvertToDouble), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Double));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Double>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.ConvertToDouble(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var result = Vector128.ConvertToDouble(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__ConvertToDoubleUInt64();
var result = Vector128.ConvertToDouble(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.ConvertToDouble(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.ConvertToDouble(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt64> op1, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Double[] outArray = new Double[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Double[] outArray = new Double[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt64[] firstOp, Double[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (double)(firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (double)(firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.ConvertToDouble)}<Double>(Vector128<UInt64>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Directed/nullabletypes/isinstvaluetype_d.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="isinstvaluetype.cs" />
<Compile Include="Desktop\StructDefinitions.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="isinstvaluetype.cs" />
<Compile Include="Desktop\StructDefinitions.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Methodical/structs/ExplicitLayout.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="ExplicitLayout.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="ExplicitLayout.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AddSaturate.Vector128.UInt64.Vector128.Int64.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AddSaturate_Vector128_UInt64_Vector128_Int64()
{
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, Int64[] inArray2, UInt64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int64>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int64, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public Vector128<Int64> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref testStruct._fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64 testClass)
{
var result = AdvSimd.Arm64.AddSaturate(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64 testClass)
{
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<Int64>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static Int64[] _data2 = new Int64[Op2ElementCount];
private static Vector128<UInt64> _clsVar1;
private static Vector128<Int64> _clsVar2;
private Vector128<UInt64> _fld1;
private Vector128<Int64> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _clsVar2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
}
public SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
_dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.AddSaturate(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddSaturate), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<Int64>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddSaturate), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<Int64>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.AddSaturate(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1)
fixed (Vector128<Int64>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pClsVar1)),
AdvSimd.LoadVector128((Int64*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr);
var result = AdvSimd.Arm64.AddSaturate(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr));
var result = AdvSimd.Arm64.AddSaturate(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
var result = AdvSimd.Arm64.AddSaturate(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
fixed (Vector128<UInt64>* pFld1 = &test._fld1)
fixed (Vector128<Int64>* pFld2 = &test._fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.AddSaturate(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<Int64>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddSaturate(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(&test._fld1)),
AdvSimd.LoadVector128((Int64*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt64> op1, Vector128<Int64> op2, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Int64[] inArray2 = new Int64[Op2ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Int64[] inArray2 = new Int64[Op2ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt64[] left, Int64[] right, UInt64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.AddSaturate(left[i], right[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddSaturate)}<UInt64>(Vector128<UInt64>, Vector128<Int64>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AddSaturate_Vector128_UInt64_Vector128_Int64()
{
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, Int64[] inArray2, UInt64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int64>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int64, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public Vector128<Int64> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref testStruct._fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64 testClass)
{
var result = AdvSimd.Arm64.AddSaturate(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64 testClass)
{
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<Int64>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static Int64[] _data2 = new Int64[Op2ElementCount];
private static Vector128<UInt64> _clsVar1;
private static Vector128<Int64> _clsVar2;
private Vector128<UInt64> _fld1;
private Vector128<Int64> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _clsVar2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
}
public SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
_dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.AddSaturate(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddSaturate), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<Int64>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddSaturate), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<Int64>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.AddSaturate(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1)
fixed (Vector128<Int64>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pClsVar1)),
AdvSimd.LoadVector128((Int64*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr);
var result = AdvSimd.Arm64.AddSaturate(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr));
var result = AdvSimd.Arm64.AddSaturate(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
var result = AdvSimd.Arm64.AddSaturate(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__AddSaturate_Vector128_UInt64_Vector128_Int64();
fixed (Vector128<UInt64>* pFld1 = &test._fld1)
fixed (Vector128<Int64>* pFld2 = &test._fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.AddSaturate(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<Int64>* pFld2 = &_fld2)
{
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((Int64*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddSaturate(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddSaturate(
AdvSimd.LoadVector128((UInt64*)(&test._fld1)),
AdvSimd.LoadVector128((Int64*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt64> op1, Vector128<Int64> op2, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Int64[] inArray2 = new Int64[Op2ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
Int64[] inArray2 = new Int64[Op2ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt64[] left, Int64[] right, UInt64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.AddSaturate(left[i], right[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddSaturate)}<UInt64>(Vector128<UInt64>, Vector128<Int64>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using System.Text;
namespace System
{
public partial class String
{
private const int StackallocIntBufferSizeLimit = 128;
private static void FillStringChecked(string dest, int destPos, string src)
{
Debug.Assert(dest != null);
Debug.Assert(src != null);
if (src.Length > dest.Length - destPos)
{
throw new IndexOutOfRangeException();
}
Buffer.Memmove(
destination: ref Unsafe.Add(ref dest._firstChar, destPos),
source: ref src._firstChar,
elementCount: (uint)src.Length);
}
public static string Concat(object? arg0) =>
arg0?.ToString() ?? Empty;
public static string Concat(object? arg0, object? arg1) =>
Concat(arg0?.ToString(), arg1?.ToString());
public static string Concat(object? arg0, object? arg1, object? arg2) =>
Concat(arg0?.ToString(), arg1?.ToString(), arg2?.ToString());
public static string Concat(params object?[] args!!)
{
if (args.Length <= 1)
{
return args.Length == 0 ?
string.Empty :
args[0]?.ToString() ?? string.Empty;
}
// We need to get an intermediary string array
// to fill with each of the args' ToString(),
// and then just concat that in one operation.
// This way we avoid any intermediary string representations,
// or buffer resizing if we use StringBuilder (although the
// latter case is partially alleviated due to StringBuilder's
// linked-list style implementation)
var strings = new string[args.Length];
int totalLength = 0;
for (int i = 0; i < args.Length; i++)
{
object? value = args[i];
string toString = value?.ToString() ?? string.Empty; // We need to handle both the cases when value or value.ToString() is null
strings[i] = toString;
totalLength += toString.Length;
if (totalLength < 0) // Check for a positive overflow
{
throw new OutOfMemoryException();
}
}
// If all of the ToStrings are null/empty, just return string.Empty
if (totalLength == 0)
{
return string.Empty;
}
string result = FastAllocateString(totalLength);
int position = 0; // How many characters we've copied so far
for (int i = 0; i < strings.Length; i++)
{
string s = strings[i];
Debug.Assert(s != null);
Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!");
FillStringChecked(result, position, s);
position += s.Length;
}
return result;
}
public static string Concat<T>(IEnumerable<T> values!!)
{
if (typeof(T) == typeof(char))
{
// Special-case T==char, as we can handle that case much more efficiently,
// and string.Concat(IEnumerable<char>) can be used as an efficient
// enumerable-based equivalent of new string(char[]).
using (IEnumerator<char> en = Unsafe.As<IEnumerable<char>>(values).GetEnumerator())
{
if (!en.MoveNext())
{
// There weren't any chars. Return the empty string.
return Empty;
}
char c = en.Current; // save the first char
if (!en.MoveNext())
{
// There was only one char. Return a string from it directly.
return CreateFromChar(c);
}
// Create the StringBuilder, add the chars we've already enumerated,
// add the rest, and then get the resulting string.
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(c); // first value
do
{
c = en.Current;
result.Append(c);
}
while (en.MoveNext());
return result.ToString();
}
}
else
{
using (IEnumerator<T> en = values.GetEnumerator())
{
if (!en.MoveNext())
return string.Empty;
// We called MoveNext once, so this will be the first item
T currentValue = en.Current;
// Call ToString before calling MoveNext again, since
// we want to stay consistent with the below loop
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
{
// We have to handle the case of either currentValue
// or its ToString being null
return firstString ?? string.Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
do
{
currentValue = en.Current;
if (currentValue != null)
{
result.Append(currentValue.ToString());
}
}
while (en.MoveNext());
return result.ToString();
}
}
}
public static string Concat(IEnumerable<string?> values!!)
{
using (IEnumerator<string?> en = values.GetEnumerator())
{
if (!en.MoveNext())
return string.Empty;
string? firstValue = en.Current;
if (!en.MoveNext())
{
return firstValue ?? string.Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstValue);
do
{
result.Append(en.Current);
}
while (en.MoveNext());
return result.ToString();
}
}
public static string Concat(string? str0, string? str1)
{
if (IsNullOrEmpty(str0))
{
if (IsNullOrEmpty(str1))
{
return string.Empty;
}
return str1;
}
if (IsNullOrEmpty(str1))
{
return str0;
}
int str0Length = str0.Length;
string result = FastAllocateString(str0Length + str1.Length);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0Length, str1);
return result;
}
public static string Concat(string? str0, string? str1, string? str2)
{
if (IsNullOrEmpty(str0))
{
return Concat(str1, str2);
}
if (IsNullOrEmpty(str1))
{
return Concat(str0, str2);
}
if (IsNullOrEmpty(str2))
{
return Concat(str0, str1);
}
int totalLength = str0.Length + str1.Length + str2.Length;
string result = FastAllocateString(totalLength);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0.Length, str1);
FillStringChecked(result, str0.Length + str1.Length, str2);
return result;
}
public static string Concat(string? str0, string? str1, string? str2, string? str3)
{
if (IsNullOrEmpty(str0))
{
return Concat(str1, str2, str3);
}
if (IsNullOrEmpty(str1))
{
return Concat(str0, str2, str3);
}
if (IsNullOrEmpty(str2))
{
return Concat(str0, str1, str3);
}
if (IsNullOrEmpty(str3))
{
return Concat(str0, str1, str2);
}
int totalLength = str0.Length + str1.Length + str2.Length + str3.Length;
string result = FastAllocateString(totalLength);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0.Length, str1);
FillStringChecked(result, str0.Length + str1.Length, str2);
FillStringChecked(result, str0.Length + str1.Length + str2.Length, str3);
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1)
{
int length = checked(str0.Length + str1.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
str1.CopyTo(resultSpan.Slice(str0.Length));
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2)
{
int length = checked(str0.Length + str1.Length + str2.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str0.Length);
str1.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str1.Length);
str2.CopyTo(resultSpan);
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2, ReadOnlySpan<char> str3)
{
int length = checked(str0.Length + str1.Length + str2.Length + str3.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str0.Length);
str1.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str1.Length);
str2.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str2.Length);
str3.CopyTo(resultSpan);
return result;
}
public static string Concat(params string?[] values!!)
{
if (values.Length <= 1)
{
return values.Length == 0 ?
string.Empty :
values[0] ?? string.Empty;
}
// It's possible that the input values array could be changed concurrently on another
// thread, such that we can't trust that each read of values[i] will be equivalent.
// Worst case, we can make a defensive copy of the array and use that, but we first
// optimistically try the allocation and copies assuming that the array isn't changing,
// which represents the 99.999% case, in particular since string.Concat is used for
// string concatenation by the languages, with the input array being a params array.
// Sum the lengths of all input strings
long totalLengthLong = 0;
for (int i = 0; i < values.Length; i++)
{
string? value = values[i];
if (value != null)
{
totalLengthLong += value.Length;
}
}
// If it's too long, fail, or if it's empty, return an empty string.
if (totalLengthLong > int.MaxValue)
{
throw new OutOfMemoryException();
}
int totalLength = (int)totalLengthLong;
if (totalLength == 0)
{
return string.Empty;
}
// Allocate a new string and copy each input string into it
string result = FastAllocateString(totalLength);
int copiedLength = 0;
for (int i = 0; i < values.Length; i++)
{
string? value = values[i];
if (!string.IsNullOrEmpty(value))
{
int valueLen = value.Length;
if (valueLen > totalLength - copiedLength)
{
copiedLength = -1;
break;
}
FillStringChecked(result, copiedLength, value);
copiedLength += valueLen;
}
}
// If we copied exactly the right amount, return the new string. Otherwise,
// something changed concurrently to mutate the input array: fall back to
// doing the concatenation again, but this time with a defensive copy. This
// fall back should be extremely rare.
return copiedLength == totalLength ? result : Concat((string?[])values.Clone());
}
public static string Format(string format, object? arg0)
{
return FormatHelper(null, format, new ParamsArray(arg0));
}
public static string Format(string format, object? arg0, object? arg1)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1));
}
public static string Format(string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1, arg2));
}
public static string Format(string format, params object?[] args)
{
if (args is null)
{
// To preserve the original exception behavior, throw an exception about format if both
// args and format are null. The actual null check for format is in FormatHelper.
ArgumentNullException.Throw(format is null ? nameof(format) : nameof(args));
}
return FormatHelper(null, format, new ParamsArray(args));
}
public static string Format(IFormatProvider? provider, string format, object? arg0)
{
return FormatHelper(provider, format, new ParamsArray(arg0));
}
public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1));
}
public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1, arg2));
}
public static string Format(IFormatProvider? provider, string format, params object?[] args)
{
if (args is null)
{
// To preserve the original exception behavior, throw an exception about format if both
// args and format are null. The actual null check for format is in FormatHelper.
ArgumentNullException.Throw(format is null ? nameof(format) : nameof(args));
}
return FormatHelper(provider, format, new ParamsArray(args));
}
private static string FormatHelper(IFormatProvider? provider, string format!!, ParamsArray args)
{
var sb = new ValueStringBuilder(stackalloc char[256]);
sb.EnsureCapacity(format.Length + args.Length * 8);
sb.AppendFormatHelper(provider, format, args);
return sb.ToString();
}
public string Insert(int startIndex, string value!!)
{
if ((uint)startIndex > Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
int oldLength = Length;
int insertLength = value.Length;
if (oldLength == 0)
return value;
if (insertLength == 0)
return this;
// In case this computation overflows, newLength will be negative and FastAllocateString throws OutOfMemoryException
int newLength = oldLength + insertLength;
string result = FastAllocateString(newLength);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex));
return result;
}
public static string Join(char separator, params string?[] value)
{
if (value == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
}
return JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), new ReadOnlySpan<string?>(value));
}
public static string Join(string? separator, params string?[] value)
{
if (value == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
}
return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(value));
}
public static string Join(char separator, string?[] value, int startIndex, int count) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), value, startIndex, count);
public static string Join(string? separator, string?[] value, int startIndex, int count) =>
JoinCore(separator.AsSpan(), value, startIndex, count);
private static string JoinCore(ReadOnlySpan<char> separator, string?[] value!!, int startIndex, int count)
{
if (startIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
}
if (startIndex > value.Length - count)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_IndexCountBuffer);
}
return JoinCore(separator, new ReadOnlySpan<string?>(value, startIndex, count));
}
public static string Join(string? separator, IEnumerable<string?> values)
{
if (values is List<string?> valuesList)
{
return JoinCore(separator.AsSpan(), CollectionsMarshal.AsSpan(valuesList));
}
if (values is string?[] valuesArray)
{
return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(valuesArray));
}
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
using (IEnumerator<string?> en = values.GetEnumerator())
{
if (!en.MoveNext())
{
return Empty;
}
string? firstValue = en.Current;
if (!en.MoveNext())
{
// Only one value available
return firstValue ?? Empty;
}
// Null separator and values are handled by the StringBuilder
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstValue);
do
{
result.Append(separator);
result.Append(en.Current);
}
while (en.MoveNext());
return result.ToString();
}
}
public static string Join(char separator, params object?[] values) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), values);
public static string Join(string? separator, params object?[] values) =>
JoinCore(separator.AsSpan(), values);
private static string JoinCore(ReadOnlySpan<char> separator, object?[] values)
{
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
if (values.Length == 0)
{
return Empty;
}
string? firstString = values[0]?.ToString();
if (values.Length == 1)
{
return firstString ?? Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
for (int i = 1; i < values.Length; i++)
{
result.Append(separator);
object? value = values[i];
if (value != null)
{
result.Append(value.ToString());
}
}
return result.ToString();
}
public static string Join<T>(char separator, IEnumerable<T> values) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), values);
public static string Join<T>(string? separator, IEnumerable<T> values) =>
JoinCore(separator.AsSpan(), values);
private static string JoinCore<T>(ReadOnlySpan<char> separator, IEnumerable<T> values)
{
if (typeof(T) == typeof(string))
{
if (values is List<string?> valuesList)
{
return JoinCore(separator, CollectionsMarshal.AsSpan(valuesList));
}
if (values is string?[] valuesArray)
{
return JoinCore(separator, new ReadOnlySpan<string?>(valuesArray));
}
}
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
using (IEnumerator<T> en = values.GetEnumerator())
{
if (!en.MoveNext())
{
return Empty;
}
// We called MoveNext once, so this will be the first item
T currentValue = en.Current;
// Call ToString before calling MoveNext again, since
// we want to stay consistent with the below loop
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
{
// We have to handle the case of either currentValue
// or its ToString being null
return firstString ?? Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
do
{
currentValue = en.Current;
result.Append(separator);
if (currentValue != null)
{
result.Append(currentValue.ToString());
}
}
while (en.MoveNext());
return result.ToString();
}
}
private static string JoinCore(ReadOnlySpan<char> separator, ReadOnlySpan<string?> values)
{
if (values.Length <= 1)
{
return values.IsEmpty ?
Empty :
values[0] ?? Empty;
}
long totalSeparatorsLength = (long)(values.Length - 1) * separator.Length;
if (totalSeparatorsLength > int.MaxValue)
{
ThrowHelper.ThrowOutOfMemoryException();
}
int totalLength = (int)totalSeparatorsLength;
// Calculate the length of the resultant string so we know how much space to allocate.
foreach (string? value in values)
{
if (value != null)
{
totalLength += value.Length;
if (totalLength < 0) // Check for overflow
{
ThrowHelper.ThrowOutOfMemoryException();
}
}
}
// Copy each of the strings into the result buffer, interleaving with the separator.
string result = FastAllocateString(totalLength);
int copiedLength = 0;
for (int i = 0; i < values.Length; i++)
{
// It's possible that another thread may have mutated the input array
// such that our second read of an index will not be the same string
// we got during the first read.
// We range check again to avoid buffer overflows if this happens.
if (values[i] is string value)
{
int valueLen = value.Length;
if (valueLen > totalLength - copiedLength)
{
copiedLength = -1;
break;
}
// Fill in the value.
FillStringChecked(result, copiedLength, value);
copiedLength += valueLen;
}
if (i < values.Length - 1)
{
// Fill in the separator.
// Special-case length 1 to avoid additional overheads of CopyTo.
// This is common due to the char separator overload.
ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength);
if (separator.Length == 1)
{
dest = separator[0];
}
else
{
separator.CopyTo(new Span<char>(ref dest, separator.Length));
}
copiedLength += separator.Length;
}
}
// If we copied exactly the right amount, return the new string. Otherwise,
// something changed concurrently to mutate the input array: fall back to
// doing the concatenation again, but this time with a defensive copy. This
// fall back should be extremely rare.
return copiedLength == totalLength ?
result :
JoinCore(separator, values.ToArray().AsSpan());
}
public string PadLeft(int totalWidth) => PadLeft(totalWidth, ' ');
public string PadLeft(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
return this;
string result = FastAllocateString(totalWidth);
new Span<char>(ref result._firstChar, count).Fill(paddingChar);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength);
return result;
}
public string PadRight(int totalWidth) => PadRight(totalWidth, ' ');
public string PadRight(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
return this;
string result = FastAllocateString(totalWidth);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)oldLength);
new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar);
return result;
}
public string Remove(int startIndex, int count)
{
if (startIndex < 0)
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
int oldLength = this.Length;
if (count > oldLength - startIndex)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_IndexCount);
if (count == 0)
return this;
int newLength = oldLength - count;
if (newLength == 0)
return Empty;
string result = FastAllocateString(newLength);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex));
return result;
}
// a remove that just takes a startindex.
public string Remove(int startIndex)
{
if ((uint)startIndex > Length)
throw new ArgumentOutOfRangeException(nameof(startIndex), startIndex < 0 ? SR.ArgumentOutOfRange_StartIndex : SR.ArgumentOutOfRange_StartIndexLargerThanLength);
return Substring(0, startIndex);
}
public string Replace(string oldValue, string? newValue, bool ignoreCase, CultureInfo? culture)
{
return ReplaceCore(oldValue, newValue, culture?.CompareInfo, ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None);
}
public string Replace(string oldValue, string? newValue, StringComparison comparisonType)
{
switch (comparisonType)
{
case StringComparison.CurrentCulture:
case StringComparison.CurrentCultureIgnoreCase:
return ReplaceCore(oldValue, newValue, CultureInfo.CurrentCulture.CompareInfo, GetCaseCompareOfComparisonCulture(comparisonType));
case StringComparison.InvariantCulture:
case StringComparison.InvariantCultureIgnoreCase:
return ReplaceCore(oldValue, newValue, CompareInfo.Invariant, GetCaseCompareOfComparisonCulture(comparisonType));
case StringComparison.Ordinal:
return Replace(oldValue, newValue);
case StringComparison.OrdinalIgnoreCase:
return ReplaceCore(oldValue, newValue, CompareInfo.Invariant, CompareOptions.OrdinalIgnoreCase);
default:
throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
private string ReplaceCore(string oldValue, string? newValue, CompareInfo? ci, CompareOptions options)
{
ArgumentException.ThrowIfNullOrEmpty(oldValue);
// If they asked to replace oldValue with a null, replace all occurrences
// with the empty string. AsSpan() will normalize appropriately.
//
// If inner ReplaceCore method returns null, it means no substitutions were
// performed, so as an optimization we'll return the original string.
return ReplaceCore(this, oldValue.AsSpan(), newValue.AsSpan(), ci ?? CultureInfo.CurrentCulture.CompareInfo, options)
?? this;
}
private static string? ReplaceCore(ReadOnlySpan<char> searchSpace, ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue, CompareInfo compareInfo, CompareOptions options)
{
Debug.Assert(!oldValue.IsEmpty);
Debug.Assert(compareInfo != null);
var result = new ValueStringBuilder(stackalloc char[256]);
result.EnsureCapacity(searchSpace.Length);
bool hasDoneAnyReplacements = false;
while (true)
{
int index = compareInfo.IndexOf(searchSpace, oldValue, options, out int matchLength);
// There's the possibility that 'oldValue' has zero collation weight (empty string equivalent).
// If this is the case, we behave as if there are no more substitutions to be made.
if (index < 0 || matchLength == 0)
{
break;
}
// append the unmodified portion of search space
result.Append(searchSpace.Slice(0, index));
// append the replacement
result.Append(newValue);
searchSpace = searchSpace.Slice(index + matchLength);
hasDoneAnyReplacements = true;
}
// Didn't find 'oldValue' in the remaining search space, or the match
// consisted only of zero collation weight characters. As an optimization,
// if we have not yet performed any replacements, we'll save the
// allocation.
if (!hasDoneAnyReplacements)
{
result.Dispose();
return null;
}
// Append what remains of the search space, then allocate the new string.
result.Append(searchSpace);
return result.ToString();
}
// Replaces all instances of oldChar with newChar.
//
public string Replace(char oldChar, char newChar)
{
if (oldChar == newChar)
return this;
int firstIndex = IndexOf(oldChar);
if (firstIndex < 0)
return this;
int remainingLength = Length - firstIndex;
string result = FastAllocateString(Length);
int copyLength = firstIndex;
// Copy the characters already proven not to match.
if (copyLength > 0)
{
Buffer.Memmove(ref result._firstChar, ref _firstChar, (uint)copyLength);
}
// Copy the remaining characters, doing the replacement as we go.
ref ushort pSrc = ref Unsafe.Add(ref Unsafe.As<char, ushort>(ref _firstChar), copyLength);
ref ushort pDst = ref Unsafe.Add(ref Unsafe.As<char, ushort>(ref result._firstChar), copyLength);
if (Vector.IsHardwareAccelerated && remainingLength >= Vector<ushort>.Count)
{
Vector<ushort> oldChars = new Vector<ushort>(oldChar);
Vector<ushort> newChars = new Vector<ushort>(newChar);
do
{
Vector<ushort> original = Unsafe.ReadUnaligned<Vector<ushort>>(ref Unsafe.As<ushort, byte>(ref pSrc));
Vector<ushort> equals = Vector.Equals(original, oldChars);
Vector<ushort> results = Vector.ConditionalSelect(equals, newChars, original);
Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref pDst), results);
pSrc = ref Unsafe.Add(ref pSrc, Vector<ushort>.Count);
pDst = ref Unsafe.Add(ref pDst, Vector<ushort>.Count);
remainingLength -= Vector<ushort>.Count;
}
while (remainingLength >= Vector<ushort>.Count);
}
for (; remainingLength > 0; remainingLength--)
{
ushort currentChar = pSrc;
pDst = currentChar == oldChar ? newChar : currentChar;
pSrc = ref Unsafe.Add(ref pSrc, 1);
pDst = ref Unsafe.Add(ref pDst, 1);
}
return result;
}
public string Replace(string oldValue, string? newValue)
{
ArgumentException.ThrowIfNullOrEmpty(oldValue);
// If newValue is null, treat it as an empty string. Callers use this to remove the oldValue.
newValue ??= Empty;
// Track the locations of oldValue to be replaced.
var replacementIndices = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
if (oldValue.Length == 1)
{
// Special-case oldValues that are a single character. Even though there's an overload that takes
// a single character, its newValue is also a single character, so this overload ends up being used
// often to remove characters by having an empty newValue.
if (newValue.Length == 1)
{
// With both the oldValue and newValue being a single character, it's cheaper to just use the other overload.
return Replace(oldValue[0], newValue[0]);
}
// Find all occurrences of the oldValue character.
char c = oldValue[0];
int i = 0;
while (true)
{
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
if (pos < 0)
{
break;
}
replacementIndices.Append(i + pos);
i += pos + 1;
}
}
else
{
// Find all occurrences of the oldValue string.
int i = 0;
while (true)
{
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length);
if (pos < 0)
{
break;
}
replacementIndices.Append(i + pos);
i += pos + oldValue.Length;
}
}
// If the oldValue wasn't found, just return the original string.
if (replacementIndices.Length == 0)
{
return this;
}
// Perform the replacement. String allocation and copying is in separate method to make this method faster
// for the case where nothing needs replacing.
string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsSpan());
replacementIndices.Dispose();
return dst;
}
private string ReplaceHelper(int oldValueLength, string newValue, ReadOnlySpan<int> indices)
{
Debug.Assert(indices.Length > 0);
long dstLength = this.Length + ((long)(newValue.Length - oldValueLength)) * indices.Length;
if (dstLength > int.MaxValue)
throw new OutOfMemoryException();
string dst = FastAllocateString((int)dstLength);
Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
int thisIdx = 0;
int dstIdx = 0;
for (int r = 0; r < indices.Length; r++)
{
int replacementIdx = indices[r];
// Copy over the non-matching portion of the original that precedes this occurrence of oldValue.
int count = replacementIdx - thisIdx;
if (count != 0)
{
this.AsSpan(thisIdx, count).CopyTo(dstSpan.Slice(dstIdx));
dstIdx += count;
}
thisIdx = replacementIdx + oldValueLength;
// Copy over newValue to replace the oldValue.
newValue.CopyTo(dstSpan.Slice(dstIdx));
dstIdx += newValue.Length;
}
// Copy over the final non-matching portion at the end of the string.
Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
this.AsSpan(thisIdx).CopyTo(dstSpan.Slice(dstIdx));
return dst;
}
/// <summary>
/// Replaces all newline sequences in the current string with <see cref="Environment.NewLine"/>.
/// </summary>
/// <returns>
/// A string whose contents match the current string, but with all newline sequences replaced
/// with <see cref="Environment.NewLine"/>.
/// </returns>
/// <remarks>
/// This method searches for all newline sequences within the string and canonicalizes them to match
/// the newline sequence for the current environment. For example, when running on Windows, all
/// occurrences of non-Windows newline sequences will be replaced with the sequence CRLF. When
/// running on Unix, all occurrences of non-Unix newline sequences will be replaced with
/// a single LF character.
///
/// It is not recommended that protocol parsers utilize this API. Protocol specifications often
/// mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
/// line, status line, and headers lines end with CRLF. Since this API operates over a wide range
/// of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
/// by the protocol's authors.
///
/// This overload is equivalent to calling <see cref="ReplaceLineEndings(string)"/>, passing
/// <see cref="Environment.NewLine"/> as the <em>replacementText</em> parameter.
///
/// This method is guaranteed O(n) complexity, where <em>n</em> is the length of the input string.
/// </remarks>
public string ReplaceLineEndings() => ReplaceLineEndings(Environment.NewLineConst);
/// <summary>
/// Replaces all newline sequences in the current string with <paramref name="replacementText"/>.
/// </summary>
/// <returns>
/// A string whose contents match the current string, but with all newline sequences replaced
/// with <paramref name="replacementText"/>.
/// </returns>
/// <remarks>
/// This method searches for all newline sequences within the string and canonicalizes them to the
/// newline sequence provided by <paramref name="replacementText"/>. If <paramref name="replacementText"/>
/// is <see cref="string.Empty"/>, all newline sequences within the string will be removed.
///
/// It is not recommended that protocol parsers utilize this API. Protocol specifications often
/// mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
/// line, status line, and headers lines end with CRLF. Since this API operates over a wide range
/// of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
/// by the protocol's authors.
///
/// The list of recognized newline sequences is CR (U+000D), LF (U+000A), CRLF (U+000D U+000A),
/// NEL (U+0085), LS (U+2028), FF (U+000C), and PS (U+2029). This list is given by the Unicode
/// Standard, Sec. 5.8, Recommendation R4 and Table 5-2.
///
/// This method is guaranteed O(n * r) complexity, where <em>n</em> is the length of the input string,
/// and where <em>r</em> is the length of <paramref name="replacementText"/>.
/// </remarks>
public string ReplaceLineEndings(string replacementText!!)
{
// Early-exit: do we need to do anything at all?
// If not, return this string as-is.
int idxOfFirstNewlineChar = IndexOfNewlineChar(this, out int stride);
if (idxOfFirstNewlineChar < 0)
{
return this;
}
// While writing to the builder, we don't bother memcpying the first
// or the last segment into the builder. We'll use the builder only
// for the intermediate segments, then we'll sandwich everything together
// with one final string.Concat call.
ReadOnlySpan<char> firstSegment = this.AsSpan(0, idxOfFirstNewlineChar);
ReadOnlySpan<char> remaining = this.AsSpan(idxOfFirstNewlineChar + stride);
ValueStringBuilder builder = new ValueStringBuilder(stackalloc char[256]);
while (true)
{
int idx = IndexOfNewlineChar(remaining, out stride);
if (idx < 0) { break; } // no more newline chars
builder.Append(replacementText);
builder.Append(remaining.Slice(0, idx));
remaining = remaining.Slice(idx + stride);
}
string retVal = Concat(firstSegment, builder.AsSpan(), replacementText, remaining);
builder.Dispose();
return retVal;
}
// Scans the input text, returning the index of the first newline char.
// Newline chars are given by the Unicode Standard, Sec. 5.8.
internal static int IndexOfNewlineChar(ReadOnlySpan<char> text, out int stride)
{
// !! IMPORTANT !!
//
// We expect this method may be called with untrusted input, which means we need to
// bound the worst-case runtime of this method. We rely on MemoryExtensions.IndexOfAny
// having worst-case runtime O(i), where i is the index of the first needle match within
// the haystack; or O(n) if no needle is found. This ensures that in the common case
// of this method being called within a loop, the worst-case runtime is O(n) rather than
// O(n^2), where n is the length of the input text.
//
// The Unicode Standard, Sec. 5.8, Recommendation R4 and Table 5-2 state that the CR, LF,
// CRLF, NEL, LS, FF, and PS sequences are considered newline functions. That section
// also specifically excludes VT from the list of newline functions, so we do not include
// it in the needle list.
const string needles = "\r\n\f\u0085\u2028\u2029";
stride = default;
int idx = text.IndexOfAny(needles);
if ((uint)idx < (uint)text.Length)
{
stride = 1; // needle found
// Did we match CR? If so, and if it's followed by LF, then we need
// to consume both chars as a single newline function match.
if (text[idx] == '\r')
{
int nextCharIdx = idx + 1;
if ((uint)nextCharIdx < (uint)text.Length && text[nextCharIdx] == '\n')
{
stride = 2;
}
}
}
return idx;
}
public string[] Split(char separator, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(new ReadOnlySpan<char>(ref separator, 1), int.MaxValue, options);
}
public string[] Split(char separator, int count, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(new ReadOnlySpan<char>(ref separator, 1), count, options);
}
// Creates an array of strings by splitting this string at each
// occurrence of a separator. The separator is searched for, and if found,
// the substring preceding the occurrence is stored as the first element in
// the array of strings. We then continue in this manner by searching
// the substring that follows the occurrence. On the other hand, if the separator
// is not found, the array of strings will contain this instance as its only element.
// If the separator is null
// whitespace (i.e., Character.IsWhitespace) is used as the separator.
//
public string[] Split(params char[]? separator)
{
return SplitInternal(separator, int.MaxValue, StringSplitOptions.None);
}
// Creates an array of strings by splitting this string at each
// occurrence of a separator. The separator is searched for, and if found,
// the substring preceding the occurrence is stored as the first element in
// the array of strings. We then continue in this manner by searching
// the substring that follows the occurrence. On the other hand, if the separator
// is not found, the array of strings will contain this instance as its only element.
// If the separator is the empty string (i.e., string.Empty), then
// whitespace (i.e., Character.IsWhitespace) is used as the separator.
// If there are more than count different strings, the last n-(count-1)
// elements are concatenated and added as the last string.
//
public string[] Split(char[]? separator, int count)
{
return SplitInternal(separator, count, StringSplitOptions.None);
}
public string[] Split(char[]? separator, StringSplitOptions options)
{
return SplitInternal(separator, int.MaxValue, options);
}
public string[] Split(char[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(separator, count, options);
}
private string[] SplitInternal(ReadOnlySpan<char> separators, int count, StringSplitOptions options)
{
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
SR.ArgumentOutOfRange_NegativeCount);
CheckStringSplitOptions(options);
ShortCircuit:
if (count <= 1 || Length == 0)
{
// Per the method's documentation, we'll short-circuit the search for separators.
// But we still need to post-process the results based on the caller-provided flags.
string candidate = this;
if (((options & StringSplitOptions.TrimEntries) != 0) && (count > 0))
{
candidate = candidate.Trim();
}
if (((options & StringSplitOptions.RemoveEmptyEntries) != 0) && (candidate.Length == 0))
{
count = 0;
}
return (count == 0) ? Array.Empty<string>() : new string[] { candidate };
}
if (separators.IsEmpty)
{
// Caller is already splitting on whitespace; no need for separate trim step
options &= ~StringSplitOptions.TrimEntries;
}
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separators, ref sepListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
// Handle the special case of no replaces.
if (sepList.Length == 0)
{
count = 1;
goto ShortCircuit;
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, default, 1, count, options)
: SplitWithoutPostProcessing(sepList, default, 1, count);
sepListBuilder.Dispose();
return result;
}
public string[] Split(string? separator, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, int.MaxValue, options);
}
public string[] Split(string? separator, int count, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, count, options);
}
public string[] Split(string[]? separator, StringSplitOptions options)
{
return SplitInternal(null, separator, int.MaxValue, options);
}
public string[] Split(string[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(null, separator, count, options);
}
private string[] SplitInternal(string? separator, string?[]? separators, int count, StringSplitOptions options)
{
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count),
SR.ArgumentOutOfRange_NegativeCount);
}
CheckStringSplitOptions(options);
bool singleSeparator = separator != null;
if (!singleSeparator && (separators == null || separators.Length == 0))
{
// split on whitespace
return SplitInternal(default(ReadOnlySpan<char>), count, options);
}
ShortCircuit:
if (count <= 1 || Length == 0)
{
// Per the method's documentation, we'll short-circuit the search for separators.
// But we still need to post-process the results based on the caller-provided flags.
string candidate = this;
if (((options & StringSplitOptions.TrimEntries) != 0) && (count > 0))
{
candidate = candidate.Trim();
}
if (((options & StringSplitOptions.RemoveEmptyEntries) != 0) && (candidate.Length == 0))
{
count = 0;
}
return (count == 0) ? Array.Empty<string>() : new string[] { candidate };
}
if (singleSeparator)
{
if (separator!.Length == 0)
{
count = 1;
goto ShortCircuit;
}
else
{
return SplitInternal(separator, count, options);
}
}
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
var lengthListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separators!, ref sepListBuilder, ref lengthListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
ReadOnlySpan<int> lengthList = lengthListBuilder.AsSpan();
// Handle the special case of no replaces.
if (sepList.Length == 0)
{
return new string[] { this };
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, lengthList, 0, count, options)
: SplitWithoutPostProcessing(sepList, lengthList, 0, count);
sepListBuilder.Dispose();
lengthListBuilder.Dispose();
return result;
}
private string[] SplitInternal(string separator, int count, StringSplitOptions options)
{
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separator, ref sepListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
if (sepList.Length == 0)
{
// there are no separators so sepListBuilder did not rent an array from pool and there is no need to dispose it
string candidate = this;
if ((options & StringSplitOptions.TrimEntries) != 0)
{
candidate = candidate.Trim();
}
return ((candidate.Length == 0) && ((options & StringSplitOptions.RemoveEmptyEntries) != 0))
? Array.Empty<string>()
: new string[] { candidate };
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, default, separator.Length, count, options)
: SplitWithoutPostProcessing(sepList, default, separator.Length, count);
sepListBuilder.Dispose();
return result;
}
// This function will not trim entries or special-case empty entries
private string[] SplitWithoutPostProcessing(ReadOnlySpan<int> sepList, ReadOnlySpan<int> lengthList, int defaultLength, int count)
{
Debug.Assert(count >= 2);
int currIndex = 0;
int arrIndex = 0;
count--;
int numActualReplaces = (sepList.Length < count) ? sepList.Length : count;
// Allocate space for the new array.
// +1 for the string from the end of the last replace to the end of the string.
string[] splitStrings = new string[numActualReplaces + 1];
for (int i = 0; i < numActualReplaces && currIndex < Length; i++)
{
splitStrings[arrIndex++] = Substring(currIndex, sepList[i] - currIndex);
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
}
// Handle the last string at the end of the array if there is one.
if (currIndex < Length && numActualReplaces >= 0)
{
splitStrings[arrIndex] = Substring(currIndex);
}
else if (arrIndex == numActualReplaces)
{
// We had a separator character at the end of a string. Rather than just allowing
// a null character, we'll replace the last element in the array with an empty string.
splitStrings[arrIndex] = string.Empty;
}
return splitStrings;
}
// This function may trim entries or omit empty entries
private string[] SplitWithPostProcessing(ReadOnlySpan<int> sepList, ReadOnlySpan<int> lengthList, int defaultLength, int count, StringSplitOptions options)
{
Debug.Assert(count >= 2);
int numReplaces = sepList.Length;
// Allocate array to hold items. This array may not be
// filled completely in this function, we will create a
// new array and copy string references to that new array.
int maxItems = (numReplaces < count) ? (numReplaces + 1) : count;
string[] splitStrings = new string[maxItems];
int currIndex = 0;
int arrIndex = 0;
ReadOnlySpan<char> thisEntry;
for (int i = 0; i < numReplaces; i++)
{
thisEntry = this.AsSpan(currIndex, sepList[i] - currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty || ((options & StringSplitOptions.RemoveEmptyEntries) == 0))
{
splitStrings[arrIndex++] = thisEntry.ToString();
}
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
if (arrIndex == count - 1)
{
// The next iteration of the loop will provide the final entry into the
// results array. If needed, skip over all empty entries before that
// point.
if ((options & StringSplitOptions.RemoveEmptyEntries) != 0)
{
while (++i < numReplaces)
{
thisEntry = this.AsSpan(currIndex, sepList[i] - currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty)
{
break; // there's useful data here
}
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
}
}
break;
}
}
// we must have at least one slot left to fill in the last string.
Debug.Assert(arrIndex < maxItems);
// Handle the last substring at the end of the array
// (could be empty if separator appeared at the end of the input string)
thisEntry = this.AsSpan(currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty || ((options & StringSplitOptions.RemoveEmptyEntries) == 0))
{
splitStrings[arrIndex++] = thisEntry.ToString();
}
Array.Resize(ref splitStrings, arrIndex);
return splitStrings;
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string.
/// </summary>
/// <param name="separators"><see cref="ReadOnlySpan{T}"/> of separator chars</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> to store indexes</param>
private void MakeSeparatorList(ReadOnlySpan<char> separators, ref ValueListBuilder<int> sepListBuilder)
{
// Special-case no separators to mean any whitespace is a separator.
if (separators.Length == 0)
{
for (int i = 0; i < Length; i++)
{
if (char.IsWhiteSpace(this[i]))
{
sepListBuilder.Append(i);
}
}
}
// Special-case the common cases of 1, 2, and 3 separators, with manual comparisons against each separator.
else if (separators.Length <= 3)
{
char sep0, sep1, sep2;
sep0 = separators[0];
sep1 = separators.Length > 1 ? separators[1] : sep0;
sep2 = separators.Length > 2 ? separators[2] : sep1;
if (Length >= 16 && Sse41.IsSupported)
{
MakeSeparatorListVectorized(ref sepListBuilder, sep0, sep1, sep2);
return;
}
for (int i = 0; i < Length; i++)
{
char c = this[i];
if (c == sep0 || c == sep1 || c == sep2)
{
sepListBuilder.Append(i);
}
}
}
// Handle > 3 separators with a probabilistic map, ala IndexOfAny.
// This optimizes for chars being unlikely to match a separator.
else
{
unsafe
{
ProbabilisticMap map = default;
uint* charMap = (uint*)↦
ProbabilisticMap.Initialize(charMap, separators);
for (int i = 0; i < Length; i++)
{
char c = this[i];
if (ProbabilisticMap.IsCharBitSet(charMap, (byte)c) &&
ProbabilisticMap.IsCharBitSet(charMap, (byte)(c >> 8)) &&
separators.Contains(c))
{
sepListBuilder.Append(i);
}
}
}
}
}
private void MakeSeparatorListVectorized(ref ValueListBuilder<int> sepListBuilder, char c, char c2, char c3)
{
// Redundant test so we won't prejit remainder of this method
// on platforms without SSE.
if (!Sse41.IsSupported)
{
throw new PlatformNotSupportedException();
}
// Constant that allows for the truncation of 16-bit (FFFF/0000) values within a register to 4-bit (F/0)
Vector128<byte> shuffleConstant = Vector128.Create(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
Vector128<ushort> v1 = Vector128.Create((ushort)c);
Vector128<ushort> v2 = Vector128.Create((ushort)c2);
Vector128<ushort> v3 = Vector128.Create((ushort)c3);
ref char c0 = ref MemoryMarshal.GetReference(this.AsSpan());
int cond = Length & -Vector128<ushort>.Count;
int i = 0;
for (; i < cond; i += Vector128<ushort>.Count)
{
Vector128<ushort> charVector = ReadVector(ref c0, i);
Vector128<ushort> cmp = Sse2.CompareEqual(charVector, v1);
cmp = Sse2.Or(Sse2.CompareEqual(charVector, v2), cmp);
cmp = Sse2.Or(Sse2.CompareEqual(charVector, v3), cmp);
if (Sse41.TestZ(cmp, cmp)) { continue; }
Vector128<byte> mask = Sse2.ShiftRightLogical(cmp.AsUInt64(), 4).AsByte();
mask = Ssse3.Shuffle(mask, shuffleConstant);
uint lowBits = Sse2.ConvertToUInt32(mask.AsUInt32());
mask = Sse2.ShiftRightLogical(mask.AsUInt64(), 32).AsByte();
uint highBits = Sse2.ConvertToUInt32(mask.AsUInt32());
for (int idx = i; lowBits != 0; idx++)
{
if ((lowBits & 0xF) != 0)
{
sepListBuilder.Append(idx);
}
lowBits >>= 8;
}
for (int idx = i + 4; highBits != 0; idx++)
{
if ((highBits & 0xF) != 0)
{
sepListBuilder.Append(idx);
}
highBits >>= 8;
}
}
for (; i < Length; i++)
{
char curr = Unsafe.Add(ref c0, (IntPtr)(uint)i);
if (curr == c || curr == c2 || curr == c3)
{
sepListBuilder.Append(i);
}
}
static Vector128<ushort> ReadVector(ref char c0, int offset)
{
ref char ci = ref Unsafe.Add(ref c0, (IntPtr)(uint)offset);
ref byte b = ref Unsafe.As<char, byte>(ref ci);
return Unsafe.ReadUnaligned<Vector128<ushort>>(ref b);
}
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string.
/// </summary>
/// <param name="separator">separator string</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> to store indexes</param>
private void MakeSeparatorList(string separator, ref ValueListBuilder<int> sepListBuilder)
{
Debug.Assert(!IsNullOrEmpty(separator), "!string.IsNullOrEmpty(separator)");
int currentSepLength = separator.Length;
for (int i = 0; i < Length; i++)
{
if (this[i] == separator[0] && currentSepLength <= Length - i)
{
if (currentSepLength == 1
|| this.AsSpan(i, currentSepLength).SequenceEqual(separator))
{
sepListBuilder.Append(i);
i += currentSepLength - 1;
}
}
}
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string and list that holds length of separator strings.
/// </summary>
/// <param name="separators">separator strngs</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> for separator indexes</param>
/// <param name="lengthListBuilder"><see cref="ValueListBuilder{T}"/> for separator length values</param>
private void MakeSeparatorList(string?[] separators, ref ValueListBuilder<int> sepListBuilder, ref ValueListBuilder<int> lengthListBuilder)
{
Debug.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0");
for (int i = 0; i < Length; i++)
{
for (int j = 0; j < separators.Length; j++)
{
string? separator = separators[j];
if (IsNullOrEmpty(separator))
{
continue;
}
int currentSepLength = separator.Length;
if (this[i] == separator[0] && currentSepLength <= Length - i)
{
if (currentSepLength == 1
|| this.AsSpan(i, currentSepLength).SequenceEqual(separator))
{
sepListBuilder.Append(i);
lengthListBuilder.Append(currentSepLength);
i += currentSepLength - 1;
break;
}
}
}
}
}
private static void CheckStringSplitOptions(StringSplitOptions options)
{
const StringSplitOptions AllValidFlags = StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries;
if ((options & ~AllValidFlags) != 0)
{
// at least one invalid flag was set
ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidFlag, ExceptionArgument.options);
}
}
// Returns a substring of this string.
//
public string Substring(int startIndex) => Substring(startIndex, Length - startIndex);
public string Substring(int startIndex, int length)
{
if (startIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (startIndex > Length)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength);
}
if (length < 0)
{
throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex > Length - length)
{
throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength);
}
if (length == 0)
{
return string.Empty;
}
if (startIndex == 0 && length == this.Length)
{
return this;
}
return InternalSubString(startIndex, length);
}
private string InternalSubString(int startIndex, int length)
{
Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!");
string result = FastAllocateString(length);
Buffer.Memmove(
elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
destination: ref result._firstChar,
source: ref Unsafe.Add(ref _firstChar, (nint)(uint)startIndex /* force zero-extension */));
return result;
}
// Creates a copy of this string in lower case. The culture is set by culture.
public string ToLower() => ToLower(null);
// Creates a copy of this string in lower case. The culture is set by culture.
public string ToLower(CultureInfo? culture)
{
CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
return cult.TextInfo.ToLower(this);
}
// Creates a copy of this string in lower case based on invariant culture.
public string ToLowerInvariant()
{
return TextInfo.Invariant.ToLower(this);
}
public string ToUpper() => ToUpper(null);
// Creates a copy of this string in upper case. The culture is set by culture.
public string ToUpper(CultureInfo? culture)
{
CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
return cult.TextInfo.ToUpper(this);
}
// Creates a copy of this string in upper case based on invariant culture.
public string ToUpperInvariant()
{
return TextInfo.Invariant.ToUpper(this);
}
// Trims the whitespace from both ends of the string. Whitespace is defined by
// char.IsWhiteSpace.
//
public string Trim() => TrimWhiteSpaceHelper(TrimType.Both);
// Removes a set of characters from the beginning and end of this string.
public unsafe string Trim(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Both);
// Removes a set of characters from the beginning and end of this string.
public unsafe string Trim(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Both);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both);
}
}
// Removes a set of characters from the beginning of this string.
public string TrimStart() => TrimWhiteSpaceHelper(TrimType.Head);
// Removes a set of characters from the beginning of this string.
public unsafe string TrimStart(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Head);
// Removes a set of characters from the beginning of this string.
public unsafe string TrimStart(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Head);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head);
}
}
// Removes a set of characters from the end of this string.
public string TrimEnd() => TrimWhiteSpaceHelper(TrimType.Tail);
// Removes a set of characters from the end of this string.
public unsafe string TrimEnd(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Tail);
// Removes a set of characters from the end of this string.
public unsafe string TrimEnd(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Tail);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
}
}
private string TrimWhiteSpaceHelper(TrimType trimType)
{
// end will point to the first non-trimmed character on the right.
// start will point to the first non-trimmed character on the left.
int end = Length - 1;
int start = 0;
// Trim specified characters.
if ((trimType & TrimType.Head) != 0)
{
for (start = 0; start < Length; start++)
{
if (!char.IsWhiteSpace(this[start]))
{
break;
}
}
}
if ((trimType & TrimType.Tail) != 0)
{
for (end = Length - 1; end >= start; end--)
{
if (!char.IsWhiteSpace(this[end]))
{
break;
}
}
}
return CreateTrimmedString(start, end);
}
private unsafe string TrimHelper(char* trimChars, int trimCharsLength, TrimType trimType)
{
Debug.Assert(trimChars != null);
Debug.Assert(trimCharsLength > 0);
// end will point to the first non-trimmed character on the right.
// start will point to the first non-trimmed character on the left.
int end = Length - 1;
int start = 0;
// Trim specified characters.
if ((trimType & TrimType.Head) != 0)
{
for (start = 0; start < Length; start++)
{
int i = 0;
char ch = this[start];
for (i = 0; i < trimCharsLength; i++)
{
if (trimChars[i] == ch)
{
break;
}
}
if (i == trimCharsLength)
{
// The character is not in trimChars, so stop trimming.
break;
}
}
}
if ((trimType & TrimType.Tail) != 0)
{
for (end = Length - 1; end >= start; end--)
{
int i = 0;
char ch = this[end];
for (i = 0; i < trimCharsLength; i++)
{
if (trimChars[i] == ch)
{
break;
}
}
if (i == trimCharsLength)
{
// The character is not in trimChars, so stop trimming.
break;
}
}
}
return CreateTrimmedString(start, end);
}
private string CreateTrimmedString(int start, int end)
{
int len = end - start + 1;
return
len == Length ? this :
len == 0 ? string.Empty :
InternalSubString(start, len);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using System.Text;
namespace System
{
public partial class String
{
private const int StackallocIntBufferSizeLimit = 128;
private static void FillStringChecked(string dest, int destPos, string src)
{
Debug.Assert(dest != null);
Debug.Assert(src != null);
if (src.Length > dest.Length - destPos)
{
throw new IndexOutOfRangeException();
}
Buffer.Memmove(
destination: ref Unsafe.Add(ref dest._firstChar, destPos),
source: ref src._firstChar,
elementCount: (uint)src.Length);
}
public static string Concat(object? arg0) =>
arg0?.ToString() ?? Empty;
public static string Concat(object? arg0, object? arg1) =>
Concat(arg0?.ToString(), arg1?.ToString());
public static string Concat(object? arg0, object? arg1, object? arg2) =>
Concat(arg0?.ToString(), arg1?.ToString(), arg2?.ToString());
public static string Concat(params object?[] args!!)
{
if (args.Length <= 1)
{
return args.Length == 0 ?
string.Empty :
args[0]?.ToString() ?? string.Empty;
}
// We need to get an intermediary string array
// to fill with each of the args' ToString(),
// and then just concat that in one operation.
// This way we avoid any intermediary string representations,
// or buffer resizing if we use StringBuilder (although the
// latter case is partially alleviated due to StringBuilder's
// linked-list style implementation)
var strings = new string[args.Length];
int totalLength = 0;
for (int i = 0; i < args.Length; i++)
{
object? value = args[i];
string toString = value?.ToString() ?? string.Empty; // We need to handle both the cases when value or value.ToString() is null
strings[i] = toString;
totalLength += toString.Length;
if (totalLength < 0) // Check for a positive overflow
{
throw new OutOfMemoryException();
}
}
// If all of the ToStrings are null/empty, just return string.Empty
if (totalLength == 0)
{
return string.Empty;
}
string result = FastAllocateString(totalLength);
int position = 0; // How many characters we've copied so far
for (int i = 0; i < strings.Length; i++)
{
string s = strings[i];
Debug.Assert(s != null);
Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!");
FillStringChecked(result, position, s);
position += s.Length;
}
return result;
}
public static string Concat<T>(IEnumerable<T> values!!)
{
if (typeof(T) == typeof(char))
{
// Special-case T==char, as we can handle that case much more efficiently,
// and string.Concat(IEnumerable<char>) can be used as an efficient
// enumerable-based equivalent of new string(char[]).
using (IEnumerator<char> en = Unsafe.As<IEnumerable<char>>(values).GetEnumerator())
{
if (!en.MoveNext())
{
// There weren't any chars. Return the empty string.
return Empty;
}
char c = en.Current; // save the first char
if (!en.MoveNext())
{
// There was only one char. Return a string from it directly.
return CreateFromChar(c);
}
// Create the StringBuilder, add the chars we've already enumerated,
// add the rest, and then get the resulting string.
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(c); // first value
do
{
c = en.Current;
result.Append(c);
}
while (en.MoveNext());
return result.ToString();
}
}
else
{
using (IEnumerator<T> en = values.GetEnumerator())
{
if (!en.MoveNext())
return string.Empty;
// We called MoveNext once, so this will be the first item
T currentValue = en.Current;
// Call ToString before calling MoveNext again, since
// we want to stay consistent with the below loop
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
{
// We have to handle the case of either currentValue
// or its ToString being null
return firstString ?? string.Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
do
{
currentValue = en.Current;
if (currentValue != null)
{
result.Append(currentValue.ToString());
}
}
while (en.MoveNext());
return result.ToString();
}
}
}
public static string Concat(IEnumerable<string?> values!!)
{
using (IEnumerator<string?> en = values.GetEnumerator())
{
if (!en.MoveNext())
return string.Empty;
string? firstValue = en.Current;
if (!en.MoveNext())
{
return firstValue ?? string.Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstValue);
do
{
result.Append(en.Current);
}
while (en.MoveNext());
return result.ToString();
}
}
public static string Concat(string? str0, string? str1)
{
if (IsNullOrEmpty(str0))
{
if (IsNullOrEmpty(str1))
{
return string.Empty;
}
return str1;
}
if (IsNullOrEmpty(str1))
{
return str0;
}
int str0Length = str0.Length;
string result = FastAllocateString(str0Length + str1.Length);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0Length, str1);
return result;
}
public static string Concat(string? str0, string? str1, string? str2)
{
if (IsNullOrEmpty(str0))
{
return Concat(str1, str2);
}
if (IsNullOrEmpty(str1))
{
return Concat(str0, str2);
}
if (IsNullOrEmpty(str2))
{
return Concat(str0, str1);
}
int totalLength = str0.Length + str1.Length + str2.Length;
string result = FastAllocateString(totalLength);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0.Length, str1);
FillStringChecked(result, str0.Length + str1.Length, str2);
return result;
}
public static string Concat(string? str0, string? str1, string? str2, string? str3)
{
if (IsNullOrEmpty(str0))
{
return Concat(str1, str2, str3);
}
if (IsNullOrEmpty(str1))
{
return Concat(str0, str2, str3);
}
if (IsNullOrEmpty(str2))
{
return Concat(str0, str1, str3);
}
if (IsNullOrEmpty(str3))
{
return Concat(str0, str1, str2);
}
int totalLength = str0.Length + str1.Length + str2.Length + str3.Length;
string result = FastAllocateString(totalLength);
FillStringChecked(result, 0, str0);
FillStringChecked(result, str0.Length, str1);
FillStringChecked(result, str0.Length + str1.Length, str2);
FillStringChecked(result, str0.Length + str1.Length + str2.Length, str3);
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1)
{
int length = checked(str0.Length + str1.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
str1.CopyTo(resultSpan.Slice(str0.Length));
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2)
{
int length = checked(str0.Length + str1.Length + str2.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str0.Length);
str1.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str1.Length);
str2.CopyTo(resultSpan);
return result;
}
public static string Concat(ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2, ReadOnlySpan<char> str3)
{
int length = checked(str0.Length + str1.Length + str2.Length + str3.Length);
if (length == 0)
{
return Empty;
}
string result = FastAllocateString(length);
Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length);
str0.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str0.Length);
str1.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str1.Length);
str2.CopyTo(resultSpan);
resultSpan = resultSpan.Slice(str2.Length);
str3.CopyTo(resultSpan);
return result;
}
public static string Concat(params string?[] values!!)
{
if (values.Length <= 1)
{
return values.Length == 0 ?
string.Empty :
values[0] ?? string.Empty;
}
// It's possible that the input values array could be changed concurrently on another
// thread, such that we can't trust that each read of values[i] will be equivalent.
// Worst case, we can make a defensive copy of the array and use that, but we first
// optimistically try the allocation and copies assuming that the array isn't changing,
// which represents the 99.999% case, in particular since string.Concat is used for
// string concatenation by the languages, with the input array being a params array.
// Sum the lengths of all input strings
long totalLengthLong = 0;
for (int i = 0; i < values.Length; i++)
{
string? value = values[i];
if (value != null)
{
totalLengthLong += value.Length;
}
}
// If it's too long, fail, or if it's empty, return an empty string.
if (totalLengthLong > int.MaxValue)
{
throw new OutOfMemoryException();
}
int totalLength = (int)totalLengthLong;
if (totalLength == 0)
{
return string.Empty;
}
// Allocate a new string and copy each input string into it
string result = FastAllocateString(totalLength);
int copiedLength = 0;
for (int i = 0; i < values.Length; i++)
{
string? value = values[i];
if (!string.IsNullOrEmpty(value))
{
int valueLen = value.Length;
if (valueLen > totalLength - copiedLength)
{
copiedLength = -1;
break;
}
FillStringChecked(result, copiedLength, value);
copiedLength += valueLen;
}
}
// If we copied exactly the right amount, return the new string. Otherwise,
// something changed concurrently to mutate the input array: fall back to
// doing the concatenation again, but this time with a defensive copy. This
// fall back should be extremely rare.
return copiedLength == totalLength ? result : Concat((string?[])values.Clone());
}
public static string Format(string format, object? arg0)
{
return FormatHelper(null, format, new ParamsArray(arg0));
}
public static string Format(string format, object? arg0, object? arg1)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1));
}
public static string Format(string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1, arg2));
}
public static string Format(string format, params object?[] args)
{
if (args is null)
{
// To preserve the original exception behavior, throw an exception about format if both
// args and format are null. The actual null check for format is in FormatHelper.
ArgumentNullException.Throw(format is null ? nameof(format) : nameof(args));
}
return FormatHelper(null, format, new ParamsArray(args));
}
public static string Format(IFormatProvider? provider, string format, object? arg0)
{
return FormatHelper(provider, format, new ParamsArray(arg0));
}
public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1));
}
public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1, arg2));
}
public static string Format(IFormatProvider? provider, string format, params object?[] args)
{
if (args is null)
{
// To preserve the original exception behavior, throw an exception about format if both
// args and format are null. The actual null check for format is in FormatHelper.
ArgumentNullException.Throw(format is null ? nameof(format) : nameof(args));
}
return FormatHelper(provider, format, new ParamsArray(args));
}
private static string FormatHelper(IFormatProvider? provider, string format!!, ParamsArray args)
{
var sb = new ValueStringBuilder(stackalloc char[256]);
sb.EnsureCapacity(format.Length + args.Length * 8);
sb.AppendFormatHelper(provider, format, args);
return sb.ToString();
}
public string Insert(int startIndex, string value!!)
{
if ((uint)startIndex > Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
int oldLength = Length;
int insertLength = value.Length;
if (oldLength == 0)
return value;
if (insertLength == 0)
return this;
// In case this computation overflows, newLength will be negative and FastAllocateString throws OutOfMemoryException
int newLength = oldLength + insertLength;
string result = FastAllocateString(newLength);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex));
return result;
}
public static string Join(char separator, params string?[] value)
{
if (value == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
}
return JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), new ReadOnlySpan<string?>(value));
}
public static string Join(string? separator, params string?[] value)
{
if (value == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
}
return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(value));
}
public static string Join(char separator, string?[] value, int startIndex, int count) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), value, startIndex, count);
public static string Join(string? separator, string?[] value, int startIndex, int count) =>
JoinCore(separator.AsSpan(), value, startIndex, count);
private static string JoinCore(ReadOnlySpan<char> separator, string?[] value!!, int startIndex, int count)
{
if (startIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
}
if (startIndex > value.Length - count)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_IndexCountBuffer);
}
return JoinCore(separator, new ReadOnlySpan<string?>(value, startIndex, count));
}
public static string Join(string? separator, IEnumerable<string?> values)
{
if (values is List<string?> valuesList)
{
return JoinCore(separator.AsSpan(), CollectionsMarshal.AsSpan(valuesList));
}
if (values is string?[] valuesArray)
{
return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(valuesArray));
}
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
using (IEnumerator<string?> en = values.GetEnumerator())
{
if (!en.MoveNext())
{
return Empty;
}
string? firstValue = en.Current;
if (!en.MoveNext())
{
// Only one value available
return firstValue ?? Empty;
}
// Null separator and values are handled by the StringBuilder
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstValue);
do
{
result.Append(separator);
result.Append(en.Current);
}
while (en.MoveNext());
return result.ToString();
}
}
public static string Join(char separator, params object?[] values) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), values);
public static string Join(string? separator, params object?[] values) =>
JoinCore(separator.AsSpan(), values);
private static string JoinCore(ReadOnlySpan<char> separator, object?[] values)
{
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
if (values.Length == 0)
{
return Empty;
}
string? firstString = values[0]?.ToString();
if (values.Length == 1)
{
return firstString ?? Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
for (int i = 1; i < values.Length; i++)
{
result.Append(separator);
object? value = values[i];
if (value != null)
{
result.Append(value.ToString());
}
}
return result.ToString();
}
public static string Join<T>(char separator, IEnumerable<T> values) =>
JoinCore(MemoryMarshal.CreateReadOnlySpan(ref separator, 1), values);
public static string Join<T>(string? separator, IEnumerable<T> values) =>
JoinCore(separator.AsSpan(), values);
private static string JoinCore<T>(ReadOnlySpan<char> separator, IEnumerable<T> values)
{
if (typeof(T) == typeof(string))
{
if (values is List<string?> valuesList)
{
return JoinCore(separator, CollectionsMarshal.AsSpan(valuesList));
}
if (values is string?[] valuesArray)
{
return JoinCore(separator, new ReadOnlySpan<string?>(valuesArray));
}
}
if (values == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.values);
}
using (IEnumerator<T> en = values.GetEnumerator())
{
if (!en.MoveNext())
{
return Empty;
}
// We called MoveNext once, so this will be the first item
T currentValue = en.Current;
// Call ToString before calling MoveNext again, since
// we want to stay consistent with the below loop
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
{
// We have to handle the case of either currentValue
// or its ToString being null
return firstString ?? Empty;
}
var result = new ValueStringBuilder(stackalloc char[256]);
result.Append(firstString);
do
{
currentValue = en.Current;
result.Append(separator);
if (currentValue != null)
{
result.Append(currentValue.ToString());
}
}
while (en.MoveNext());
return result.ToString();
}
}
private static string JoinCore(ReadOnlySpan<char> separator, ReadOnlySpan<string?> values)
{
if (values.Length <= 1)
{
return values.IsEmpty ?
Empty :
values[0] ?? Empty;
}
long totalSeparatorsLength = (long)(values.Length - 1) * separator.Length;
if (totalSeparatorsLength > int.MaxValue)
{
ThrowHelper.ThrowOutOfMemoryException();
}
int totalLength = (int)totalSeparatorsLength;
// Calculate the length of the resultant string so we know how much space to allocate.
foreach (string? value in values)
{
if (value != null)
{
totalLength += value.Length;
if (totalLength < 0) // Check for overflow
{
ThrowHelper.ThrowOutOfMemoryException();
}
}
}
// Copy each of the strings into the result buffer, interleaving with the separator.
string result = FastAllocateString(totalLength);
int copiedLength = 0;
for (int i = 0; i < values.Length; i++)
{
// It's possible that another thread may have mutated the input array
// such that our second read of an index will not be the same string
// we got during the first read.
// We range check again to avoid buffer overflows if this happens.
if (values[i] is string value)
{
int valueLen = value.Length;
if (valueLen > totalLength - copiedLength)
{
copiedLength = -1;
break;
}
// Fill in the value.
FillStringChecked(result, copiedLength, value);
copiedLength += valueLen;
}
if (i < values.Length - 1)
{
// Fill in the separator.
// Special-case length 1 to avoid additional overheads of CopyTo.
// This is common due to the char separator overload.
ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength);
if (separator.Length == 1)
{
dest = separator[0];
}
else
{
separator.CopyTo(new Span<char>(ref dest, separator.Length));
}
copiedLength += separator.Length;
}
}
// If we copied exactly the right amount, return the new string. Otherwise,
// something changed concurrently to mutate the input array: fall back to
// doing the concatenation again, but this time with a defensive copy. This
// fall back should be extremely rare.
return copiedLength == totalLength ?
result :
JoinCore(separator, values.ToArray().AsSpan());
}
public string PadLeft(int totalWidth) => PadLeft(totalWidth, ' ');
public string PadLeft(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
return this;
string result = FastAllocateString(totalWidth);
new Span<char>(ref result._firstChar, count).Fill(paddingChar);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength);
return result;
}
public string PadRight(int totalWidth) => PadRight(totalWidth, ' ');
public string PadRight(int totalWidth, char paddingChar)
{
if (totalWidth < 0)
throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum);
int oldLength = Length;
int count = totalWidth - oldLength;
if (count <= 0)
return this;
string result = FastAllocateString(totalWidth);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)oldLength);
new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar);
return result;
}
public string Remove(int startIndex, int count)
{
if (startIndex < 0)
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount);
int oldLength = this.Length;
if (count > oldLength - startIndex)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_IndexCount);
if (count == 0)
return this;
int newLength = oldLength - count;
if (newLength == 0)
return Empty;
string result = FastAllocateString(newLength);
Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex);
Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex));
return result;
}
// a remove that just takes a startindex.
public string Remove(int startIndex)
{
if ((uint)startIndex > Length)
throw new ArgumentOutOfRangeException(nameof(startIndex), startIndex < 0 ? SR.ArgumentOutOfRange_StartIndex : SR.ArgumentOutOfRange_StartIndexLargerThanLength);
return Substring(0, startIndex);
}
public string Replace(string oldValue, string? newValue, bool ignoreCase, CultureInfo? culture)
{
return ReplaceCore(oldValue, newValue, culture?.CompareInfo, ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None);
}
public string Replace(string oldValue, string? newValue, StringComparison comparisonType)
{
switch (comparisonType)
{
case StringComparison.CurrentCulture:
case StringComparison.CurrentCultureIgnoreCase:
return ReplaceCore(oldValue, newValue, CultureInfo.CurrentCulture.CompareInfo, GetCaseCompareOfComparisonCulture(comparisonType));
case StringComparison.InvariantCulture:
case StringComparison.InvariantCultureIgnoreCase:
return ReplaceCore(oldValue, newValue, CompareInfo.Invariant, GetCaseCompareOfComparisonCulture(comparisonType));
case StringComparison.Ordinal:
return Replace(oldValue, newValue);
case StringComparison.OrdinalIgnoreCase:
return ReplaceCore(oldValue, newValue, CompareInfo.Invariant, CompareOptions.OrdinalIgnoreCase);
default:
throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
}
}
private string ReplaceCore(string oldValue, string? newValue, CompareInfo? ci, CompareOptions options)
{
ArgumentException.ThrowIfNullOrEmpty(oldValue);
// If they asked to replace oldValue with a null, replace all occurrences
// with the empty string. AsSpan() will normalize appropriately.
//
// If inner ReplaceCore method returns null, it means no substitutions were
// performed, so as an optimization we'll return the original string.
return ReplaceCore(this, oldValue.AsSpan(), newValue.AsSpan(), ci ?? CultureInfo.CurrentCulture.CompareInfo, options)
?? this;
}
private static string? ReplaceCore(ReadOnlySpan<char> searchSpace, ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue, CompareInfo compareInfo, CompareOptions options)
{
Debug.Assert(!oldValue.IsEmpty);
Debug.Assert(compareInfo != null);
var result = new ValueStringBuilder(stackalloc char[256]);
result.EnsureCapacity(searchSpace.Length);
bool hasDoneAnyReplacements = false;
while (true)
{
int index = compareInfo.IndexOf(searchSpace, oldValue, options, out int matchLength);
// There's the possibility that 'oldValue' has zero collation weight (empty string equivalent).
// If this is the case, we behave as if there are no more substitutions to be made.
if (index < 0 || matchLength == 0)
{
break;
}
// append the unmodified portion of search space
result.Append(searchSpace.Slice(0, index));
// append the replacement
result.Append(newValue);
searchSpace = searchSpace.Slice(index + matchLength);
hasDoneAnyReplacements = true;
}
// Didn't find 'oldValue' in the remaining search space, or the match
// consisted only of zero collation weight characters. As an optimization,
// if we have not yet performed any replacements, we'll save the
// allocation.
if (!hasDoneAnyReplacements)
{
result.Dispose();
return null;
}
// Append what remains of the search space, then allocate the new string.
result.Append(searchSpace);
return result.ToString();
}
// Replaces all instances of oldChar with newChar.
//
public string Replace(char oldChar, char newChar)
{
if (oldChar == newChar)
return this;
int firstIndex = IndexOf(oldChar);
if (firstIndex < 0)
return this;
int remainingLength = Length - firstIndex;
string result = FastAllocateString(Length);
int copyLength = firstIndex;
// Copy the characters already proven not to match.
if (copyLength > 0)
{
Buffer.Memmove(ref result._firstChar, ref _firstChar, (uint)copyLength);
}
// Copy the remaining characters, doing the replacement as we go.
ref ushort pSrc = ref Unsafe.Add(ref Unsafe.As<char, ushort>(ref _firstChar), copyLength);
ref ushort pDst = ref Unsafe.Add(ref Unsafe.As<char, ushort>(ref result._firstChar), copyLength);
if (Vector.IsHardwareAccelerated && remainingLength >= Vector<ushort>.Count)
{
Vector<ushort> oldChars = new Vector<ushort>(oldChar);
Vector<ushort> newChars = new Vector<ushort>(newChar);
do
{
Vector<ushort> original = Unsafe.ReadUnaligned<Vector<ushort>>(ref Unsafe.As<ushort, byte>(ref pSrc));
Vector<ushort> equals = Vector.Equals(original, oldChars);
Vector<ushort> results = Vector.ConditionalSelect(equals, newChars, original);
Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref pDst), results);
pSrc = ref Unsafe.Add(ref pSrc, Vector<ushort>.Count);
pDst = ref Unsafe.Add(ref pDst, Vector<ushort>.Count);
remainingLength -= Vector<ushort>.Count;
}
while (remainingLength >= Vector<ushort>.Count);
}
for (; remainingLength > 0; remainingLength--)
{
ushort currentChar = pSrc;
pDst = currentChar == oldChar ? newChar : currentChar;
pSrc = ref Unsafe.Add(ref pSrc, 1);
pDst = ref Unsafe.Add(ref pDst, 1);
}
return result;
}
public string Replace(string oldValue, string? newValue)
{
ArgumentException.ThrowIfNullOrEmpty(oldValue);
// If newValue is null, treat it as an empty string. Callers use this to remove the oldValue.
newValue ??= Empty;
// Track the locations of oldValue to be replaced.
var replacementIndices = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
if (oldValue.Length == 1)
{
// Special-case oldValues that are a single character. Even though there's an overload that takes
// a single character, its newValue is also a single character, so this overload ends up being used
// often to remove characters by having an empty newValue.
if (newValue.Length == 1)
{
// With both the oldValue and newValue being a single character, it's cheaper to just use the other overload.
return Replace(oldValue[0], newValue[0]);
}
// Find all occurrences of the oldValue character.
char c = oldValue[0];
int i = 0;
while (true)
{
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
if (pos < 0)
{
break;
}
replacementIndices.Append(i + pos);
i += pos + 1;
}
}
else
{
// Find all occurrences of the oldValue string.
int i = 0;
while (true)
{
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length);
if (pos < 0)
{
break;
}
replacementIndices.Append(i + pos);
i += pos + oldValue.Length;
}
}
// If the oldValue wasn't found, just return the original string.
if (replacementIndices.Length == 0)
{
return this;
}
// Perform the replacement. String allocation and copying is in separate method to make this method faster
// for the case where nothing needs replacing.
string dst = ReplaceHelper(oldValue.Length, newValue, replacementIndices.AsSpan());
replacementIndices.Dispose();
return dst;
}
private string ReplaceHelper(int oldValueLength, string newValue, ReadOnlySpan<int> indices)
{
Debug.Assert(indices.Length > 0);
long dstLength = this.Length + ((long)(newValue.Length - oldValueLength)) * indices.Length;
if (dstLength > int.MaxValue)
throw new OutOfMemoryException();
string dst = FastAllocateString((int)dstLength);
Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
int thisIdx = 0;
int dstIdx = 0;
for (int r = 0; r < indices.Length; r++)
{
int replacementIdx = indices[r];
// Copy over the non-matching portion of the original that precedes this occurrence of oldValue.
int count = replacementIdx - thisIdx;
if (count != 0)
{
this.AsSpan(thisIdx, count).CopyTo(dstSpan.Slice(dstIdx));
dstIdx += count;
}
thisIdx = replacementIdx + oldValueLength;
// Copy over newValue to replace the oldValue.
newValue.CopyTo(dstSpan.Slice(dstIdx));
dstIdx += newValue.Length;
}
// Copy over the final non-matching portion at the end of the string.
Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
this.AsSpan(thisIdx).CopyTo(dstSpan.Slice(dstIdx));
return dst;
}
/// <summary>
/// Replaces all newline sequences in the current string with <see cref="Environment.NewLine"/>.
/// </summary>
/// <returns>
/// A string whose contents match the current string, but with all newline sequences replaced
/// with <see cref="Environment.NewLine"/>.
/// </returns>
/// <remarks>
/// This method searches for all newline sequences within the string and canonicalizes them to match
/// the newline sequence for the current environment. For example, when running on Windows, all
/// occurrences of non-Windows newline sequences will be replaced with the sequence CRLF. When
/// running on Unix, all occurrences of non-Unix newline sequences will be replaced with
/// a single LF character.
///
/// It is not recommended that protocol parsers utilize this API. Protocol specifications often
/// mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
/// line, status line, and headers lines end with CRLF. Since this API operates over a wide range
/// of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
/// by the protocol's authors.
///
/// This overload is equivalent to calling <see cref="ReplaceLineEndings(string)"/>, passing
/// <see cref="Environment.NewLine"/> as the <em>replacementText</em> parameter.
///
/// This method is guaranteed O(n) complexity, where <em>n</em> is the length of the input string.
/// </remarks>
public string ReplaceLineEndings() => ReplaceLineEndings(Environment.NewLineConst);
/// <summary>
/// Replaces all newline sequences in the current string with <paramref name="replacementText"/>.
/// </summary>
/// <returns>
/// A string whose contents match the current string, but with all newline sequences replaced
/// with <paramref name="replacementText"/>.
/// </returns>
/// <remarks>
/// This method searches for all newline sequences within the string and canonicalizes them to the
/// newline sequence provided by <paramref name="replacementText"/>. If <paramref name="replacementText"/>
/// is <see cref="string.Empty"/>, all newline sequences within the string will be removed.
///
/// It is not recommended that protocol parsers utilize this API. Protocol specifications often
/// mandate specific newline sequences. For example, HTTP/1.1 (RFC 8615) mandates that the request
/// line, status line, and headers lines end with CRLF. Since this API operates over a wide range
/// of newline sequences, a protocol parser utilizing this API could exhibit behaviors unintended
/// by the protocol's authors.
///
/// The list of recognized newline sequences is CR (U+000D), LF (U+000A), CRLF (U+000D U+000A),
/// NEL (U+0085), LS (U+2028), FF (U+000C), and PS (U+2029). This list is given by the Unicode
/// Standard, Sec. 5.8, Recommendation R4 and Table 5-2.
///
/// This method is guaranteed O(n * r) complexity, where <em>n</em> is the length of the input string,
/// and where <em>r</em> is the length of <paramref name="replacementText"/>.
/// </remarks>
public string ReplaceLineEndings(string replacementText!!)
{
// Early-exit: do we need to do anything at all?
// If not, return this string as-is.
int idxOfFirstNewlineChar = IndexOfNewlineChar(this, out int stride);
if (idxOfFirstNewlineChar < 0)
{
return this;
}
// While writing to the builder, we don't bother memcpying the first
// or the last segment into the builder. We'll use the builder only
// for the intermediate segments, then we'll sandwich everything together
// with one final string.Concat call.
ReadOnlySpan<char> firstSegment = this.AsSpan(0, idxOfFirstNewlineChar);
ReadOnlySpan<char> remaining = this.AsSpan(idxOfFirstNewlineChar + stride);
ValueStringBuilder builder = new ValueStringBuilder(stackalloc char[256]);
while (true)
{
int idx = IndexOfNewlineChar(remaining, out stride);
if (idx < 0) { break; } // no more newline chars
builder.Append(replacementText);
builder.Append(remaining.Slice(0, idx));
remaining = remaining.Slice(idx + stride);
}
string retVal = Concat(firstSegment, builder.AsSpan(), replacementText, remaining);
builder.Dispose();
return retVal;
}
// Scans the input text, returning the index of the first newline char.
// Newline chars are given by the Unicode Standard, Sec. 5.8.
internal static int IndexOfNewlineChar(ReadOnlySpan<char> text, out int stride)
{
// !! IMPORTANT !!
//
// We expect this method may be called with untrusted input, which means we need to
// bound the worst-case runtime of this method. We rely on MemoryExtensions.IndexOfAny
// having worst-case runtime O(i), where i is the index of the first needle match within
// the haystack; or O(n) if no needle is found. This ensures that in the common case
// of this method being called within a loop, the worst-case runtime is O(n) rather than
// O(n^2), where n is the length of the input text.
//
// The Unicode Standard, Sec. 5.8, Recommendation R4 and Table 5-2 state that the CR, LF,
// CRLF, NEL, LS, FF, and PS sequences are considered newline functions. That section
// also specifically excludes VT from the list of newline functions, so we do not include
// it in the needle list.
const string needles = "\r\n\f\u0085\u2028\u2029";
stride = default;
int idx = text.IndexOfAny(needles);
if ((uint)idx < (uint)text.Length)
{
stride = 1; // needle found
// Did we match CR? If so, and if it's followed by LF, then we need
// to consume both chars as a single newline function match.
if (text[idx] == '\r')
{
int nextCharIdx = idx + 1;
if ((uint)nextCharIdx < (uint)text.Length && text[nextCharIdx] == '\n')
{
stride = 2;
}
}
}
return idx;
}
public string[] Split(char separator, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(new ReadOnlySpan<char>(ref separator, 1), int.MaxValue, options);
}
public string[] Split(char separator, int count, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(new ReadOnlySpan<char>(ref separator, 1), count, options);
}
// Creates an array of strings by splitting this string at each
// occurrence of a separator. The separator is searched for, and if found,
// the substring preceding the occurrence is stored as the first element in
// the array of strings. We then continue in this manner by searching
// the substring that follows the occurrence. On the other hand, if the separator
// is not found, the array of strings will contain this instance as its only element.
// If the separator is null
// whitespace (i.e., Character.IsWhitespace) is used as the separator.
//
public string[] Split(params char[]? separator)
{
return SplitInternal(separator, int.MaxValue, StringSplitOptions.None);
}
// Creates an array of strings by splitting this string at each
// occurrence of a separator. The separator is searched for, and if found,
// the substring preceding the occurrence is stored as the first element in
// the array of strings. We then continue in this manner by searching
// the substring that follows the occurrence. On the other hand, if the separator
// is not found, the array of strings will contain this instance as its only element.
// If the separator is the empty string (i.e., string.Empty), then
// whitespace (i.e., Character.IsWhitespace) is used as the separator.
// If there are more than count different strings, the last n-(count-1)
// elements are concatenated and added as the last string.
//
public string[] Split(char[]? separator, int count)
{
return SplitInternal(separator, count, StringSplitOptions.None);
}
public string[] Split(char[]? separator, StringSplitOptions options)
{
return SplitInternal(separator, int.MaxValue, options);
}
public string[] Split(char[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(separator, count, options);
}
private string[] SplitInternal(ReadOnlySpan<char> separators, int count, StringSplitOptions options)
{
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count),
SR.ArgumentOutOfRange_NegativeCount);
CheckStringSplitOptions(options);
ShortCircuit:
if (count <= 1 || Length == 0)
{
// Per the method's documentation, we'll short-circuit the search for separators.
// But we still need to post-process the results based on the caller-provided flags.
string candidate = this;
if (((options & StringSplitOptions.TrimEntries) != 0) && (count > 0))
{
candidate = candidate.Trim();
}
if (((options & StringSplitOptions.RemoveEmptyEntries) != 0) && (candidate.Length == 0))
{
count = 0;
}
return (count == 0) ? Array.Empty<string>() : new string[] { candidate };
}
if (separators.IsEmpty)
{
// Caller is already splitting on whitespace; no need for separate trim step
options &= ~StringSplitOptions.TrimEntries;
}
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separators, ref sepListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
// Handle the special case of no replaces.
if (sepList.Length == 0)
{
count = 1;
goto ShortCircuit;
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, default, 1, count, options)
: SplitWithoutPostProcessing(sepList, default, 1, count);
sepListBuilder.Dispose();
return result;
}
public string[] Split(string? separator, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, int.MaxValue, options);
}
public string[] Split(string? separator, int count, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, count, options);
}
public string[] Split(string[]? separator, StringSplitOptions options)
{
return SplitInternal(null, separator, int.MaxValue, options);
}
public string[] Split(string[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(null, separator, count, options);
}
private string[] SplitInternal(string? separator, string?[]? separators, int count, StringSplitOptions options)
{
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count),
SR.ArgumentOutOfRange_NegativeCount);
}
CheckStringSplitOptions(options);
bool singleSeparator = separator != null;
if (!singleSeparator && (separators == null || separators.Length == 0))
{
// split on whitespace
return SplitInternal(default(ReadOnlySpan<char>), count, options);
}
ShortCircuit:
if (count <= 1 || Length == 0)
{
// Per the method's documentation, we'll short-circuit the search for separators.
// But we still need to post-process the results based on the caller-provided flags.
string candidate = this;
if (((options & StringSplitOptions.TrimEntries) != 0) && (count > 0))
{
candidate = candidate.Trim();
}
if (((options & StringSplitOptions.RemoveEmptyEntries) != 0) && (candidate.Length == 0))
{
count = 0;
}
return (count == 0) ? Array.Empty<string>() : new string[] { candidate };
}
if (singleSeparator)
{
if (separator!.Length == 0)
{
count = 1;
goto ShortCircuit;
}
else
{
return SplitInternal(separator, count, options);
}
}
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
var lengthListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separators!, ref sepListBuilder, ref lengthListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
ReadOnlySpan<int> lengthList = lengthListBuilder.AsSpan();
// Handle the special case of no replaces.
if (sepList.Length == 0)
{
return new string[] { this };
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, lengthList, 0, count, options)
: SplitWithoutPostProcessing(sepList, lengthList, 0, count);
sepListBuilder.Dispose();
lengthListBuilder.Dispose();
return result;
}
private string[] SplitInternal(string separator, int count, StringSplitOptions options)
{
var sepListBuilder = new ValueListBuilder<int>(stackalloc int[StackallocIntBufferSizeLimit]);
MakeSeparatorList(separator, ref sepListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
if (sepList.Length == 0)
{
// there are no separators so sepListBuilder did not rent an array from pool and there is no need to dispose it
string candidate = this;
if ((options & StringSplitOptions.TrimEntries) != 0)
{
candidate = candidate.Trim();
}
return ((candidate.Length == 0) && ((options & StringSplitOptions.RemoveEmptyEntries) != 0))
? Array.Empty<string>()
: new string[] { candidate };
}
string[] result = (options != StringSplitOptions.None)
? SplitWithPostProcessing(sepList, default, separator.Length, count, options)
: SplitWithoutPostProcessing(sepList, default, separator.Length, count);
sepListBuilder.Dispose();
return result;
}
// This function will not trim entries or special-case empty entries
private string[] SplitWithoutPostProcessing(ReadOnlySpan<int> sepList, ReadOnlySpan<int> lengthList, int defaultLength, int count)
{
Debug.Assert(count >= 2);
int currIndex = 0;
int arrIndex = 0;
count--;
int numActualReplaces = (sepList.Length < count) ? sepList.Length : count;
// Allocate space for the new array.
// +1 for the string from the end of the last replace to the end of the string.
string[] splitStrings = new string[numActualReplaces + 1];
for (int i = 0; i < numActualReplaces && currIndex < Length; i++)
{
splitStrings[arrIndex++] = Substring(currIndex, sepList[i] - currIndex);
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
}
// Handle the last string at the end of the array if there is one.
if (currIndex < Length && numActualReplaces >= 0)
{
splitStrings[arrIndex] = Substring(currIndex);
}
else if (arrIndex == numActualReplaces)
{
// We had a separator character at the end of a string. Rather than just allowing
// a null character, we'll replace the last element in the array with an empty string.
splitStrings[arrIndex] = string.Empty;
}
return splitStrings;
}
// This function may trim entries or omit empty entries
private string[] SplitWithPostProcessing(ReadOnlySpan<int> sepList, ReadOnlySpan<int> lengthList, int defaultLength, int count, StringSplitOptions options)
{
Debug.Assert(count >= 2);
int numReplaces = sepList.Length;
// Allocate array to hold items. This array may not be
// filled completely in this function, we will create a
// new array and copy string references to that new array.
int maxItems = (numReplaces < count) ? (numReplaces + 1) : count;
string[] splitStrings = new string[maxItems];
int currIndex = 0;
int arrIndex = 0;
ReadOnlySpan<char> thisEntry;
for (int i = 0; i < numReplaces; i++)
{
thisEntry = this.AsSpan(currIndex, sepList[i] - currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty || ((options & StringSplitOptions.RemoveEmptyEntries) == 0))
{
splitStrings[arrIndex++] = thisEntry.ToString();
}
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
if (arrIndex == count - 1)
{
// The next iteration of the loop will provide the final entry into the
// results array. If needed, skip over all empty entries before that
// point.
if ((options & StringSplitOptions.RemoveEmptyEntries) != 0)
{
while (++i < numReplaces)
{
thisEntry = this.AsSpan(currIndex, sepList[i] - currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty)
{
break; // there's useful data here
}
currIndex = sepList[i] + (lengthList.IsEmpty ? defaultLength : lengthList[i]);
}
}
break;
}
}
// we must have at least one slot left to fill in the last string.
Debug.Assert(arrIndex < maxItems);
// Handle the last substring at the end of the array
// (could be empty if separator appeared at the end of the input string)
thisEntry = this.AsSpan(currIndex);
if ((options & StringSplitOptions.TrimEntries) != 0)
{
thisEntry = thisEntry.Trim();
}
if (!thisEntry.IsEmpty || ((options & StringSplitOptions.RemoveEmptyEntries) == 0))
{
splitStrings[arrIndex++] = thisEntry.ToString();
}
Array.Resize(ref splitStrings, arrIndex);
return splitStrings;
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string.
/// </summary>
/// <param name="separators"><see cref="ReadOnlySpan{T}"/> of separator chars</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> to store indexes</param>
private void MakeSeparatorList(ReadOnlySpan<char> separators, ref ValueListBuilder<int> sepListBuilder)
{
// Special-case no separators to mean any whitespace is a separator.
if (separators.Length == 0)
{
for (int i = 0; i < Length; i++)
{
if (char.IsWhiteSpace(this[i]))
{
sepListBuilder.Append(i);
}
}
}
// Special-case the common cases of 1, 2, and 3 separators, with manual comparisons against each separator.
else if (separators.Length <= 3)
{
char sep0, sep1, sep2;
sep0 = separators[0];
sep1 = separators.Length > 1 ? separators[1] : sep0;
sep2 = separators.Length > 2 ? separators[2] : sep1;
if (Length >= 16 && Sse41.IsSupported)
{
MakeSeparatorListVectorized(ref sepListBuilder, sep0, sep1, sep2);
return;
}
for (int i = 0; i < Length; i++)
{
char c = this[i];
if (c == sep0 || c == sep1 || c == sep2)
{
sepListBuilder.Append(i);
}
}
}
// Handle > 3 separators with a probabilistic map, ala IndexOfAny.
// This optimizes for chars being unlikely to match a separator.
else
{
unsafe
{
ProbabilisticMap map = default;
uint* charMap = (uint*)↦
ProbabilisticMap.Initialize(charMap, separators);
for (int i = 0; i < Length; i++)
{
char c = this[i];
if (ProbabilisticMap.IsCharBitSet(charMap, (byte)c) &&
ProbabilisticMap.IsCharBitSet(charMap, (byte)(c >> 8)) &&
separators.Contains(c))
{
sepListBuilder.Append(i);
}
}
}
}
}
private void MakeSeparatorListVectorized(ref ValueListBuilder<int> sepListBuilder, char c, char c2, char c3)
{
// Redundant test so we won't prejit remainder of this method
// on platforms without SSE.
if (!Sse41.IsSupported)
{
throw new PlatformNotSupportedException();
}
// Constant that allows for the truncation of 16-bit (FFFF/0000) values within a register to 4-bit (F/0)
Vector128<byte> shuffleConstant = Vector128.Create(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
Vector128<ushort> v1 = Vector128.Create((ushort)c);
Vector128<ushort> v2 = Vector128.Create((ushort)c2);
Vector128<ushort> v3 = Vector128.Create((ushort)c3);
ref char c0 = ref MemoryMarshal.GetReference(this.AsSpan());
int cond = Length & -Vector128<ushort>.Count;
int i = 0;
for (; i < cond; i += Vector128<ushort>.Count)
{
Vector128<ushort> charVector = ReadVector(ref c0, i);
Vector128<ushort> cmp = Sse2.CompareEqual(charVector, v1);
cmp = Sse2.Or(Sse2.CompareEqual(charVector, v2), cmp);
cmp = Sse2.Or(Sse2.CompareEqual(charVector, v3), cmp);
if (Sse41.TestZ(cmp, cmp)) { continue; }
Vector128<byte> mask = Sse2.ShiftRightLogical(cmp.AsUInt64(), 4).AsByte();
mask = Ssse3.Shuffle(mask, shuffleConstant);
uint lowBits = Sse2.ConvertToUInt32(mask.AsUInt32());
mask = Sse2.ShiftRightLogical(mask.AsUInt64(), 32).AsByte();
uint highBits = Sse2.ConvertToUInt32(mask.AsUInt32());
for (int idx = i; lowBits != 0; idx++)
{
if ((lowBits & 0xF) != 0)
{
sepListBuilder.Append(idx);
}
lowBits >>= 8;
}
for (int idx = i + 4; highBits != 0; idx++)
{
if ((highBits & 0xF) != 0)
{
sepListBuilder.Append(idx);
}
highBits >>= 8;
}
}
for (; i < Length; i++)
{
char curr = Unsafe.Add(ref c0, (IntPtr)(uint)i);
if (curr == c || curr == c2 || curr == c3)
{
sepListBuilder.Append(i);
}
}
static Vector128<ushort> ReadVector(ref char c0, int offset)
{
ref char ci = ref Unsafe.Add(ref c0, (IntPtr)(uint)offset);
ref byte b = ref Unsafe.As<char, byte>(ref ci);
return Unsafe.ReadUnaligned<Vector128<ushort>>(ref b);
}
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string.
/// </summary>
/// <param name="separator">separator string</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> to store indexes</param>
private void MakeSeparatorList(string separator, ref ValueListBuilder<int> sepListBuilder)
{
Debug.Assert(!IsNullOrEmpty(separator), "!string.IsNullOrEmpty(separator)");
int currentSepLength = separator.Length;
for (int i = 0; i < Length; i++)
{
if (this[i] == separator[0] && currentSepLength <= Length - i)
{
if (currentSepLength == 1
|| this.AsSpan(i, currentSepLength).SequenceEqual(separator))
{
sepListBuilder.Append(i);
i += currentSepLength - 1;
}
}
}
}
/// <summary>
/// Uses ValueListBuilder to create list that holds indexes of separators in string and list that holds length of separator strings.
/// </summary>
/// <param name="separators">separator strngs</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> for separator indexes</param>
/// <param name="lengthListBuilder"><see cref="ValueListBuilder{T}"/> for separator length values</param>
private void MakeSeparatorList(string?[] separators, ref ValueListBuilder<int> sepListBuilder, ref ValueListBuilder<int> lengthListBuilder)
{
Debug.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0");
for (int i = 0; i < Length; i++)
{
for (int j = 0; j < separators.Length; j++)
{
string? separator = separators[j];
if (IsNullOrEmpty(separator))
{
continue;
}
int currentSepLength = separator.Length;
if (this[i] == separator[0] && currentSepLength <= Length - i)
{
if (currentSepLength == 1
|| this.AsSpan(i, currentSepLength).SequenceEqual(separator))
{
sepListBuilder.Append(i);
lengthListBuilder.Append(currentSepLength);
i += currentSepLength - 1;
break;
}
}
}
}
}
private static void CheckStringSplitOptions(StringSplitOptions options)
{
const StringSplitOptions AllValidFlags = StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries;
if ((options & ~AllValidFlags) != 0)
{
// at least one invalid flag was set
ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidFlag, ExceptionArgument.options);
}
}
// Returns a substring of this string.
//
public string Substring(int startIndex) => Substring(startIndex, Length - startIndex);
public string Substring(int startIndex, int length)
{
if (startIndex < 0)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex);
}
if (startIndex > Length)
{
throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength);
}
if (length < 0)
{
throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength);
}
if (startIndex > Length - length)
{
throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength);
}
if (length == 0)
{
return string.Empty;
}
if (startIndex == 0 && length == this.Length)
{
return this;
}
return InternalSubString(startIndex, length);
}
private string InternalSubString(int startIndex, int length)
{
Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!");
Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!");
string result = FastAllocateString(length);
Buffer.Memmove(
elementCount: (uint)result.Length, // derefing Length now allows JIT to prove 'result' not null below
destination: ref result._firstChar,
source: ref Unsafe.Add(ref _firstChar, (nint)(uint)startIndex /* force zero-extension */));
return result;
}
// Creates a copy of this string in lower case. The culture is set by culture.
public string ToLower() => ToLower(null);
// Creates a copy of this string in lower case. The culture is set by culture.
public string ToLower(CultureInfo? culture)
{
CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
return cult.TextInfo.ToLower(this);
}
// Creates a copy of this string in lower case based on invariant culture.
public string ToLowerInvariant()
{
return TextInfo.Invariant.ToLower(this);
}
public string ToUpper() => ToUpper(null);
// Creates a copy of this string in upper case. The culture is set by culture.
public string ToUpper(CultureInfo? culture)
{
CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
return cult.TextInfo.ToUpper(this);
}
// Creates a copy of this string in upper case based on invariant culture.
public string ToUpperInvariant()
{
return TextInfo.Invariant.ToUpper(this);
}
// Trims the whitespace from both ends of the string. Whitespace is defined by
// char.IsWhiteSpace.
//
public string Trim() => TrimWhiteSpaceHelper(TrimType.Both);
// Removes a set of characters from the beginning and end of this string.
public unsafe string Trim(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Both);
// Removes a set of characters from the beginning and end of this string.
public unsafe string Trim(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Both);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both);
}
}
// Removes a set of characters from the beginning of this string.
public string TrimStart() => TrimWhiteSpaceHelper(TrimType.Head);
// Removes a set of characters from the beginning of this string.
public unsafe string TrimStart(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Head);
// Removes a set of characters from the beginning of this string.
public unsafe string TrimStart(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Head);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head);
}
}
// Removes a set of characters from the end of this string.
public string TrimEnd() => TrimWhiteSpaceHelper(TrimType.Tail);
// Removes a set of characters from the end of this string.
public unsafe string TrimEnd(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Tail);
// Removes a set of characters from the end of this string.
public unsafe string TrimEnd(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
return TrimWhiteSpaceHelper(TrimType.Tail);
}
fixed (char* pTrimChars = &trimChars[0])
{
return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
}
}
private string TrimWhiteSpaceHelper(TrimType trimType)
{
// end will point to the first non-trimmed character on the right.
// start will point to the first non-trimmed character on the left.
int end = Length - 1;
int start = 0;
// Trim specified characters.
if ((trimType & TrimType.Head) != 0)
{
for (start = 0; start < Length; start++)
{
if (!char.IsWhiteSpace(this[start]))
{
break;
}
}
}
if ((trimType & TrimType.Tail) != 0)
{
for (end = Length - 1; end >= start; end--)
{
if (!char.IsWhiteSpace(this[end]))
{
break;
}
}
}
return CreateTrimmedString(start, end);
}
private unsafe string TrimHelper(char* trimChars, int trimCharsLength, TrimType trimType)
{
Debug.Assert(trimChars != null);
Debug.Assert(trimCharsLength > 0);
// end will point to the first non-trimmed character on the right.
// start will point to the first non-trimmed character on the left.
int end = Length - 1;
int start = 0;
// Trim specified characters.
if ((trimType & TrimType.Head) != 0)
{
for (start = 0; start < Length; start++)
{
int i = 0;
char ch = this[start];
for (i = 0; i < trimCharsLength; i++)
{
if (trimChars[i] == ch)
{
break;
}
}
if (i == trimCharsLength)
{
// The character is not in trimChars, so stop trimming.
break;
}
}
}
if ((trimType & TrimType.Tail) != 0)
{
for (end = Length - 1; end >= start; end--)
{
int i = 0;
char ch = this[end];
for (i = 0; i < trimCharsLength; i++)
{
if (trimChars[i] == ch)
{
break;
}
}
if (i == trimCharsLength)
{
// The character is not in trimChars, so stop trimming.
break;
}
}
}
return CreateTrimmedString(start, end);
}
private string CreateTrimmedString(int start, int end)
{
int len = end - start + 1;
return
len == Length ? this :
len == 0 ? string.Empty :
InternalSubString(start, len);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/SpanTests.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.IO;
using Xunit;
namespace System.Text.Json.Serialization.Tests
{
public static class SpanTests
{
[Fact]
public static void ParseNullTypeFail()
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.Deserialize(new ReadOnlySpan<byte>(), (Type)null));
}
[Theory]
[MemberData(nameof(ReadSuccessCases))]
public static void Read(Type classType, byte[] data)
{
var options = new JsonSerializerOptions { IncludeFields = true };
object obj = JsonSerializer.Deserialize(data, classType, options);
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
}
[Theory]
[MemberData(nameof(ReadSuccessCases))]
public static void ReadFromStream(Type classType, byte[] data)
{
MemoryStream stream = new MemoryStream(data);
var options = new JsonSerializerOptions { IncludeFields = true };
object obj = JsonSerializer.DeserializeAsync(
stream,
classType,
options).Result;
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
// Try again with a smaller initial buffer size to ensure we handle incomplete data
stream = new MemoryStream(data);
obj = JsonSerializer.DeserializeAsync(
stream,
classType,
new JsonSerializerOptions { DefaultBufferSize = 5, IncludeFields = true }).Result;
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
}
[Fact]
public static void ReadGenericApi()
{
SimpleTestClass obj = JsonSerializer.Deserialize<SimpleTestClass>(SimpleTestClass.s_data);
obj.Verify();
}
[Fact]
public static void ParseUntyped()
{
byte[] bytes = Encoding.UTF8.GetBytes("42");
object obj = JsonSerializer.Deserialize(bytes, typeof(object));
Assert.IsType<JsonElement>(obj);
JsonElement element = (JsonElement)obj;
Assert.Equal(JsonValueKind.Number, element.ValueKind);
Assert.Equal(42, element.GetInt32());
}
[Fact]
public static void ToStringNullTypeFail()
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.Serialize(new object(), (Type)null));
}
[Fact]
public static void VerifyTypeFail()
{
Assert.Throws<ArgumentException>(() => JsonSerializer.Serialize(1, typeof(string)));
}
[Fact]
public static void NullObjectOutput()
{
byte[] encodedNull = Encoding.UTF8.GetBytes(@"null");
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.SerializeToUtf8Bytes(null, null));
}
{
byte[] output = JsonSerializer.SerializeToUtf8Bytes(null, typeof(NullTests));
Assert.Equal(encodedNull, output);
}
}
public static IEnumerable<object[]> ReadSuccessCases
{
get
{
return TestData.ReadSuccessCases;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.IO;
using Xunit;
namespace System.Text.Json.Serialization.Tests
{
public static class SpanTests
{
[Fact]
public static void ParseNullTypeFail()
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.Deserialize(new ReadOnlySpan<byte>(), (Type)null));
}
[Theory]
[MemberData(nameof(ReadSuccessCases))]
public static void Read(Type classType, byte[] data)
{
var options = new JsonSerializerOptions { IncludeFields = true };
object obj = JsonSerializer.Deserialize(data, classType, options);
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
}
[Theory]
[MemberData(nameof(ReadSuccessCases))]
public static void ReadFromStream(Type classType, byte[] data)
{
MemoryStream stream = new MemoryStream(data);
var options = new JsonSerializerOptions { IncludeFields = true };
object obj = JsonSerializer.DeserializeAsync(
stream,
classType,
options).Result;
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
// Try again with a smaller initial buffer size to ensure we handle incomplete data
stream = new MemoryStream(data);
obj = JsonSerializer.DeserializeAsync(
stream,
classType,
new JsonSerializerOptions { DefaultBufferSize = 5, IncludeFields = true }).Result;
Assert.IsAssignableFrom<ITestClass>(obj);
((ITestClass)obj).Verify();
}
[Fact]
public static void ReadGenericApi()
{
SimpleTestClass obj = JsonSerializer.Deserialize<SimpleTestClass>(SimpleTestClass.s_data);
obj.Verify();
}
[Fact]
public static void ParseUntyped()
{
byte[] bytes = Encoding.UTF8.GetBytes("42");
object obj = JsonSerializer.Deserialize(bytes, typeof(object));
Assert.IsType<JsonElement>(obj);
JsonElement element = (JsonElement)obj;
Assert.Equal(JsonValueKind.Number, element.ValueKind);
Assert.Equal(42, element.GetInt32());
}
[Fact]
public static void ToStringNullTypeFail()
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.Serialize(new object(), (Type)null));
}
[Fact]
public static void VerifyTypeFail()
{
Assert.Throws<ArgumentException>(() => JsonSerializer.Serialize(1, typeof(string)));
}
[Fact]
public static void NullObjectOutput()
{
byte[] encodedNull = Encoding.UTF8.GetBytes(@"null");
{
Assert.Throws<ArgumentNullException>(() => JsonSerializer.SerializeToUtf8Bytes(null, null));
}
{
byte[] output = JsonSerializer.SerializeToUtf8Bytes(null, typeof(NullTests));
Assert.Equal(encodedNull, output);
}
}
public static IEnumerable<object[]> ReadSuccessCases
{
get
{
return TestData.ReadSuccessCases;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="castclass037.cs" />
<Compile Include="..\structdef.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="castclass037.cs" />
<Compile Include="..\structdef.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Generics/Parameters/instance_passing_struct01.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
public struct ValX0 { }
public struct ValY0 { }
public struct ValX1<T> { }
public struct ValY1<T> { }
public struct ValX2<T, U> { }
public struct ValY2<T, U> { }
public struct ValX3<T, U, V> { }
public struct ValY3<T, U, V> { }
public class RefX0 { }
public class RefY0 { }
public class RefX1<T> { }
public class RefY1<T> { }
public class RefX2<T, U> { }
public class RefY2<T, U> { }
public class RefX3<T, U, V> { }
public class RefY3<T, U, V> { }
public struct Gen<T>
{
public T PassAsIn(T t)
{
return t;
}
public T PassAsRef(ref T t, T Fld2)
{
T temp = t;
t = Fld2;
return temp;
}
public void PassAsOut(out T t, T Fld2)
{
t = Fld2;
}
public void PassAsParameter(T t1, T t2)
{
T temp = t1;
Test_instance_passing_struct01.Eval(t1.Equals(PassAsIn(temp)));
Test_instance_passing_struct01.Eval(t1.Equals(PassAsRef(ref temp, t2)));
Test_instance_passing_struct01.Eval(t2.Equals(temp));
temp = t1;
PassAsOut(out temp, t2);
Test_instance_passing_struct01.Eval(t2.Equals(temp));
}
}
public class Test_instance_passing_struct01
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
int _int1 = 1;
int _int2 = -1;
new Gen<int>().PassAsParameter(_int1, _int2);
double _double1 = 1;
double _double2 = -1;
new Gen<double>().PassAsParameter(_double1, _double2);
string _string1 = "string1";
string _string2 = "string2";
new Gen<string>().PassAsParameter(_string1, _string2);
object _object1 = (object)_string1;
object _object2 = (object)_string2;
new Gen<object>().PassAsParameter(_object1, _object2);
Guid _Guid1 = new Guid(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Guid _Guid2 = new Guid(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
new Gen<Guid>().PassAsParameter(_Guid1, _Guid2);
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
public struct ValX0 { }
public struct ValY0 { }
public struct ValX1<T> { }
public struct ValY1<T> { }
public struct ValX2<T, U> { }
public struct ValY2<T, U> { }
public struct ValX3<T, U, V> { }
public struct ValY3<T, U, V> { }
public class RefX0 { }
public class RefY0 { }
public class RefX1<T> { }
public class RefY1<T> { }
public class RefX2<T, U> { }
public class RefY2<T, U> { }
public class RefX3<T, U, V> { }
public class RefY3<T, U, V> { }
public struct Gen<T>
{
public T PassAsIn(T t)
{
return t;
}
public T PassAsRef(ref T t, T Fld2)
{
T temp = t;
t = Fld2;
return temp;
}
public void PassAsOut(out T t, T Fld2)
{
t = Fld2;
}
public void PassAsParameter(T t1, T t2)
{
T temp = t1;
Test_instance_passing_struct01.Eval(t1.Equals(PassAsIn(temp)));
Test_instance_passing_struct01.Eval(t1.Equals(PassAsRef(ref temp, t2)));
Test_instance_passing_struct01.Eval(t2.Equals(temp));
temp = t1;
PassAsOut(out temp, t2);
Test_instance_passing_struct01.Eval(t2.Equals(temp));
}
}
public class Test_instance_passing_struct01
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
int _int1 = 1;
int _int2 = -1;
new Gen<int>().PassAsParameter(_int1, _int2);
double _double1 = 1;
double _double2 = -1;
new Gen<double>().PassAsParameter(_double1, _double2);
string _string1 = "string1";
string _string2 = "string2";
new Gen<string>().PassAsParameter(_string1, _string2);
object _object1 = (object)_string1;
object _object2 = (object)_string2;
new Gen<object>().PassAsParameter(_object1, _object2);
Guid _Guid1 = new Guid(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Guid _Guid2 = new Guid(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
new Gen<Guid>().PassAsParameter(_Guid1, _Guid2);
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/Scenarios/WeakReference/weakreffinal.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace DefaultNamespace {
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
internal class CreateObj
{
public BNode []rgNode;
public List<WeakReference> alWeakRef;
public bool bret;
public CreateObj(int iObj)
{
rgNode = new BNode[iObj];
alWeakRef = new List<WeakReference>();
bret = true;
}
public bool RunTest(int iObj,int iSwitch)
{
DeleteObj(iObj,iSwitch);
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
bool result = CheckResult(iObj,iSwitch);
return result;
}
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void DeleteObj(int iObj,int iSwitch)
{
for( int i= 0; i< iObj; i++ )
{
rgNode[i] = new BNode( i+1 );
alWeakRef.Add( new WeakReference( rgNode[i], (iSwitch == 1) ) );
}
GC.Collect();
for( int i=0; i< iObj; i++)
{
if ( (alWeakRef[ i ]).Target == null )
{
//*all weakref have strong reference, so it should not return null
bret = false;
}
}
for( int i=0; i< iObj; i++)
{
rgNode[i] = null;
}
}
public bool CheckResult(int iObj,int iSwitch)
{
for( int i=0; i< iObj; i++)
{
if(iSwitch == 1)
{
if ( (alWeakRef[ i ]).Target == null )
{
//*weakrefs have strong reference, so it should not return null
bret = false;
}
}
else
{
if ( (alWeakRef[ i ]).Target != null )
{
//*no weakref have strong reference, so it should return null
bret = false;
}
}
}
for(int i=0; i< iObj; i++ )
{
rgNode[i] = (BNode)BNode.ResObj[ i ];
}
return bret;
}
}
internal class WeakRefFinal
{
public bool RealWeakRef(int iObj, int iSwitch)
{
CreateObj temp = new CreateObj(iObj);
bool result = temp.RunTest(iObj,iSwitch);
return result;
}
}
internal class BNode
{
public static int icCreateNode = 0;
public static int icFinalNode = 0;
internal int [] mem;
public static List<BNode> ResObj = new List<BNode>();
public BNode( int i )
{
icCreateNode++;
mem = new int[i];
mem[0] = 0;
if(i > 1 )
{
mem[mem.Length-1] = mem.Length-1;
}
}
~BNode()
{
icFinalNode++;
ResObj.Add( this );
}
}
internal class CreateObj2
{
public WeakRefFinal mv_Obj;
public CreateObj2()
{
mv_Obj = new WeakRefFinal();
}
public bool RunTest(int iObj,int iSwitch)
{
return ( mv_Obj.RealWeakRef( iObj, iSwitch ));
}
}
internal class Test
{
public static int Main(String [] Args)
{
int iObj = 0;
int iSwitch = 0;
Console.WriteLine("Test should return with ExitCode 100 ...");
if (Args.Length >=2)
{
if (!Int32.TryParse( Args[0], out iObj ))
{
iObj = 10;
}
if (!Int32.TryParse( Args[1], out iSwitch ))
{
iSwitch = 1;
}
}
else
{
iObj = 10;
iSwitch = 1;
}
CreateObj2 temp = new CreateObj2();
if (temp.RunTest(iObj,iSwitch))
{
Console.WriteLine("Test Passed");
return 100;
}
Console.WriteLine("Test Failed");
return 1;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace DefaultNamespace {
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
internal class CreateObj
{
public BNode []rgNode;
public List<WeakReference> alWeakRef;
public bool bret;
public CreateObj(int iObj)
{
rgNode = new BNode[iObj];
alWeakRef = new List<WeakReference>();
bret = true;
}
public bool RunTest(int iObj,int iSwitch)
{
DeleteObj(iObj,iSwitch);
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
bool result = CheckResult(iObj,iSwitch);
return result;
}
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void DeleteObj(int iObj,int iSwitch)
{
for( int i= 0; i< iObj; i++ )
{
rgNode[i] = new BNode( i+1 );
alWeakRef.Add( new WeakReference( rgNode[i], (iSwitch == 1) ) );
}
GC.Collect();
for( int i=0; i< iObj; i++)
{
if ( (alWeakRef[ i ]).Target == null )
{
//*all weakref have strong reference, so it should not return null
bret = false;
}
}
for( int i=0; i< iObj; i++)
{
rgNode[i] = null;
}
}
public bool CheckResult(int iObj,int iSwitch)
{
for( int i=0; i< iObj; i++)
{
if(iSwitch == 1)
{
if ( (alWeakRef[ i ]).Target == null )
{
//*weakrefs have strong reference, so it should not return null
bret = false;
}
}
else
{
if ( (alWeakRef[ i ]).Target != null )
{
//*no weakref have strong reference, so it should return null
bret = false;
}
}
}
for(int i=0; i< iObj; i++ )
{
rgNode[i] = (BNode)BNode.ResObj[ i ];
}
return bret;
}
}
internal class WeakRefFinal
{
public bool RealWeakRef(int iObj, int iSwitch)
{
CreateObj temp = new CreateObj(iObj);
bool result = temp.RunTest(iObj,iSwitch);
return result;
}
}
internal class BNode
{
public static int icCreateNode = 0;
public static int icFinalNode = 0;
internal int [] mem;
public static List<BNode> ResObj = new List<BNode>();
public BNode( int i )
{
icCreateNode++;
mem = new int[i];
mem[0] = 0;
if(i > 1 )
{
mem[mem.Length-1] = mem.Length-1;
}
}
~BNode()
{
icFinalNode++;
ResObj.Add( this );
}
}
internal class CreateObj2
{
public WeakRefFinal mv_Obj;
public CreateObj2()
{
mv_Obj = new WeakRefFinal();
}
public bool RunTest(int iObj,int iSwitch)
{
return ( mv_Obj.RealWeakRef( iObj, iSwitch ));
}
}
internal class Test
{
public static int Main(String [] Args)
{
int iObj = 0;
int iSwitch = 0;
Console.WriteLine("Test should return with ExitCode 100 ...");
if (Args.Length >=2)
{
if (!Int32.TryParse( Args[0], out iObj ))
{
iObj = 10;
}
if (!Int32.TryParse( Args[1], out iSwitch ))
{
iSwitch = 1;
}
}
else
{
iObj = 10;
iSwitch = 1;
}
CreateObj2 temp = new CreateObj2();
if (temp.RunTest(iObj,iSwitch))
{
Console.WriteLine("Test Passed");
return 100;
}
Console.WriteLine("Test Failed");
return 1;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Runtime.Loader/tests/ReferencedClassLibNeutralIsSatellite/ReferencedClassLibNeutralIsSatellite.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReferencedClassLibNeutralIsSatellite.cs" />
<EmbeddedResource Include="ReferencedStrings*.resx" />
</ItemGroup>
</Project> | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="ReferencedClassLibNeutralIsSatellite.cs" />
<EmbeddedResource Include="ReferencedStrings*.resx" />
</ItemGroup>
</Project> | -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Text;
namespace ILCompiler.Reflection.ReadyToRun
{
public class PEExportTable
{
private readonly Dictionary<string, int> _namedExportRva;
private readonly Dictionary<int, int> _ordinalRva;
private PEExportTable(PEReader peReader)
{
_namedExportRva = new Dictionary<string, int>();
_ordinalRva = new Dictionary<int, int>();
DirectoryEntry exportTable = peReader.PEHeaders.PEHeader.ExportTableDirectory;
if ((exportTable.Size == 0) || (exportTable.RelativeVirtualAddress == 0))
return;
PEMemoryBlock peImage = peReader.GetEntireImage();
BlobReader exportTableHeader = peImage.GetReader(peReader.GetOffset(exportTable.RelativeVirtualAddress), exportTable.Size);
if (exportTableHeader.Length == 0)
{
return;
}
// +0x00: reserved
exportTableHeader.ReadUInt32();
// +0x04: TODO: time/date stamp
exportTableHeader.ReadUInt32();
// +0x08: major version
exportTableHeader.ReadUInt16();
// +0x0A: minor version
exportTableHeader.ReadUInt16();
// +0x0C: DLL name RVA
exportTableHeader.ReadUInt32();
// +0x10: ordinal base
int minOrdinal = exportTableHeader.ReadInt32();
// +0x14: number of entries in the address table
int addressEntryCount = exportTableHeader.ReadInt32();
// +0x18: number of name pointers
int namePointerCount = exportTableHeader.ReadInt32();
// +0x1C: export address table RVA
int addressTableRVA = exportTableHeader.ReadInt32();
// +0x20: name pointer RVA
int namePointerRVA = exportTableHeader.ReadInt32();
// +0x24: ordinal table RVA
int ordinalTableRVA = exportTableHeader.ReadInt32();
int[] addressTable = new int[addressEntryCount];
BlobReader addressTableReader = peImage.GetReader(peReader.GetOffset(addressTableRVA), sizeof(int) * addressEntryCount);
for (int entryIndex = 0; entryIndex < addressEntryCount; entryIndex++)
{
addressTable[entryIndex] = addressTableReader.ReadInt32();
}
ushort[] ordinalTable = new ushort[namePointerCount];
BlobReader ordinalTableReader = peImage.GetReader(peReader.GetOffset(ordinalTableRVA), sizeof(ushort) * namePointerCount);
for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++)
{
ushort ordinalIndex = ordinalTableReader.ReadUInt16();
ordinalTable[entryIndex] = ordinalIndex;
_ordinalRva.Add(entryIndex + minOrdinal, addressTable[ordinalIndex]);
}
BlobReader namePointerReader = peImage.GetReader(peReader.GetOffset(namePointerRVA), sizeof(int) * namePointerCount);
for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++)
{
int nameRVA = namePointerReader.ReadInt32();
if (nameRVA != 0)
{
int nameOffset = peReader.GetOffset(nameRVA);
BlobReader nameReader = peImage.GetReader(nameOffset, peImage.Length - nameOffset);
StringBuilder nameBuilder = new StringBuilder();
for (byte ascii; (ascii = nameReader.ReadByte()) != 0;)
{
nameBuilder.Append((char)ascii);
}
_namedExportRva.Add(nameBuilder.ToString(), addressTable[ordinalTable[entryIndex]]);
}
}
}
public static PEExportTable Parse(PEReader peReader)
{
return new PEExportTable(peReader);
}
public bool TryGetValue(string exportName, out int rva) => _namedExportRva.TryGetValue(exportName, out rva);
public bool TryGetValue(int ordinal, out int rva) => _ordinalRva.TryGetValue(ordinal, out rva);
}
public static class PEReaderExtensions
{
/// <summary>
/// Get the index in the image byte array corresponding to the RVA
/// </summary>
/// <param name="reader">PE reader representing the executable image to parse</param>
/// <param name="rva">The relative virtual address</param>
public static int GetOffset(this PEReader reader, int rva)
{
int index = reader.PEHeaders.GetContainingSectionIndex(rva);
if (index == -1)
{
throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva);
}
SectionHeader containingSection = reader.PEHeaders.SectionHeaders[index];
return rva - containingSection.VirtualAddress + containingSection.PointerToRawData;
}
/// <summary>
/// Parse export table directory for a given PE reader.
/// </summary>
/// <param name="reader">PE reader representing the executable image to parse</param>
public static PEExportTable GetExportTable(this PEReader reader)
{
return PEExportTable.Parse(reader);
}
/// <summary>
/// Check whether the file is a ReadyToRun image and returns the RVA of its ReadyToRun header if positive.
/// </summary>
/// <param name="reader">PEReader representing the executable to check for the presence of ReadyToRun header</param>
/// <param name="rva">RVA of the ReadyToRun header if available, 0 when not</param>
/// <returns>true when the PEReader represents a ReadyToRun image, false otherwise</returns>
public static bool TryGetReadyToRunHeader(this PEReader reader, out int rva)
{
return reader.GetExportTable().TryGetValue("RTR_HEADER", out rva);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Text;
namespace ILCompiler.Reflection.ReadyToRun
{
public class PEExportTable
{
private readonly Dictionary<string, int> _namedExportRva;
private readonly Dictionary<int, int> _ordinalRva;
private PEExportTable(PEReader peReader)
{
_namedExportRva = new Dictionary<string, int>();
_ordinalRva = new Dictionary<int, int>();
DirectoryEntry exportTable = peReader.PEHeaders.PEHeader.ExportTableDirectory;
if ((exportTable.Size == 0) || (exportTable.RelativeVirtualAddress == 0))
return;
PEMemoryBlock peImage = peReader.GetEntireImage();
BlobReader exportTableHeader = peImage.GetReader(peReader.GetOffset(exportTable.RelativeVirtualAddress), exportTable.Size);
if (exportTableHeader.Length == 0)
{
return;
}
// +0x00: reserved
exportTableHeader.ReadUInt32();
// +0x04: TODO: time/date stamp
exportTableHeader.ReadUInt32();
// +0x08: major version
exportTableHeader.ReadUInt16();
// +0x0A: minor version
exportTableHeader.ReadUInt16();
// +0x0C: DLL name RVA
exportTableHeader.ReadUInt32();
// +0x10: ordinal base
int minOrdinal = exportTableHeader.ReadInt32();
// +0x14: number of entries in the address table
int addressEntryCount = exportTableHeader.ReadInt32();
// +0x18: number of name pointers
int namePointerCount = exportTableHeader.ReadInt32();
// +0x1C: export address table RVA
int addressTableRVA = exportTableHeader.ReadInt32();
// +0x20: name pointer RVA
int namePointerRVA = exportTableHeader.ReadInt32();
// +0x24: ordinal table RVA
int ordinalTableRVA = exportTableHeader.ReadInt32();
int[] addressTable = new int[addressEntryCount];
BlobReader addressTableReader = peImage.GetReader(peReader.GetOffset(addressTableRVA), sizeof(int) * addressEntryCount);
for (int entryIndex = 0; entryIndex < addressEntryCount; entryIndex++)
{
addressTable[entryIndex] = addressTableReader.ReadInt32();
}
ushort[] ordinalTable = new ushort[namePointerCount];
BlobReader ordinalTableReader = peImage.GetReader(peReader.GetOffset(ordinalTableRVA), sizeof(ushort) * namePointerCount);
for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++)
{
ushort ordinalIndex = ordinalTableReader.ReadUInt16();
ordinalTable[entryIndex] = ordinalIndex;
_ordinalRva.Add(entryIndex + minOrdinal, addressTable[ordinalIndex]);
}
BlobReader namePointerReader = peImage.GetReader(peReader.GetOffset(namePointerRVA), sizeof(int) * namePointerCount);
for (int entryIndex = 0; entryIndex < namePointerCount; entryIndex++)
{
int nameRVA = namePointerReader.ReadInt32();
if (nameRVA != 0)
{
int nameOffset = peReader.GetOffset(nameRVA);
BlobReader nameReader = peImage.GetReader(nameOffset, peImage.Length - nameOffset);
StringBuilder nameBuilder = new StringBuilder();
for (byte ascii; (ascii = nameReader.ReadByte()) != 0;)
{
nameBuilder.Append((char)ascii);
}
_namedExportRva.Add(nameBuilder.ToString(), addressTable[ordinalTable[entryIndex]]);
}
}
}
public static PEExportTable Parse(PEReader peReader)
{
return new PEExportTable(peReader);
}
public bool TryGetValue(string exportName, out int rva) => _namedExportRva.TryGetValue(exportName, out rva);
public bool TryGetValue(int ordinal, out int rva) => _ordinalRva.TryGetValue(ordinal, out rva);
}
public static class PEReaderExtensions
{
/// <summary>
/// Get the index in the image byte array corresponding to the RVA
/// </summary>
/// <param name="reader">PE reader representing the executable image to parse</param>
/// <param name="rva">The relative virtual address</param>
public static int GetOffset(this PEReader reader, int rva)
{
int index = reader.PEHeaders.GetContainingSectionIndex(rva);
if (index == -1)
{
throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva);
}
SectionHeader containingSection = reader.PEHeaders.SectionHeaders[index];
return rva - containingSection.VirtualAddress + containingSection.PointerToRawData;
}
/// <summary>
/// Parse export table directory for a given PE reader.
/// </summary>
/// <param name="reader">PE reader representing the executable image to parse</param>
public static PEExportTable GetExportTable(this PEReader reader)
{
return PEExportTable.Parse(reader);
}
/// <summary>
/// Check whether the file is a ReadyToRun image and returns the RVA of its ReadyToRun header if positive.
/// </summary>
/// <param name="reader">PEReader representing the executable to check for the presence of ReadyToRun header</param>
/// <param name="rva">RVA of the ReadyToRun header if available, 0 when not</param>
/// <returns>true when the PEReader represents a ReadyToRun image, false otherwise</returns>
public static bool TryGetReadyToRunHeader(this PEReader reader, out int rva)
{
return reader.GetExportTable().TryGetValue("RTR_HEADER", out rva);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderGenericParameterPosition.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class TypeBuilderGenericParameterPosition
{
[Fact]
public void GenericParameterPosition()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.NotPublic);
GenericTypeParameterBuilder[] genericParameters = type.DefineGenericParameters("T0", "T1");
TypeInfo genericParameter = genericParameters[1].DeclaringType.GetTypeInfo();
Assert.Equal(0, genericParameter.GenericParameterPosition);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class TypeBuilderGenericParameterPosition
{
[Fact]
public void GenericParameterPosition()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.NotPublic);
GenericTypeParameterBuilder[] genericParameters = type.DefineGenericParameters("T0", "T1");
TypeInfo genericParameter = genericParameters[1].DeclaringType.GetTypeInfo();
Assert.Equal(0, genericParameter.GenericParameterPosition);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.CoreLib/src/System/Text/NormalizationForm.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
namespace System.Text
{
public enum NormalizationForm
{
FormC = 1,
FormD = 2,
[UnsupportedOSPlatform("browser")]
FormKC = 5,
[UnsupportedOSPlatform("browser")]
FormKD = 6
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
namespace System.Text
{
public enum NormalizationForm
{
FormC = 1,
FormD = 2,
[UnsupportedOSPlatform("browser")]
FormKC = 5,
[UnsupportedOSPlatform("browser")]
FormKD = 6
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyBySelectedScalarWideningUpperAndAdd.Vector128.UInt32.Vector64.UInt32.1.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public Vector128<UInt32> _fld2;
public Vector64<UInt32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1 testClass)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(_fld1, _fld2, _fld3, 1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1 testClass)
{
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<UInt32>* pFld2 = &_fld2)
fixed (Vector64<UInt32>* pFld3 = &_fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly byte Imm = 1;
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static UInt32[] _data2 = new UInt32[Op2ElementCount];
private static UInt32[] _data3 = new UInt32[Op3ElementCount];
private static Vector128<UInt64> _clsVar1;
private static Vector128<UInt32> _clsVar2;
private static Vector64<UInt32> _clsVar3;
private Vector128<UInt64> _fld1;
private Vector128<UInt32> _fld2;
private Vector64<UInt32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
}
public SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new UInt64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt32>), typeof(Vector64<UInt32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr),
(byte)1
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt32>), typeof(Vector64<UInt32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)),
(byte)1
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
_clsVar1,
_clsVar2,
_clsVar3,
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1)
fixed (Vector128<UInt32>* pClsVar2 = &_clsVar2)
fixed (Vector64<UInt32>* pClsVar3 = &_clsVar3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pClsVar1)),
AdvSimd.LoadVector128((UInt32*)(pClsVar2)),
AdvSimd.LoadVector64((UInt32*)(pClsVar3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr);
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(op1, op2, op3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(op1, op2, op3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(test._fld1, test._fld2, test._fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
fixed (Vector128<UInt64>* pFld1 = &test._fld1)
fixed (Vector128<UInt32>* pFld2 = &test._fld2)
fixed (Vector64<UInt32>* pFld3 = &test._fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(_fld1, _fld2, _fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<UInt32>* pFld2 = &_fld2)
fixed (Vector64<UInt32>* pFld3 = &_fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(test._fld1, test._fld2, test._fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(&test._fld1)),
AdvSimd.LoadVector128((UInt32*)(&test._fld2)),
AdvSimd.LoadVector64((UInt32*)(&test._fld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt64> op1, Vector128<UInt32> op2, Vector64<UInt32> op3, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] inArray3 = new UInt32[Op3ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] inArray3 = new UInt32[Op3ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(UInt64[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd)}<UInt64>(Vector128<UInt64>, Vector128<UInt32>, Vector64<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt64[] inArray1, UInt32[] inArray2, UInt32[] inArray3, UInt64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt64> _fld1;
public Vector128<UInt32> _fld2;
public Vector64<UInt32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1 testClass)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(_fld1, _fld2, _fld3, 1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1 testClass)
{
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<UInt32>* pFld2 = &_fld2)
fixed (Vector64<UInt32>* pFld3 = &_fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
private static readonly byte Imm = 1;
private static UInt64[] _data1 = new UInt64[Op1ElementCount];
private static UInt32[] _data2 = new UInt32[Op2ElementCount];
private static UInt32[] _data3 = new UInt32[Op3ElementCount];
private static Vector128<UInt64> _clsVar1;
private static Vector128<UInt32> _clsVar2;
private static Vector64<UInt32> _clsVar3;
private Vector128<UInt64> _fld1;
private Vector128<UInt32> _fld2;
private Vector64<UInt32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
}
public SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new UInt64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt32>), typeof(Vector64<UInt32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr),
(byte)1
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt32>), typeof(Vector64<UInt32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr)),
(byte)1
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
_clsVar1,
_clsVar2,
_clsVar3,
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1)
fixed (Vector128<UInt32>* pClsVar2 = &_clsVar2)
fixed (Vector64<UInt32>* pClsVar3 = &_clsVar3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pClsVar1)),
AdvSimd.LoadVector128((UInt32*)(pClsVar2)),
AdvSimd.LoadVector64((UInt32*)(pClsVar3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr);
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(op1, op2, op3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(op1, op2, op3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(test._fld1, test._fld2, test._fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1();
fixed (Vector128<UInt64>* pFld1 = &test._fld1)
fixed (Vector128<UInt32>* pFld2 = &test._fld2)
fixed (Vector64<UInt32>* pFld3 = &test._fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(_fld1, _fld2, _fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt64>* pFld1 = &_fld1)
fixed (Vector128<UInt32>* pFld2 = &_fld2)
fixed (Vector64<UInt32>* pFld3 = &_fld3)
{
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(pFld1)),
AdvSimd.LoadVector128((UInt32*)(pFld2)),
AdvSimd.LoadVector64((UInt32*)(pFld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(test._fld1, test._fld2, test._fld3, 1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd(
AdvSimd.LoadVector128((UInt64*)(&test._fld1)),
AdvSimd.LoadVector128((UInt32*)(&test._fld2)),
AdvSimd.LoadVector64((UInt32*)(&test._fld3)),
1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt64> op1, Vector128<UInt32> op2, Vector64<UInt32> op3, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] inArray3 = new UInt32[Op3ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
UInt64[] inArray1 = new UInt64[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] inArray3 = new UInt32[Op3ElementCount];
UInt64[] outArray = new UInt64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(UInt64[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyBySelectedScalarWideningUpperAndAdd)}<UInt64>(Vector128<UInt64>, Vector128<UInt32>, Vector64<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Security.Cryptography.X509Certificates/tests/RevocationTests/DynamicRevocationTests.Android.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates.Tests.Common;
using Xunit;
namespace System.Security.Cryptography.X509Certificates.Tests.RevocationTests
{
public static partial class DynamicRevocationTests
{
public static bool SupportsDynamicRevocation { get; } = Interop.AndroidCrypto.X509ChainSupportsRevocationOptions();
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates.Tests.Common;
using Xunit;
namespace System.Security.Cryptography.X509Certificates.Tests.RevocationTests
{
public static partial class DynamicRevocationTests
{
public static bool SupportsDynamicRevocation { get; } = Interop.AndroidCrypto.X509ChainSupportsRevocationOptions();
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Dynamic.Runtime/tests/Dynamic.Context/Conformance.dynamic.context.operator.compound.type.MultiEqual.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.CSharp.RuntimeBinder;
using Xunit;
using static Dynamic.Operator.Tests.TypeCommon;
namespace Dynamic.Operator.Tests
{
public class TimesEqualTypeTests
{
[Fact]
public static void Bool()
{
dynamic d = true;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void Byte()
{
dynamic d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (byte)1;
d *= s_byte;
d = (byte)1;
d *= s_char;
d = (byte)1;
d *= s_decimal;
d = (byte)1;
d *= s_double;
d = (byte)1;
d *= s_float;
d = (byte)1;
d *= s_int;
d = (byte)1;
d *= s_long;
d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (byte)1;
d *= s_sbyte;
d = (byte)1;
d *= s_short;
d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (byte)1;
d *= s_uint;
d = (byte)1;
d *= s_ulong;
d = (byte)1;
d *= s_ushort;
}
[Fact]
public static void Char()
{
dynamic d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 'a';
d *= s_byte;
d = 'a';
d *= s_char;
d = 'a';
d *= s_decimal;
d = 'a';
d *= s_double;
d = 'a';
d *= s_float;
d = 'a';
d *= s_int;
d = 'a';
d *= s_long;
d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 'a';
d *= s_sbyte;
d = 'a';
d *= s_short;
d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 'a';
d *= s_uint;
d = 'a';
d *= s_ulong;
d = 'a';
d *= s_ushort;
}
[Fact]
public static void Decimal()
{
dynamic d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10m;
d *= s_byte;
d = 10m;
d *= s_char;
d = 10m;
d *= s_decimal;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
d = 10m;
d *= s_int;
d = 10m;
d *= s_long;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10m;
d *= s_sbyte;
d = 10m;
d *= s_short;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10m;
d *= s_uint;
d = 10m;
d *= s_ulong;
d = 10m;
d *= s_ushort;
}
[Fact]
public static void Double()
{
dynamic d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10d;
d *= s_byte;
d = 10d;
d *= s_char;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
d = 10d;
d *= s_double;
d = 10d;
d *= s_float;
d = 10d;
d *= s_int;
d = 10d;
d *= s_long;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10d;
d *= s_sbyte;
d = 10d;
d *= s_short;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10d;
d *= s_uint;
d = 10d;
d *= s_ulong;
d = 10d;
d *= s_ushort;
}
[Fact]
public static void Float()
{
dynamic d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10f;
d *= s_byte;
d = 10f;
d *= s_char;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
d = 10f;
d *= s_double;
d = 10f;
d *= s_float;
d = 10f;
d *= s_int;
d = 10f;
d *= s_long;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10f;
d *= s_sbyte;
d = 10f;
d *= s_short;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10f;
d *= s_uint;
d = 10f;
d *= s_ulong;
d = 10f;
d *= s_ushort;
}
[Fact]
public static void Int()
{
dynamic d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10;
d *= s_byte;
d = 10;
d *= s_char;
d = 10;
d *= s_decimal;
d = 10;
d *= s_double;
d = 10;
d *= s_float;
d = 10;
d *= s_int;
d = 10;
d *= s_long;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10;
d *= s_sbyte;
d = 10;
d *= s_short;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10;
d *= s_uint;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = 10;
d *= s_ushort;
}
[Fact]
public static void Long()
{
dynamic d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10L;
d *= s_byte;
d = 10L;
d *= s_char;
d = 10L;
d *= s_decimal;
d = 10L;
d *= s_double;
d = 10L;
d *= s_float;
d = 10L;
d *= s_int;
d = 10L;
d *= s_long;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10L;
d *= s_sbyte;
d = 10L;
d *= s_short;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10L;
d *= s_uint;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = 10L;
d *= s_ushort;
}
[Fact]
public static void Object()
{
dynamic d = new object();
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void SByte()
{
dynamic d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (sbyte)10;
d *= s_byte;
d = (sbyte)10;
d *= s_char;
d = (sbyte)10;
d *= s_decimal;
d = (sbyte)10;
d *= s_double;
d = (sbyte)10;
d *= s_float;
d = (sbyte)10;
d *= s_int;
d = (sbyte)10;
d *= s_long;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (sbyte)10;
d *= s_sbyte;
d = (sbyte)10;
d *= s_short;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (sbyte)10;
d *= s_uint;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = (sbyte)10;
d *= s_ushort;
}
[Fact]
public static void Short()
{
dynamic d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (short)10;
d *= s_byte;
d = (short)10;
d *= s_char;
d = (short)10;
d *= s_decimal;
d = (short)10;
d *= s_double;
d = (short)10;
d *= s_float;
d = (short)10;
d *= s_int;
d = (short)10;
d *= s_long;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (short)10;
d *= s_sbyte;
d = (short)10;
d *= s_short;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (short)10;
d *= s_uint;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = (short)10;
d *= s_ushort;
}
[Fact]
public static void String()
{
dynamic d = "a";
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void UInt()
{
dynamic d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (uint)10;
d *= s_byte;
d = (uint)10;
d *= s_char;
d = (uint)10;
d *= s_decimal;
d = (uint)10;
d *= s_double;
d = (uint)10;
d *= s_float;
d = (uint)10;
d *= s_int;
d = (uint)10;
d *= s_long;
d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (uint)10;
d *= s_sbyte;
d = (uint)10;
d *= s_short;
d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (uint)10;
d *= s_uint;
d = (uint)10;
d *= s_ulong;
d = (uint)10;
d *= s_ushort;
}
[Fact]
public static void ULong()
{
dynamic d = (ulong)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (ulong)10;
d *= s_byte;
d = (ulong)10;
d *= s_char;
d = (ulong)10;
d *= s_decimal;
d = (ulong)10;
d *= s_double;
d = (ulong)10;
d *= s_float;
d = (ulong)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (ulong)10;
d *= s_uint;
d = (ulong)10;
d *= s_ulong;
d = (ulong)10;
d *= s_ushort;
}
[Fact]
public static void UShort()
{
dynamic d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (ushort)10;
d *= s_byte;
d = (ushort)10;
d *= s_char;
d = (ushort)10;
d *= s_decimal;
d = (ushort)10;
d *= s_double;
d = (ushort)10;
d *= s_float;
d = (ushort)10;
d *= s_int;
d = (ushort)10;
d *= s_long;
d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (ushort)10;
d *= s_sbyte;
d = (ushort)10;
d *= s_short;
d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (ushort)10;
d *= s_uint;
d = (ushort)10;
d *= s_ulong;
d = (ushort)10;
d *= s_ushort;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.CSharp.RuntimeBinder;
using Xunit;
using static Dynamic.Operator.Tests.TypeCommon;
namespace Dynamic.Operator.Tests
{
public class TimesEqualTypeTests
{
[Fact]
public static void Bool()
{
dynamic d = true;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void Byte()
{
dynamic d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (byte)1;
d *= s_byte;
d = (byte)1;
d *= s_char;
d = (byte)1;
d *= s_decimal;
d = (byte)1;
d *= s_double;
d = (byte)1;
d *= s_float;
d = (byte)1;
d *= s_int;
d = (byte)1;
d *= s_long;
d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (byte)1;
d *= s_sbyte;
d = (byte)1;
d *= s_short;
d = (byte)1;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (byte)1;
d *= s_uint;
d = (byte)1;
d *= s_ulong;
d = (byte)1;
d *= s_ushort;
}
[Fact]
public static void Char()
{
dynamic d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 'a';
d *= s_byte;
d = 'a';
d *= s_char;
d = 'a';
d *= s_decimal;
d = 'a';
d *= s_double;
d = 'a';
d *= s_float;
d = 'a';
d *= s_int;
d = 'a';
d *= s_long;
d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 'a';
d *= s_sbyte;
d = 'a';
d *= s_short;
d = 'a';
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 'a';
d *= s_uint;
d = 'a';
d *= s_ulong;
d = 'a';
d *= s_ushort;
}
[Fact]
public static void Decimal()
{
dynamic d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10m;
d *= s_byte;
d = 10m;
d *= s_char;
d = 10m;
d *= s_decimal;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
d = 10m;
d *= s_int;
d = 10m;
d *= s_long;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10m;
d *= s_sbyte;
d = 10m;
d *= s_short;
d = 10m;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10m;
d *= s_uint;
d = 10m;
d *= s_ulong;
d = 10m;
d *= s_ushort;
}
[Fact]
public static void Double()
{
dynamic d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10d;
d *= s_byte;
d = 10d;
d *= s_char;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
d = 10d;
d *= s_double;
d = 10d;
d *= s_float;
d = 10d;
d *= s_int;
d = 10d;
d *= s_long;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10d;
d *= s_sbyte;
d = 10d;
d *= s_short;
d = 10d;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10d;
d *= s_uint;
d = 10d;
d *= s_ulong;
d = 10d;
d *= s_ushort;
}
[Fact]
public static void Float()
{
dynamic d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10f;
d *= s_byte;
d = 10f;
d *= s_char;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
d = 10f;
d *= s_double;
d = 10f;
d *= s_float;
d = 10f;
d *= s_int;
d = 10f;
d *= s_long;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10f;
d *= s_sbyte;
d = 10f;
d *= s_short;
d = 10f;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10f;
d *= s_uint;
d = 10f;
d *= s_ulong;
d = 10f;
d *= s_ushort;
}
[Fact]
public static void Int()
{
dynamic d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10;
d *= s_byte;
d = 10;
d *= s_char;
d = 10;
d *= s_decimal;
d = 10;
d *= s_double;
d = 10;
d *= s_float;
d = 10;
d *= s_int;
d = 10;
d *= s_long;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10;
d *= s_sbyte;
d = 10;
d *= s_short;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10;
d *= s_uint;
d = 10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = 10;
d *= s_ushort;
}
[Fact]
public static void Long()
{
dynamic d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = 10L;
d *= s_byte;
d = 10L;
d *= s_char;
d = 10L;
d *= s_decimal;
d = 10L;
d *= s_double;
d = 10L;
d *= s_float;
d = 10L;
d *= s_int;
d = 10L;
d *= s_long;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = 10L;
d *= s_sbyte;
d = 10L;
d *= s_short;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = 10L;
d *= s_uint;
d = 10L;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = 10L;
d *= s_ushort;
}
[Fact]
public static void Object()
{
dynamic d = new object();
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void SByte()
{
dynamic d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (sbyte)10;
d *= s_byte;
d = (sbyte)10;
d *= s_char;
d = (sbyte)10;
d *= s_decimal;
d = (sbyte)10;
d *= s_double;
d = (sbyte)10;
d *= s_float;
d = (sbyte)10;
d *= s_int;
d = (sbyte)10;
d *= s_long;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (sbyte)10;
d *= s_sbyte;
d = (sbyte)10;
d *= s_short;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (sbyte)10;
d *= s_uint;
d = (sbyte)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = (sbyte)10;
d *= s_ushort;
}
[Fact]
public static void Short()
{
dynamic d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (short)10;
d *= s_byte;
d = (short)10;
d *= s_char;
d = (short)10;
d *= s_decimal;
d = (short)10;
d *= s_double;
d = (short)10;
d *= s_float;
d = (short)10;
d *= s_int;
d = (short)10;
d *= s_long;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (short)10;
d *= s_sbyte;
d = (short)10;
d *= s_short;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (short)10;
d *= s_uint;
d = (short)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
d = (short)10;
d *= s_ushort;
}
[Fact]
public static void String()
{
dynamic d = "a";
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
Assert.Throws<RuntimeBinderException>(() => d *= s_byte);
Assert.Throws<RuntimeBinderException>(() => d *= s_char);
Assert.Throws<RuntimeBinderException>(() => d *= s_decimal);
Assert.Throws<RuntimeBinderException>(() => d *= s_double);
Assert.Throws<RuntimeBinderException>(() => d *= s_float);
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
Assert.Throws<RuntimeBinderException>(() => d *= s_uint);
Assert.Throws<RuntimeBinderException>(() => d *= s_ulong);
Assert.Throws<RuntimeBinderException>(() => d *= s_ushort);
}
[Fact]
public static void UInt()
{
dynamic d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (uint)10;
d *= s_byte;
d = (uint)10;
d *= s_char;
d = (uint)10;
d *= s_decimal;
d = (uint)10;
d *= s_double;
d = (uint)10;
d *= s_float;
d = (uint)10;
d *= s_int;
d = (uint)10;
d *= s_long;
d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (uint)10;
d *= s_sbyte;
d = (uint)10;
d *= s_short;
d = (uint)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (uint)10;
d *= s_uint;
d = (uint)10;
d *= s_ulong;
d = (uint)10;
d *= s_ushort;
}
[Fact]
public static void ULong()
{
dynamic d = (ulong)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (ulong)10;
d *= s_byte;
d = (ulong)10;
d *= s_char;
d = (ulong)10;
d *= s_decimal;
d = (ulong)10;
d *= s_double;
d = (ulong)10;
d *= s_float;
d = (ulong)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_int);
Assert.Throws<RuntimeBinderException>(() => d *= s_long);
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
Assert.Throws<RuntimeBinderException>(() => d *= s_sbyte);
Assert.Throws<RuntimeBinderException>(() => d *= s_short);
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (ulong)10;
d *= s_uint;
d = (ulong)10;
d *= s_ulong;
d = (ulong)10;
d *= s_ushort;
}
[Fact]
public static void UShort()
{
dynamic d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_bool);
d = (ushort)10;
d *= s_byte;
d = (ushort)10;
d *= s_char;
d = (ushort)10;
d *= s_decimal;
d = (ushort)10;
d *= s_double;
d = (ushort)10;
d *= s_float;
d = (ushort)10;
d *= s_int;
d = (ushort)10;
d *= s_long;
d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_object);
d = (ushort)10;
d *= s_sbyte;
d = (ushort)10;
d *= s_short;
d = (ushort)10;
Assert.Throws<RuntimeBinderException>(() => d *= s_string);
d = (ushort)10;
d *= s_uint;
d = (ushort)10;
d *= s_ulong;
d = (ushort)10;
d *= s_ushort;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/Common/src/System/Net/ExceptionCheck.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Net
{
internal static class ExceptionCheck
{
internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Net
{
internal static class ExceptionCheck
{
internal static bool IsFatal(Exception exception) => exception is OutOfMemoryException;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector256/CreateVector.SByte.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void CreateVectorSByte()
{
var test = new VectorCreate__CreateVectorSByte();
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorCreate__CreateVectorSByte
{
private static readonly int LargestVectorSize = 32;
private static readonly int ElementCount = Unsafe.SizeOf<Vector256<SByte>>() / sizeof(SByte);
public bool Succeeded { get; set; } = true;
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
SByte lowerValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> lower = Vector128.Create(lowerValue);
SByte upperValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> upper = Vector128.Create(upperValue);
Vector256<SByte> result = Vector256.Create(lower, upper);
ValidateResult(result, lowerValue, upperValue);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
SByte lowerValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> lower = Vector128.Create(lowerValue);
SByte upperValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> upper = Vector128.Create(upperValue);
object result = typeof(Vector256)
.GetMethod(nameof(Vector256.Create), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>) })
.Invoke(null, new object[] { lower, upper });
ValidateResult((Vector256<SByte>)(result), lowerValue, upperValue);
}
private void ValidateResult(Vector256<SByte> result, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "")
{
SByte[] resultElements = new SByte[ElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method);
}
private void ValidateResult(SByte[] resultElements, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < ElementCount / 2; i++)
{
if (resultElements[i] != expectedLowerValue)
{
succeeded = false;
break;
}
}
for (var i = ElementCount / 2; i < ElementCount; i++)
{
if (resultElements[i] != expectedUpperValue)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256.Create(SByte): {method} failed:");
TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}");
TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void CreateVectorSByte()
{
var test = new VectorCreate__CreateVectorSByte();
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorCreate__CreateVectorSByte
{
private static readonly int LargestVectorSize = 32;
private static readonly int ElementCount = Unsafe.SizeOf<Vector256<SByte>>() / sizeof(SByte);
public bool Succeeded { get; set; } = true;
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
SByte lowerValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> lower = Vector128.Create(lowerValue);
SByte upperValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> upper = Vector128.Create(upperValue);
Vector256<SByte> result = Vector256.Create(lower, upper);
ValidateResult(result, lowerValue, upperValue);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
SByte lowerValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> lower = Vector128.Create(lowerValue);
SByte upperValue = TestLibrary.Generator.GetSByte();
Vector128<SByte> upper = Vector128.Create(upperValue);
object result = typeof(Vector256)
.GetMethod(nameof(Vector256.Create), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>) })
.Invoke(null, new object[] { lower, upper });
ValidateResult((Vector256<SByte>)(result), lowerValue, upperValue);
}
private void ValidateResult(Vector256<SByte> result, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "")
{
SByte[] resultElements = new SByte[ElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
ValidateResult(resultElements, expectedLowerValue, expectedUpperValue, method);
}
private void ValidateResult(SByte[] resultElements, SByte expectedLowerValue, SByte expectedUpperValue, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < ElementCount / 2; i++)
{
if (resultElements[i] != expectedLowerValue)
{
succeeded = false;
break;
}
}
for (var i = ElementCount / 2; i < ElementCount; i++)
{
if (resultElements[i] != expectedUpperValue)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256.Create(SByte): {method} failed:");
TestLibrary.TestFramework.LogInformation($" lower: {expectedLowerValue}");
TestLibrary.TestFramework.LogInformation($" upper: {expectedUpperValue}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", resultElements)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector256BooleanAsUInt64.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void Vector256BooleanAsUInt64()
{
bool succeeded = false;
try
{
Vector256<ulong> result = default(Vector256<bool>).AsUInt64();
}
catch (NotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256BooleanAsUInt64: RunNotSupportedScenario failed to throw NotSupportedException.");
TestLibrary.TestFramework.LogInformation(string.Empty);
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void Vector256BooleanAsUInt64()
{
bool succeeded = false;
try
{
Vector256<ulong> result = default(Vector256<bool>).AsUInt64();
}
catch (NotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256BooleanAsUInt64: RunNotSupportedScenario failed to throw NotSupportedException.");
TestLibrary.TestFramework.LogInformation(string.Empty);
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<GCStressIncompatible>true</GCStressIncompatible>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<!-- This test takes a very long time when run with runincontext -->
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="ByteMark.cs" />
<Compile Include="Huffman.cs" />
<Compile Include="StringSort.cs" />
<Compile Include="assign_jagged.cs" />
<Compile Include="assign_rect.cs" />
<Compile Include="bitops.cs" />
<Compile Include="emfloat.cs" />
<Compile Include="emfloatclass.cs" />
<Compile Include="fourier.cs" />
<Compile Include="idea.cs" />
<Compile Include="ludecomp.cs" />
<Compile Include="neural.cs" />
<Compile Include="neuraljagged.cs" />
<Compile Include="neural-dat.cs" />
<Compile Include="numericsort.cs" />
<Compile Include="utility.cs" />
</ItemGroup>
<PropertyGroup>
<ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<GCStressIncompatible>true</GCStressIncompatible>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<!-- This test takes a very long time when run with runincontext -->
<UnloadabilityIncompatible>true</UnloadabilityIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="ByteMark.cs" />
<Compile Include="Huffman.cs" />
<Compile Include="StringSort.cs" />
<Compile Include="assign_jagged.cs" />
<Compile Include="assign_rect.cs" />
<Compile Include="bitops.cs" />
<Compile Include="emfloat.cs" />
<Compile Include="emfloatclass.cs" />
<Compile Include="fourier.cs" />
<Compile Include="idea.cs" />
<Compile Include="ludecomp.cs" />
<Compile Include="neural.cs" />
<Compile Include="neuraljagged.cs" />
<Compile Include="neural-dat.cs" />
<Compile Include="numericsort.cs" />
<Compile Include="utility.cs" />
</ItemGroup>
<PropertyGroup>
<ProjectAssetsFile>$(JitPackagesConfigFileDirectory)benchmark\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/installer/tests/HostActivation.Tests/RuntimeProperties.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using Microsoft.DotNet.Cli.Build;
using Xunit;
namespace Microsoft.DotNet.CoreSetup.Test.HostActivation
{
public class RuntimeProperties : IClassFixture<RuntimeProperties.SharedTestState>
{
private SharedTestState sharedState;
public RuntimeProperties(RuntimeProperties.SharedTestState fixture)
{
sharedState = fixture;
}
[Fact]
public void AppConfigProperty_AppCanGetData()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.AppTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.AppTestPropertyName} = {sharedState.AppTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.AppTestPropertyName}) = {sharedState.AppTestPropertyValue}");
}
[Fact]
public void FrameworkConfigProperty_AppCanGetData()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.FrameworkTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.FrameworkTestPropertyName} = {sharedState.FrameworkTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.FrameworkTestPropertyName}) = {sharedState.FrameworkTestPropertyValue}");
}
[Fact]
public void DuplicateConfigProperty_AppConfigValueUsed()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson)
.WithProperty(sharedState.FrameworkTestPropertyName, sharedState.AppTestPropertyValue)
.Save();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.FrameworkTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.FrameworkTestPropertyName} = {sharedState.AppTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.FrameworkTestPropertyName}) = {sharedState.AppTestPropertyValue}");
}
[Fact]
public void HostFxrPathProperty_SetWhenRunningSDKCommand()
{
var dotnet = sharedState.MockSDK;
dotnet.Exec("--info")
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.HostFxrPathPropertyName} = {dotnet.GreatestVersionHostFxrFilePath}");
}
[Fact]
public void HostFxrPathProperty_NotVisibleFromApp()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.HostFxrPathPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdOutContaining($"Property '{sharedState.HostFxrPathPropertyName}' was not found.");
}
[Fact]
public void DuplicateCommonProperty_Fails()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
string name = "RUNTIME_IDENTIFIER";
RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson)
.WithProperty(name, sharedState.AppTestPropertyValue)
.Save();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Fail()
.And.HaveStdErrContaining($"Duplicate runtime property found: {name}");
}
public class SharedTestState : IDisposable
{
public TestProjectFixture RuntimePropertiesFixture { get; }
public RepoDirectoriesProvider RepoDirectories { get; }
public DotNetCli MockSDK { get; }
public string AppTestPropertyName => "APP_TEST_PROPERTY";
public string AppTestPropertyValue => "VALUE_FROM_APP";
public string FrameworkTestPropertyName => "FRAMEWORK_TEST_PROPERTY";
public string FrameworkTestPropertyValue => "VALUE_FROM_FRAMEWORK";
public string HostFxrPathPropertyName => "HOSTFXR_PATH";
private readonly string copiedDotnet;
public SharedTestState()
{
copiedDotnet = Path.Combine(TestArtifact.TestArtifactsPath, "runtimeProperties");
SharedFramework.CopyDirectory(Path.Combine(TestArtifact.TestArtifactsPath, "sharedFrameworkPublish"), copiedDotnet);
MockSDK = new DotNetBuilder(copiedDotnet, Path.Combine(TestArtifact.TestArtifactsPath, "sharedFrameworkPublish"), "exe")
.AddMicrosoftNETCoreAppFrameworkMockCoreClr("9999.0.0")
.AddMockSDK("9999.0.0-dev", "9999.0.0")
.Build();
File.WriteAllText(Path.Combine(MockSDK.BinPath, "global.json"),
@"
{
""sdk"": {
""version"": ""9999.0.0-dev""
}
}");
RepoDirectories = new RepoDirectoriesProvider(builtDotnet: copiedDotnet);
RuntimePropertiesFixture = new TestProjectFixture("RuntimeProperties", RepoDirectories)
.EnsureRestored()
.BuildProject();
RuntimeConfig.FromFile(RuntimePropertiesFixture.TestProject.RuntimeConfigJson)
.WithProperty(AppTestPropertyName, AppTestPropertyValue)
.Save();
RuntimeConfig.FromFile(Path.Combine(RuntimePropertiesFixture.BuiltDotnet.GreatestVersionSharedFxPath, "Microsoft.NETCore.App.runtimeconfig.json"))
.WithProperty(FrameworkTestPropertyName, FrameworkTestPropertyValue)
.Save();
}
public void Dispose()
{
RuntimePropertiesFixture.Dispose();
if (!TestArtifact.PreserveTestRuns() && Directory.Exists(copiedDotnet))
{
Directory.Delete(copiedDotnet, true);
}
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using Microsoft.DotNet.Cli.Build;
using Xunit;
namespace Microsoft.DotNet.CoreSetup.Test.HostActivation
{
public class RuntimeProperties : IClassFixture<RuntimeProperties.SharedTestState>
{
private SharedTestState sharedState;
public RuntimeProperties(RuntimeProperties.SharedTestState fixture)
{
sharedState = fixture;
}
[Fact]
public void AppConfigProperty_AppCanGetData()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.AppTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.AppTestPropertyName} = {sharedState.AppTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.AppTestPropertyName}) = {sharedState.AppTestPropertyValue}");
}
[Fact]
public void FrameworkConfigProperty_AppCanGetData()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.FrameworkTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.FrameworkTestPropertyName} = {sharedState.FrameworkTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.FrameworkTestPropertyName}) = {sharedState.FrameworkTestPropertyValue}");
}
[Fact]
public void DuplicateConfigProperty_AppConfigValueUsed()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson)
.WithProperty(sharedState.FrameworkTestPropertyName, sharedState.AppTestPropertyValue)
.Save();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.FrameworkTestPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.FrameworkTestPropertyName} = {sharedState.AppTestPropertyValue}")
.And.HaveStdOutContaining($"AppContext.GetData({sharedState.FrameworkTestPropertyName}) = {sharedState.AppTestPropertyValue}");
}
[Fact]
public void HostFxrPathProperty_SetWhenRunningSDKCommand()
{
var dotnet = sharedState.MockSDK;
dotnet.Exec("--info")
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdErrContaining($"Property {sharedState.HostFxrPathPropertyName} = {dotnet.GreatestVersionHostFxrFilePath}");
}
[Fact]
public void HostFxrPathProperty_NotVisibleFromApp()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll, sharedState.HostFxrPathPropertyName)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Pass()
.And.HaveStdOutContaining($"Property '{sharedState.HostFxrPathPropertyName}' was not found.");
}
[Fact]
public void DuplicateCommonProperty_Fails()
{
var fixture = sharedState.RuntimePropertiesFixture
.Copy();
string name = "RUNTIME_IDENTIFIER";
RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson)
.WithProperty(name, sharedState.AppTestPropertyValue)
.Save();
var dotnet = fixture.BuiltDotnet;
var appDll = fixture.TestProject.AppDll;
dotnet.Exec(appDll)
.EnableTracingAndCaptureOutputs()
.Execute()
.Should().Fail()
.And.HaveStdErrContaining($"Duplicate runtime property found: {name}");
}
public class SharedTestState : IDisposable
{
public TestProjectFixture RuntimePropertiesFixture { get; }
public RepoDirectoriesProvider RepoDirectories { get; }
public DotNetCli MockSDK { get; }
public string AppTestPropertyName => "APP_TEST_PROPERTY";
public string AppTestPropertyValue => "VALUE_FROM_APP";
public string FrameworkTestPropertyName => "FRAMEWORK_TEST_PROPERTY";
public string FrameworkTestPropertyValue => "VALUE_FROM_FRAMEWORK";
public string HostFxrPathPropertyName => "HOSTFXR_PATH";
private readonly string copiedDotnet;
public SharedTestState()
{
copiedDotnet = Path.Combine(TestArtifact.TestArtifactsPath, "runtimeProperties");
SharedFramework.CopyDirectory(Path.Combine(TestArtifact.TestArtifactsPath, "sharedFrameworkPublish"), copiedDotnet);
MockSDK = new DotNetBuilder(copiedDotnet, Path.Combine(TestArtifact.TestArtifactsPath, "sharedFrameworkPublish"), "exe")
.AddMicrosoftNETCoreAppFrameworkMockCoreClr("9999.0.0")
.AddMockSDK("9999.0.0-dev", "9999.0.0")
.Build();
File.WriteAllText(Path.Combine(MockSDK.BinPath, "global.json"),
@"
{
""sdk"": {
""version"": ""9999.0.0-dev""
}
}");
RepoDirectories = new RepoDirectoriesProvider(builtDotnet: copiedDotnet);
RuntimePropertiesFixture = new TestProjectFixture("RuntimeProperties", RepoDirectories)
.EnsureRestored()
.BuildProject();
RuntimeConfig.FromFile(RuntimePropertiesFixture.TestProject.RuntimeConfigJson)
.WithProperty(AppTestPropertyName, AppTestPropertyValue)
.Save();
RuntimeConfig.FromFile(Path.Combine(RuntimePropertiesFixture.BuiltDotnet.GreatestVersionSharedFxPath, "Microsoft.NETCore.App.runtimeconfig.json"))
.WithProperty(FrameworkTestPropertyName, FrameworkTestPropertyValue)
.Save();
}
public void Dispose()
{
RuntimePropertiesFixture.Dispose();
if (!TestArtifact.PreserveTestRuns() && Directory.Exists(copiedDotnet))
{
Directory.Delete(copiedDotnet, true);
}
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Globalization.Calendars/tests/GregorianCalendar/GregorianCalendarGetDayOfMonth.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Xunit;
namespace System.Globalization.Tests
{
public class GregorianCalendarGetDayOfMonth
{
public static IEnumerable<object[]> GetDayOfMonth_TestData()
{
yield return new object[] { new DateTime(2006, 1, 1) };
yield return new object[] { new DateTime(2006, 1, 17) };
yield return new object[] { new DateTime(2006, 1, 31) };
}
[Theory]
[MemberData(nameof(GetDayOfMonth_TestData))]
public void GetDayOfMonth(DateTime time)
{
Assert.Equal(time.Day, new GregorianCalendar().GetDayOfMonth(time));
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Xunit;
namespace System.Globalization.Tests
{
public class GregorianCalendarGetDayOfMonth
{
public static IEnumerable<object[]> GetDayOfMonth_TestData()
{
yield return new object[] { new DateTime(2006, 1, 1) };
yield return new object[] { new DateTime(2006, 1, 17) };
yield return new object[] { new DateTime(2006, 1, 31) };
}
[Theory]
[MemberData(nameof(GetDayOfMonth_TestData))]
public void GetDayOfMonth(DateTime time)
{
Assert.Equal(time.Day, new GregorianCalendar().GetDayOfMonth(time));
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/DuplicateToVector64.SByte.31.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void DuplicateToVector64_SByte_31()
{
var test = new ImmOpTest__DuplicateToVector64_SByte_31();
if (test.IsSupported)
{
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class ImmOpTest__DuplicateToVector64_SByte_31
{
private struct DataTable
{
private byte[] outArray;
private GCHandle outHandle;
private ulong alignment;
public DataTable(SByte[] outArray, int alignment)
{
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<SByte>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.outArray = new byte[alignment * 2];
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
}
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte);
private DataTable _dataTable;
public ImmOpTest__DuplicateToVector64_SByte_31()
{
Succeeded = true;
_dataTable = new DataTable(new SByte[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
var result = AdvSimd.DuplicateToVector64(
(SByte)31
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.outArrayPtr);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.DuplicateToVector64), new Type[] { typeof(SByte) })
.Invoke(null, new object[] {
(SByte)31
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<SByte>)(result));
ValidateResult(_dataTable.outArrayPtr);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(void* result, [CallerMemberName] string method = "")
{
SByte[] outArray = new SByte[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<SByte>>());
ValidateResult(outArray, method);
}
private void ValidateResult(SByte[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != 31)
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 31)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.DuplicateToVector64)}<SByte>(31): {method} failed:");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void DuplicateToVector64_SByte_31()
{
var test = new ImmOpTest__DuplicateToVector64_SByte_31();
if (test.IsSupported)
{
// Validates basic functionality works
test.RunBasicScenario();
// Validates calling via reflection works
test.RunReflectionScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class ImmOpTest__DuplicateToVector64_SByte_31
{
private struct DataTable
{
private byte[] outArray;
private GCHandle outHandle;
private ulong alignment;
public DataTable(SByte[] outArray, int alignment)
{
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<SByte>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.outArray = new byte[alignment * 2];
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
}
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte);
private DataTable _dataTable;
public ImmOpTest__DuplicateToVector64_SByte_31()
{
Succeeded = true;
_dataTable = new DataTable(new SByte[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
var result = AdvSimd.DuplicateToVector64(
(SByte)31
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.outArrayPtr);
}
public void RunReflectionScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.DuplicateToVector64), new Type[] { typeof(SByte) })
.Invoke(null, new object[] {
(SByte)31
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<SByte>)(result));
ValidateResult(_dataTable.outArrayPtr);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(void* result, [CallerMemberName] string method = "")
{
SByte[] outArray = new SByte[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<SByte>>());
ValidateResult(outArray, method);
}
private void ValidateResult(SByte[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != 31)
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 31)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.DuplicateToVector64)}<SByte>(31): {method} failed:");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Net.Http/tests/FunctionalTests/StreamContentTest.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace System.Net.Http.Functional.Tests
{
public class StreamContentTest
{
private readonly ITestOutputHelper _output;
public StreamContentTest(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void Ctor_NullStream_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new StreamContent(null));
}
[Fact]
public void Ctor_ZeroBufferSize_ThrowsArgumentOutOfRangeException()
{
Assert.Throws<ArgumentOutOfRangeException>(() => new StreamContent(new MemoryStream(), 0));
}
[Fact]
public void Ctor_NullStreamAndZeroBufferSize_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new StreamContent(null, 0));
}
[Fact]
public void ContentLength_SetStreamSupportingSeeking_StreamLengthMatchesHeaderValue()
{
var source = new MockStream(new byte[10], true, true); // Supports seeking.
var content = new StreamContent(source);
Assert.Equal(source.Length, content.Headers.ContentLength);
}
[Fact]
public void ContentLength_SetStreamSupportingSeekingPartiallyConsumed_StreamLengthMatchesHeaderValueMinusConsumed()
{
int consumed = 4;
var source = new MockStream(new byte[10], true, true); // Supports seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
Assert.Equal(source.Length - consumed, content.Headers.ContentLength);
}
[Fact]
public void ContentLength_SetStreamNotSupportingSeeking_NullReturned()
{
var source = new MockStream(new byte[10], false, true); // Doesn't support seeking.
var content = new StreamContent(source);
Assert.Null(content.Headers.ContentLength);
}
[Fact]
public void Dispose_UseMockStreamSourceAndDisposeContent_MockStreamGotDisposed()
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
content.Dispose();
Assert.Equal(1, source.DisposeCount);
}
[Fact]
public void CopyToAsync_NullDestination_ThrowsArgumentnullException()
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
Assert.Throws<ArgumentNullException>(() => { Task t = content.CopyToAsync(null); });
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamSupportingSeeking_ContentIsSerializedMultipleTimes()
{
var source = new MockStream(new byte[10], true, true); // Supports seeking.
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
Assert.Equal(source.Length, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(source.Length, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamSupportingSeekingPartiallyConsumed_ContentIsSerializedMultipleTimesFromInitialPoint()
{
int consumed = 4;
var source = new MockStream(new byte[10], true, true); // supports seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
Assert.Equal(source.Length - consumed, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(source.Length - consumed, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeeking_ThrowsInvalidOperationException()
{
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable).
Assert.Equal(10, destination1.Length);
// Note that the InvalidOperationException is thrown in CopyToAsync(). It is not thrown inside the task.
var destination2 = new MemoryStream();
Assert.Throws<InvalidOperationException>(() => { Task t = content.CopyToAsync(destination2); });
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeekingButBufferedStream_ContentSerializedOnceToBuffer()
{
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
var content = new StreamContent(source);
// After loading the content into a buffer, we should be able to copy the content to a destination stream
// multiple times, even though the stream doesn't support seeking.
await content.LoadIntoBufferAsync();
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable)
Assert.Equal(10, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(10, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeekingButBufferedStreamPartiallyConsumed_ContentSerializedOnceToBuffer()
{
int consumed = 4;
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
// After loading the content into a buffer, we should be able to copy the content to a destination stream
// multiple times, even though the stream doesn't support seeking.
await content.LoadIntoBufferAsync();
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable).
Assert.Equal(10 - consumed, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(10 - consumed, destination2.Length);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_GetProperty_ReturnOriginalStream(bool readStreamAsync)
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
Stream stream = await content.ReadAsStreamAsync(readStreamAsync);
Assert.False(stream.CanWrite);
Assert.Equal(source.Length, stream.Length);
Assert.Equal(0, source.ReadCount);
Assert.NotSame(source, stream);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_GetPropertyPartiallyConsumed_ReturnOriginalStream(bool readStreamAsync)
{
int consumed = 4;
var source = new MockStream(new byte[10]);
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
Stream stream = await content.ReadAsStreamAsync(readStreamAsync);
Assert.False(stream.CanWrite);
Assert.Equal(source.Length, stream.Length);
Assert.Equal(1, source.ReadCount);
Assert.Equal(consumed, stream.Position);
Assert.NotSame(source, stream);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_CheckResultProperties_ValuesRepresentReadOnlyStream(bool readStreamAsync)
{
byte[] data = new byte[10];
for (int i = 0; i < data.Length; i++)
{
data[i] = (byte)i;
}
var source = new MockStream(data);
var content = new StreamContent(source);
Stream contentReadStream = await content.ReadAsStreamAsync(readStreamAsync);
// The following checks verify that the stream returned passes all read-related properties to the
// underlying MockStream and throws when using write-related members.
Assert.False(contentReadStream.CanWrite);
Assert.True(contentReadStream.CanRead);
Assert.Equal(source.Length, contentReadStream.Length);
Assert.Equal(1, source.CanSeekCount);
_output.WriteLine(contentReadStream.CanSeek.ToString());
Assert.Equal(2, source.CanSeekCount);
contentReadStream.Position = 3; // No exception.
Assert.Equal(3, contentReadStream.Position);
byte byteOnIndex3 = (byte)contentReadStream.ReadByte();
Assert.Equal(data[3], byteOnIndex3);
byte[] byteOnIndex4 = new byte[1];
int result = await contentReadStream.ReadAsync(byteOnIndex4, 0, 1);
Assert.Equal(1, result);
Assert.Equal(data[4], byteOnIndex4[0]);
byte[] byteOnIndex5 = new byte[1];
Assert.Equal(1, contentReadStream.Read(byteOnIndex5, 0, 1));
Assert.Equal(data[5], byteOnIndex5[0]);
byte[] byteOnIndex6 = new byte[1];
Assert.Equal(1, contentReadStream.Read(new Span<byte>(byteOnIndex6, 0, 1)));
Assert.Equal(data[6], byteOnIndex6[0]);
contentReadStream.ReadTimeout = 123;
Assert.Equal(123, source.ReadTimeout);
Assert.Equal(123, contentReadStream.ReadTimeout);
Assert.Equal(0, source.CanTimeoutCount);
_output.WriteLine(contentReadStream.CanTimeout.ToString());
Assert.Equal(1, source.CanTimeoutCount);
Assert.Equal(0, source.SeekCount);
contentReadStream.Seek(0, SeekOrigin.Begin);
Assert.Equal(1, source.SeekCount);
Assert.Throws<NotSupportedException>(() => { contentReadStream.WriteTimeout = 5; });
Assert.Throws<NotSupportedException>(() => contentReadStream.WriteTimeout.ToString());
Assert.Throws<NotSupportedException>(() => contentReadStream.Flush());
Assert.Throws<NotSupportedException>(() => contentReadStream.SetLength(1));
Assert.Throws<NotSupportedException>(() => contentReadStream.Write(null, 0, 0));
Assert.Throws<NotSupportedException>(() => contentReadStream.Write(new Span<byte>(Array.Empty<byte>())));
Assert.Throws<NotSupportedException>(() => contentReadStream.WriteByte(1));
Assert.Equal(0, source.DisposeCount);
contentReadStream.Dispose();
Assert.Equal(1, source.DisposeCount);
}
#region Helper methods
private class MockStream : MemoryStream
{
private bool _canSeek;
private bool _canRead;
private int _readTimeout;
public int DisposeCount { get; private set; }
public int BufferSize { get; private set; }
public int ReadCount { get; private set; }
public int CanSeekCount { get; private set; }
public int CanTimeoutCount { get; private set; }
public int SeekCount { get; private set; }
public override bool CanSeek
{
get
{
CanSeekCount++;
return _canSeek;
}
}
public override bool CanRead
{
get { return _canRead; }
}
public override int ReadTimeout
{
get { return _readTimeout; }
set { _readTimeout = value; }
}
public override bool CanTimeout
{
get
{
CanTimeoutCount++;
return base.CanTimeout;
}
}
public MockStream(byte[] data)
: this(data, true, true)
{
}
public MockStream(byte[] data, bool canSeek, bool canRead)
: base(data)
{
_canSeek = canSeek;
_canRead = canRead;
}
public override int Read(byte[] buffer, int offset, int count)
{
ReadCount++;
SetBufferSize(count);
return base.Read(buffer, offset, count);
}
public override long Seek(long offset, SeekOrigin loc)
{
SeekCount++;
return base.Seek(offset, loc);
}
protected override void Dispose(bool disposing)
{
DisposeCount++;
base.Dispose(disposing);
}
private void SetBufferSize(int count)
{
if (BufferSize == 0)
{
BufferSize = count;
}
}
}
#endregion
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace System.Net.Http.Functional.Tests
{
public class StreamContentTest
{
private readonly ITestOutputHelper _output;
public StreamContentTest(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void Ctor_NullStream_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new StreamContent(null));
}
[Fact]
public void Ctor_ZeroBufferSize_ThrowsArgumentOutOfRangeException()
{
Assert.Throws<ArgumentOutOfRangeException>(() => new StreamContent(new MemoryStream(), 0));
}
[Fact]
public void Ctor_NullStreamAndZeroBufferSize_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new StreamContent(null, 0));
}
[Fact]
public void ContentLength_SetStreamSupportingSeeking_StreamLengthMatchesHeaderValue()
{
var source = new MockStream(new byte[10], true, true); // Supports seeking.
var content = new StreamContent(source);
Assert.Equal(source.Length, content.Headers.ContentLength);
}
[Fact]
public void ContentLength_SetStreamSupportingSeekingPartiallyConsumed_StreamLengthMatchesHeaderValueMinusConsumed()
{
int consumed = 4;
var source = new MockStream(new byte[10], true, true); // Supports seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
Assert.Equal(source.Length - consumed, content.Headers.ContentLength);
}
[Fact]
public void ContentLength_SetStreamNotSupportingSeeking_NullReturned()
{
var source = new MockStream(new byte[10], false, true); // Doesn't support seeking.
var content = new StreamContent(source);
Assert.Null(content.Headers.ContentLength);
}
[Fact]
public void Dispose_UseMockStreamSourceAndDisposeContent_MockStreamGotDisposed()
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
content.Dispose();
Assert.Equal(1, source.DisposeCount);
}
[Fact]
public void CopyToAsync_NullDestination_ThrowsArgumentnullException()
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
Assert.Throws<ArgumentNullException>(() => { Task t = content.CopyToAsync(null); });
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamSupportingSeeking_ContentIsSerializedMultipleTimes()
{
var source = new MockStream(new byte[10], true, true); // Supports seeking.
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
Assert.Equal(source.Length, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(source.Length, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamSupportingSeekingPartiallyConsumed_ContentIsSerializedMultipleTimesFromInitialPoint()
{
int consumed = 4;
var source = new MockStream(new byte[10], true, true); // supports seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
Assert.Equal(source.Length - consumed, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(source.Length - consumed, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeeking_ThrowsInvalidOperationException()
{
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
var content = new StreamContent(source);
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable).
Assert.Equal(10, destination1.Length);
// Note that the InvalidOperationException is thrown in CopyToAsync(). It is not thrown inside the task.
var destination2 = new MemoryStream();
Assert.Throws<InvalidOperationException>(() => { Task t = content.CopyToAsync(destination2); });
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeekingButBufferedStream_ContentSerializedOnceToBuffer()
{
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
var content = new StreamContent(source);
// After loading the content into a buffer, we should be able to copy the content to a destination stream
// multiple times, even though the stream doesn't support seeking.
await content.LoadIntoBufferAsync();
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable)
Assert.Equal(10, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(10, destination2.Length);
}
[Fact]
public async Task CopyToAsync_CallMultipleTimesWithStreamNotSupportingSeekingButBufferedStreamPartiallyConsumed_ContentSerializedOnceToBuffer()
{
int consumed = 4;
var source = new MockStream(new byte[10], false, true); // doesn't support seeking.
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
// After loading the content into a buffer, we should be able to copy the content to a destination stream
// multiple times, even though the stream doesn't support seeking.
await content.LoadIntoBufferAsync();
var destination1 = new MemoryStream();
await content.CopyToAsync(destination1);
// Use hardcoded expected length, since source.Length would throw (source stream gets disposed if non-seekable).
Assert.Equal(10 - consumed, destination1.Length);
var destination2 = new MemoryStream();
await content.CopyToAsync(destination2);
Assert.Equal(10 - consumed, destination2.Length);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_GetProperty_ReturnOriginalStream(bool readStreamAsync)
{
var source = new MockStream(new byte[10]);
var content = new StreamContent(source);
Stream stream = await content.ReadAsStreamAsync(readStreamAsync);
Assert.False(stream.CanWrite);
Assert.Equal(source.Length, stream.Length);
Assert.Equal(0, source.ReadCount);
Assert.NotSame(source, stream);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_GetPropertyPartiallyConsumed_ReturnOriginalStream(bool readStreamAsync)
{
int consumed = 4;
var source = new MockStream(new byte[10]);
source.Read(new byte[consumed], 0, consumed);
var content = new StreamContent(source);
Stream stream = await content.ReadAsStreamAsync(readStreamAsync);
Assert.False(stream.CanWrite);
Assert.Equal(source.Length, stream.Length);
Assert.Equal(1, source.ReadCount);
Assert.Equal(consumed, stream.Position);
Assert.NotSame(source, stream);
}
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task ContentReadStream_CheckResultProperties_ValuesRepresentReadOnlyStream(bool readStreamAsync)
{
byte[] data = new byte[10];
for (int i = 0; i < data.Length; i++)
{
data[i] = (byte)i;
}
var source = new MockStream(data);
var content = new StreamContent(source);
Stream contentReadStream = await content.ReadAsStreamAsync(readStreamAsync);
// The following checks verify that the stream returned passes all read-related properties to the
// underlying MockStream and throws when using write-related members.
Assert.False(contentReadStream.CanWrite);
Assert.True(contentReadStream.CanRead);
Assert.Equal(source.Length, contentReadStream.Length);
Assert.Equal(1, source.CanSeekCount);
_output.WriteLine(contentReadStream.CanSeek.ToString());
Assert.Equal(2, source.CanSeekCount);
contentReadStream.Position = 3; // No exception.
Assert.Equal(3, contentReadStream.Position);
byte byteOnIndex3 = (byte)contentReadStream.ReadByte();
Assert.Equal(data[3], byteOnIndex3);
byte[] byteOnIndex4 = new byte[1];
int result = await contentReadStream.ReadAsync(byteOnIndex4, 0, 1);
Assert.Equal(1, result);
Assert.Equal(data[4], byteOnIndex4[0]);
byte[] byteOnIndex5 = new byte[1];
Assert.Equal(1, contentReadStream.Read(byteOnIndex5, 0, 1));
Assert.Equal(data[5], byteOnIndex5[0]);
byte[] byteOnIndex6 = new byte[1];
Assert.Equal(1, contentReadStream.Read(new Span<byte>(byteOnIndex6, 0, 1)));
Assert.Equal(data[6], byteOnIndex6[0]);
contentReadStream.ReadTimeout = 123;
Assert.Equal(123, source.ReadTimeout);
Assert.Equal(123, contentReadStream.ReadTimeout);
Assert.Equal(0, source.CanTimeoutCount);
_output.WriteLine(contentReadStream.CanTimeout.ToString());
Assert.Equal(1, source.CanTimeoutCount);
Assert.Equal(0, source.SeekCount);
contentReadStream.Seek(0, SeekOrigin.Begin);
Assert.Equal(1, source.SeekCount);
Assert.Throws<NotSupportedException>(() => { contentReadStream.WriteTimeout = 5; });
Assert.Throws<NotSupportedException>(() => contentReadStream.WriteTimeout.ToString());
Assert.Throws<NotSupportedException>(() => contentReadStream.Flush());
Assert.Throws<NotSupportedException>(() => contentReadStream.SetLength(1));
Assert.Throws<NotSupportedException>(() => contentReadStream.Write(null, 0, 0));
Assert.Throws<NotSupportedException>(() => contentReadStream.Write(new Span<byte>(Array.Empty<byte>())));
Assert.Throws<NotSupportedException>(() => contentReadStream.WriteByte(1));
Assert.Equal(0, source.DisposeCount);
contentReadStream.Dispose();
Assert.Equal(1, source.DisposeCount);
}
#region Helper methods
private class MockStream : MemoryStream
{
private bool _canSeek;
private bool _canRead;
private int _readTimeout;
public int DisposeCount { get; private set; }
public int BufferSize { get; private set; }
public int ReadCount { get; private set; }
public int CanSeekCount { get; private set; }
public int CanTimeoutCount { get; private set; }
public int SeekCount { get; private set; }
public override bool CanSeek
{
get
{
CanSeekCount++;
return _canSeek;
}
}
public override bool CanRead
{
get { return _canRead; }
}
public override int ReadTimeout
{
get { return _readTimeout; }
set { _readTimeout = value; }
}
public override bool CanTimeout
{
get
{
CanTimeoutCount++;
return base.CanTimeout;
}
}
public MockStream(byte[] data)
: this(data, true, true)
{
}
public MockStream(byte[] data, bool canSeek, bool canRead)
: base(data)
{
_canSeek = canSeek;
_canRead = canRead;
}
public override int Read(byte[] buffer, int offset, int count)
{
ReadCount++;
SetBufferSize(count);
return base.Read(buffer, offset, count);
}
public override long Seek(long offset, SeekOrigin loc)
{
SeekCount++;
return base.Seek(offset, loc);
}
protected override void Dispose(bool disposing)
{
DisposeCount++;
base.Dispose(disposing);
}
private void SetBufferSize(int count)
{
if (BufferSize == 0)
{
BufferSize = count;
}
}
}
#endregion
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/src/System/Xml/Schema/Inference/XmlSchemaInferenceException.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Diagnostics;
using System.Globalization;
namespace System.Xml.Schema
{
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class XmlSchemaInferenceException : XmlSchemaException
{
protected XmlSchemaInferenceException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
public XmlSchemaInferenceException() : base(null)
{
}
public XmlSchemaInferenceException(string message) : base(message, ((Exception?)null), 0, 0)
{
}
public XmlSchemaInferenceException(string message, Exception? innerException) : base(message, innerException, 0, 0)
{
}
public XmlSchemaInferenceException(string message, Exception? innerException, int lineNumber, int linePosition) :
base(message, innerException, lineNumber, linePosition)
{
}
internal XmlSchemaInferenceException(string res, string arg) : base(res, new string[] { arg }, null, null, 0, 0, null)
{
}
internal XmlSchemaInferenceException(string res, int lineNumber, int linePosition) :
base(res, null, null, null, lineNumber, linePosition, null)
{
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Diagnostics;
using System.Globalization;
namespace System.Xml.Schema
{
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public class XmlSchemaInferenceException : XmlSchemaException
{
protected XmlSchemaInferenceException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
public XmlSchemaInferenceException() : base(null)
{
}
public XmlSchemaInferenceException(string message) : base(message, ((Exception?)null), 0, 0)
{
}
public XmlSchemaInferenceException(string message, Exception? innerException) : base(message, innerException, 0, 0)
{
}
public XmlSchemaInferenceException(string message, Exception? innerException, int lineNumber, int linePosition) :
base(message, innerException, lineNumber, linePosition)
{
}
internal XmlSchemaInferenceException(string res, string arg) : base(res, new string[] { arg }, null, null, 0, 0, null)
{
}
internal XmlSchemaInferenceException(string res, int lineNumber, int linePosition) :
base(res, null, null, null, lineNumber, linePosition, null)
{
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
namespace System.Text.Json
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
internal struct ReadStack
{
internal static readonly char[] SpecialCharacters = { '.', ' ', '\'', '/', '"', '[', ']', '(', ')', '\t', '\n', '\r', '\f', '\b', '\\', '\u0085', '\u2028', '\u2029' };
/// <summary>
/// Exposes the stackframe that is currently active.
/// </summary>
public ReadStackFrame Current;
/// <summary>
/// Buffer containing all frames in the stack. For performance it is only populated for serialization depths > 1.
/// </summary>
private ReadStackFrame[] _stack;
/// <summary>
/// Tracks the current depth of the stack.
/// </summary>
private int _count;
/// <summary>
/// If not zero, indicates that the stack is part of a re-entrant continuation of given depth.
/// </summary>
private int _continuationCount;
// State cache when deserializing objects with parameterized constructors.
private List<ArgumentState>? _ctorArgStateCache;
/// <summary>
/// Bytes consumed in the current loop.
/// </summary>
public long BytesConsumed;
/// <summary>
/// Indicates that the state still contains suspended frames waiting re-entry.
/// </summary>
public bool IsContinuation => _continuationCount != 0;
/// <summary>
/// Internal flag to let us know that we need to read ahead in the inner read loop.
/// </summary>
public bool ReadAhead;
// The bag of preservable references.
public ReferenceResolver ReferenceResolver;
/// <summary>
/// Whether we need to read ahead in the inner read loop.
/// </summary>
public bool SupportContinuation;
/// <summary>
/// Whether we can read without the need of saving state for stream and preserve references cases.
/// </summary>
public bool UseFastPath;
/// <summary>
/// Ensures that the stack buffer has sufficient capacity to hold an additional frame.
/// </summary>
private void EnsurePushCapacity()
{
if (_stack is null)
{
_stack = new ReadStackFrame[4];
}
else if (_count - 1 == _stack.Length)
{
Array.Resize(ref _stack, 2 * _stack.Length);
}
}
public void Initialize(Type type, JsonSerializerOptions options, bool supportContinuation)
{
JsonTypeInfo jsonTypeInfo = options.GetOrAddJsonTypeInfoForRootType(type);
Initialize(jsonTypeInfo, supportContinuation);
}
internal void Initialize(JsonTypeInfo jsonTypeInfo, bool supportContinuation = false)
{
Current.JsonTypeInfo = jsonTypeInfo;
// The initial JsonPropertyInfo will be used to obtain the converter.
Current.JsonPropertyInfo = jsonTypeInfo.PropertyInfoForTypeInfo;
Current.NumberHandling = Current.JsonPropertyInfo.NumberHandling;
JsonSerializerOptions options = jsonTypeInfo.Options;
bool preserveReferences = options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve;
if (preserveReferences)
{
ReferenceResolver = options.ReferenceHandler!.CreateResolver(writing: false);
}
SupportContinuation = supportContinuation;
UseFastPath = !supportContinuation && !preserveReferences;
}
public void Push()
{
if (_continuationCount == 0)
{
if (_count == 0)
{
// Performance optimization: reuse the first stackframe on the first push operation.
// NB need to be careful when making writes to Current _before_ the first `Push`
// operation is performed.
_count = 1;
}
else
{
JsonTypeInfo jsonTypeInfo = Current.JsonPropertyInfo?.JsonTypeInfo ?? Current.CtorArgumentState!.JsonParameterInfo!.JsonTypeInfo;
JsonNumberHandling? numberHandling = Current.NumberHandling;
ConverterStrategy converterStrategy = Current.JsonTypeInfo.PropertyInfoForTypeInfo.ConverterStrategy;
EnsurePushCapacity();
_stack[_count - 1] = Current;
Current = default;
_count++;
Current.JsonTypeInfo = jsonTypeInfo;
Current.JsonPropertyInfo = jsonTypeInfo.PropertyInfoForTypeInfo;
// Allow number handling on property to win over handling on type.
Current.NumberHandling = numberHandling ?? Current.JsonPropertyInfo.NumberHandling;
}
}
else
{
// We are re-entering a continuation, adjust indices accordingly
if (_count++ > 0)
{
Current = _stack[_count - 1];
}
// check if we are done
if (_continuationCount == _count)
{
_continuationCount = 0;
}
}
SetConstructorArgumentState();
#if DEBUG
// Ensure the method is always exercised in debug builds.
_ = JsonPath();
#endif
}
public void Pop(bool success)
{
Debug.Assert(_count > 0);
if (!success)
{
// Check if we need to initialize the continuation.
if (_continuationCount == 0)
{
if (_count == 1)
{
// No need to copy any frames here.
_continuationCount = 1;
_count = 0;
return;
}
// Need to push the Current frame to the stack,
// ensure that we have sufficient capacity.
EnsurePushCapacity();
_continuationCount = _count--;
}
else if (--_count == 0)
{
// reached the root, no need to copy frames.
return;
}
_stack[_count] = Current;
Current = _stack[_count - 1];
}
else
{
Debug.Assert(_continuationCount == 0);
if (--_count > 0)
{
Current = _stack[_count - 1];
}
}
SetConstructorArgumentState();
}
// Return a JSONPath using simple dot-notation when possible. When special characters are present, bracket-notation is used:
// $.x.y[0].z
// $['PropertyName.With.Special.Chars']
public string JsonPath()
{
StringBuilder sb = new StringBuilder("$");
// If a continuation, always report back full stack which does not use Current for the last frame.
int count = Math.Max(_count, _continuationCount + 1);
for (int i = 0; i < count - 1; i++)
{
AppendStackFrame(sb, ref _stack[i]);
}
if (_continuationCount == 0)
{
AppendStackFrame(sb, ref Current);
}
return sb.ToString();
static void AppendStackFrame(StringBuilder sb, ref ReadStackFrame frame)
{
// Append the property name.
string? propertyName = GetPropertyName(ref frame);
AppendPropertyName(sb, propertyName);
if (frame.JsonTypeInfo != null && frame.IsProcessingEnumerable())
{
if (frame.ReturnValue is not IEnumerable enumerable)
{
return;
}
// For continuation scenarios only, before or after all elements are read, the exception is not within the array.
if (frame.ObjectState == StackFrameObjectState.None ||
frame.ObjectState == StackFrameObjectState.CreatedObject ||
frame.ObjectState == StackFrameObjectState.ReadElements)
{
sb.Append('[');
sb.Append(GetCount(enumerable));
sb.Append(']');
}
}
}
static int GetCount(IEnumerable enumerable)
{
if (enumerable is ICollection collection)
{
return collection.Count;
}
int count = 0;
IEnumerator enumerator = enumerable.GetEnumerator();
while (enumerator.MoveNext())
{
count++;
}
return count;
}
static void AppendPropertyName(StringBuilder sb, string? propertyName)
{
if (propertyName != null)
{
if (propertyName.IndexOfAny(SpecialCharacters) != -1)
{
sb.Append(@"['");
sb.Append(propertyName);
sb.Append(@"']");
}
else
{
sb.Append('.');
sb.Append(propertyName);
}
}
}
static string? GetPropertyName(ref ReadStackFrame frame)
{
string? propertyName = null;
// Attempt to get the JSON property name from the frame.
byte[]? utf8PropertyName = frame.JsonPropertyName;
if (utf8PropertyName == null)
{
if (frame.JsonPropertyNameAsString != null)
{
// Attempt to get the JSON property name set manually for dictionary
// keys and KeyValuePair property names.
propertyName = frame.JsonPropertyNameAsString;
}
else
{
// Attempt to get the JSON property name from the JsonPropertyInfo or JsonParameterInfo.
utf8PropertyName = frame.JsonPropertyInfo?.NameAsUtf8Bytes ??
frame.CtorArgumentState?.JsonParameterInfo?.NameAsUtf8Bytes;
}
}
if (utf8PropertyName != null)
{
propertyName = JsonHelpers.Utf8GetString(utf8PropertyName);
}
return propertyName;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SetConstructorArgumentState()
{
if (Current.JsonTypeInfo.IsObjectWithParameterizedCtor)
{
// A zero index indicates a new stack frame.
if (Current.CtorArgumentStateIndex == 0)
{
_ctorArgStateCache ??= new List<ArgumentState>();
var newState = new ArgumentState();
_ctorArgStateCache.Add(newState);
(Current.CtorArgumentStateIndex, Current.CtorArgumentState) = (_ctorArgStateCache.Count, newState);
}
else
{
Current.CtorArgumentState = _ctorArgStateCache![Current.CtorArgumentStateIndex - 1];
}
}
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => $"Path:{JsonPath()} Current: ConverterStrategy.{Current.JsonTypeInfo?.PropertyInfoForTypeInfo.ConverterStrategy}, {Current.JsonTypeInfo?.Type.Name}";
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Metadata;
namespace System.Text.Json
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
internal struct ReadStack
{
internal static readonly char[] SpecialCharacters = { '.', ' ', '\'', '/', '"', '[', ']', '(', ')', '\t', '\n', '\r', '\f', '\b', '\\', '\u0085', '\u2028', '\u2029' };
/// <summary>
/// Exposes the stackframe that is currently active.
/// </summary>
public ReadStackFrame Current;
/// <summary>
/// Buffer containing all frames in the stack. For performance it is only populated for serialization depths > 1.
/// </summary>
private ReadStackFrame[] _stack;
/// <summary>
/// Tracks the current depth of the stack.
/// </summary>
private int _count;
/// <summary>
/// If not zero, indicates that the stack is part of a re-entrant continuation of given depth.
/// </summary>
private int _continuationCount;
// State cache when deserializing objects with parameterized constructors.
private List<ArgumentState>? _ctorArgStateCache;
/// <summary>
/// Bytes consumed in the current loop.
/// </summary>
public long BytesConsumed;
/// <summary>
/// Indicates that the state still contains suspended frames waiting re-entry.
/// </summary>
public bool IsContinuation => _continuationCount != 0;
/// <summary>
/// Internal flag to let us know that we need to read ahead in the inner read loop.
/// </summary>
public bool ReadAhead;
// The bag of preservable references.
public ReferenceResolver ReferenceResolver;
/// <summary>
/// Whether we need to read ahead in the inner read loop.
/// </summary>
public bool SupportContinuation;
/// <summary>
/// Whether we can read without the need of saving state for stream and preserve references cases.
/// </summary>
public bool UseFastPath;
/// <summary>
/// Ensures that the stack buffer has sufficient capacity to hold an additional frame.
/// </summary>
private void EnsurePushCapacity()
{
if (_stack is null)
{
_stack = new ReadStackFrame[4];
}
else if (_count - 1 == _stack.Length)
{
Array.Resize(ref _stack, 2 * _stack.Length);
}
}
public void Initialize(Type type, JsonSerializerOptions options, bool supportContinuation)
{
JsonTypeInfo jsonTypeInfo = options.GetOrAddJsonTypeInfoForRootType(type);
Initialize(jsonTypeInfo, supportContinuation);
}
internal void Initialize(JsonTypeInfo jsonTypeInfo, bool supportContinuation = false)
{
Current.JsonTypeInfo = jsonTypeInfo;
// The initial JsonPropertyInfo will be used to obtain the converter.
Current.JsonPropertyInfo = jsonTypeInfo.PropertyInfoForTypeInfo;
Current.NumberHandling = Current.JsonPropertyInfo.NumberHandling;
JsonSerializerOptions options = jsonTypeInfo.Options;
bool preserveReferences = options.ReferenceHandlingStrategy == ReferenceHandlingStrategy.Preserve;
if (preserveReferences)
{
ReferenceResolver = options.ReferenceHandler!.CreateResolver(writing: false);
}
SupportContinuation = supportContinuation;
UseFastPath = !supportContinuation && !preserveReferences;
}
public void Push()
{
if (_continuationCount == 0)
{
if (_count == 0)
{
// Performance optimization: reuse the first stackframe on the first push operation.
// NB need to be careful when making writes to Current _before_ the first `Push`
// operation is performed.
_count = 1;
}
else
{
JsonTypeInfo jsonTypeInfo = Current.JsonPropertyInfo?.JsonTypeInfo ?? Current.CtorArgumentState!.JsonParameterInfo!.JsonTypeInfo;
JsonNumberHandling? numberHandling = Current.NumberHandling;
ConverterStrategy converterStrategy = Current.JsonTypeInfo.PropertyInfoForTypeInfo.ConverterStrategy;
EnsurePushCapacity();
_stack[_count - 1] = Current;
Current = default;
_count++;
Current.JsonTypeInfo = jsonTypeInfo;
Current.JsonPropertyInfo = jsonTypeInfo.PropertyInfoForTypeInfo;
// Allow number handling on property to win over handling on type.
Current.NumberHandling = numberHandling ?? Current.JsonPropertyInfo.NumberHandling;
}
}
else
{
// We are re-entering a continuation, adjust indices accordingly
if (_count++ > 0)
{
Current = _stack[_count - 1];
}
// check if we are done
if (_continuationCount == _count)
{
_continuationCount = 0;
}
}
SetConstructorArgumentState();
#if DEBUG
// Ensure the method is always exercised in debug builds.
_ = JsonPath();
#endif
}
public void Pop(bool success)
{
Debug.Assert(_count > 0);
if (!success)
{
// Check if we need to initialize the continuation.
if (_continuationCount == 0)
{
if (_count == 1)
{
// No need to copy any frames here.
_continuationCount = 1;
_count = 0;
return;
}
// Need to push the Current frame to the stack,
// ensure that we have sufficient capacity.
EnsurePushCapacity();
_continuationCount = _count--;
}
else if (--_count == 0)
{
// reached the root, no need to copy frames.
return;
}
_stack[_count] = Current;
Current = _stack[_count - 1];
}
else
{
Debug.Assert(_continuationCount == 0);
if (--_count > 0)
{
Current = _stack[_count - 1];
}
}
SetConstructorArgumentState();
}
// Return a JSONPath using simple dot-notation when possible. When special characters are present, bracket-notation is used:
// $.x.y[0].z
// $['PropertyName.With.Special.Chars']
public string JsonPath()
{
StringBuilder sb = new StringBuilder("$");
// If a continuation, always report back full stack which does not use Current for the last frame.
int count = Math.Max(_count, _continuationCount + 1);
for (int i = 0; i < count - 1; i++)
{
AppendStackFrame(sb, ref _stack[i]);
}
if (_continuationCount == 0)
{
AppendStackFrame(sb, ref Current);
}
return sb.ToString();
static void AppendStackFrame(StringBuilder sb, ref ReadStackFrame frame)
{
// Append the property name.
string? propertyName = GetPropertyName(ref frame);
AppendPropertyName(sb, propertyName);
if (frame.JsonTypeInfo != null && frame.IsProcessingEnumerable())
{
if (frame.ReturnValue is not IEnumerable enumerable)
{
return;
}
// For continuation scenarios only, before or after all elements are read, the exception is not within the array.
if (frame.ObjectState == StackFrameObjectState.None ||
frame.ObjectState == StackFrameObjectState.CreatedObject ||
frame.ObjectState == StackFrameObjectState.ReadElements)
{
sb.Append('[');
sb.Append(GetCount(enumerable));
sb.Append(']');
}
}
}
static int GetCount(IEnumerable enumerable)
{
if (enumerable is ICollection collection)
{
return collection.Count;
}
int count = 0;
IEnumerator enumerator = enumerable.GetEnumerator();
while (enumerator.MoveNext())
{
count++;
}
return count;
}
static void AppendPropertyName(StringBuilder sb, string? propertyName)
{
if (propertyName != null)
{
if (propertyName.IndexOfAny(SpecialCharacters) != -1)
{
sb.Append(@"['");
sb.Append(propertyName);
sb.Append(@"']");
}
else
{
sb.Append('.');
sb.Append(propertyName);
}
}
}
static string? GetPropertyName(ref ReadStackFrame frame)
{
string? propertyName = null;
// Attempt to get the JSON property name from the frame.
byte[]? utf8PropertyName = frame.JsonPropertyName;
if (utf8PropertyName == null)
{
if (frame.JsonPropertyNameAsString != null)
{
// Attempt to get the JSON property name set manually for dictionary
// keys and KeyValuePair property names.
propertyName = frame.JsonPropertyNameAsString;
}
else
{
// Attempt to get the JSON property name from the JsonPropertyInfo or JsonParameterInfo.
utf8PropertyName = frame.JsonPropertyInfo?.NameAsUtf8Bytes ??
frame.CtorArgumentState?.JsonParameterInfo?.NameAsUtf8Bytes;
}
}
if (utf8PropertyName != null)
{
propertyName = JsonHelpers.Utf8GetString(utf8PropertyName);
}
return propertyName;
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SetConstructorArgumentState()
{
if (Current.JsonTypeInfo.IsObjectWithParameterizedCtor)
{
// A zero index indicates a new stack frame.
if (Current.CtorArgumentStateIndex == 0)
{
_ctorArgStateCache ??= new List<ArgumentState>();
var newState = new ArgumentState();
_ctorArgStateCache.Add(newState);
(Current.CtorArgumentStateIndex, Current.CtorArgumentState) = (_ctorArgStateCache.Count, newState);
}
else
{
Current.CtorArgumentState = _ctorArgStateCache![Current.CtorArgumentStateIndex - 1];
}
}
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => $"Path:{JsonPath()} Current: ConverterStrategy.{Current.JsonTypeInfo?.PropertyInfoForTypeInfo.ConverterStrategy}, {Current.JsonTypeInfo?.Type.Name}";
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/tests/XmlReader/XmlResolver/System.Xml.RW.XmlSystemPathResolver.Tests.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="XmlSystemPathResolverTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\TestFiles\**\*"
Link="TestFiles\%(RecursiveDir)%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Visible="false" />
</ItemGroup>
</Project> | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="XmlSystemPathResolverTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\TestFiles\**\*"
Link="TestFiles\%(RecursiveDir)%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Visible="false" />
</ItemGroup>
</Project> | -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/FailedProxyCache.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
namespace System.Net.Http
{
/// <summary>
/// Holds a cache of failing proxies and manages when they should be retried.
/// </summary>
internal sealed class FailedProxyCache
{
/// <summary>
/// When returned by <see cref="GetProxyRenewTicks"/>, indicates a proxy is immediately usable.
/// </summary>
public const long Immediate = 0;
// If a proxy fails, time out 30 minutes. WinHTTP and Firefox both use this.
private const int FailureTimeoutInMilliseconds = 1000 * 60 * 30;
// Scan through the failures and flush any that have expired every 5 minutes.
private const int FlushFailuresTimerInMilliseconds = 1000 * 60 * 5;
// _failedProxies will only be flushed (rare but somewhat expensive) if we have more than this number of proxies in our dictionary. See Cleanup() for details.
private const int LargeProxyConfigBoundary = 8;
// Value is the Environment.TickCount64 to remove the proxy from the failure list.
private readonly ConcurrentDictionary<Uri, long> _failedProxies = new ConcurrentDictionary<Uri, long>();
// When Environment.TickCount64 >= _nextFlushTicks, cause a flush.
private long _nextFlushTicks = Environment.TickCount64 + FlushFailuresTimerInMilliseconds;
// This lock can be folded into _nextFlushTicks for space optimization, but
// this class should only have a single instance so would rather have clarity.
private SpinLock _flushLock = new SpinLock(enableThreadOwnerTracking: false); // mutable struct; do not make this readonly
/// <summary>
/// Checks when a proxy will become usable.
/// </summary>
/// <param name="uri">The <see cref="Uri"/> of the proxy to check.</param>
/// <returns>If the proxy can be used, <see cref="Immediate"/>. Otherwise, the next <see cref="Environment.TickCount64"/> that it should be used.</returns>
public long GetProxyRenewTicks(Uri uri)
{
Cleanup();
// If not failed, ready immediately.
if (!_failedProxies.TryGetValue(uri, out long renewTicks))
{
return Immediate;
}
// If we haven't reached out renew time, the proxy can't be used.
if (Environment.TickCount64 < renewTicks)
{
return renewTicks;
}
// Renew time reached, we can remove the proxy from the cache.
if (TryRenewProxy(uri, renewTicks))
{
return Immediate;
}
// Another thread updated the cache before we could remove it.
// We can't know if this is a removal or an update, so check again.
return _failedProxies.TryGetValue(uri, out renewTicks) ? renewTicks : Immediate;
}
/// <summary>
/// Sets a proxy as failed, to avoid trying it again for some time.
/// </summary>
/// <param name="uri">The URI of the proxy.</param>
public void SetProxyFailed(Uri uri)
{
_failedProxies[uri] = Environment.TickCount64 + FailureTimeoutInMilliseconds;
Cleanup();
}
/// <summary>
/// Renews a proxy prior to its period expiring. Used when all proxies are failed to renew the proxy closest to being renewed.
/// </summary>
/// <param name="uri">The <paramref name="uri"/> of the proxy to renew.</param>
/// <param name="renewTicks">The current renewal time for the proxy. If the value has changed from this, the proxy will not be renewed.</param>
public bool TryRenewProxy(Uri uri, long renewTicks) =>
_failedProxies.TryRemove(new KeyValuePair<Uri, long>(uri, renewTicks));
/// <summary>
/// Cleans up any old proxies that should no longer be marked as failing.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void Cleanup()
{
if (_failedProxies.Count > LargeProxyConfigBoundary && Environment.TickCount64 >= Interlocked.Read(ref _nextFlushTicks))
{
CleanupHelper();
}
}
/// <summary>
/// Cleans up any old proxies that should no longer be marked as failing.
/// </summary>
/// <remarks>
/// I expect this to never be called by <see cref="Cleanup"/> in a production system. It is only needed in the case
/// that a system has a very large number of proxies that the PAC script cycles through. It is moderately expensive,
/// so it's only run periodically and is disabled until we exceed <see cref="LargeProxyConfigBoundary"/> failed proxies.
/// </remarks>
[MethodImpl(MethodImplOptions.NoInlining)]
private void CleanupHelper()
{
bool lockTaken = false;
try
{
_flushLock.TryEnter(ref lockTaken);
if (!lockTaken)
{
return;
}
long curTicks = Environment.TickCount64;
foreach (KeyValuePair<Uri, long> kvp in _failedProxies)
{
if (curTicks >= kvp.Value)
{
((ICollection<KeyValuePair<Uri, long>>)_failedProxies).Remove(kvp);
}
}
}
finally
{
if (lockTaken)
{
Interlocked.Exchange(ref _nextFlushTicks, Environment.TickCount64 + FlushFailuresTimerInMilliseconds);
_flushLock.Exit(false);
}
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
namespace System.Net.Http
{
/// <summary>
/// Holds a cache of failing proxies and manages when they should be retried.
/// </summary>
internal sealed class FailedProxyCache
{
/// <summary>
/// When returned by <see cref="GetProxyRenewTicks"/>, indicates a proxy is immediately usable.
/// </summary>
public const long Immediate = 0;
// If a proxy fails, time out 30 minutes. WinHTTP and Firefox both use this.
private const int FailureTimeoutInMilliseconds = 1000 * 60 * 30;
// Scan through the failures and flush any that have expired every 5 minutes.
private const int FlushFailuresTimerInMilliseconds = 1000 * 60 * 5;
// _failedProxies will only be flushed (rare but somewhat expensive) if we have more than this number of proxies in our dictionary. See Cleanup() for details.
private const int LargeProxyConfigBoundary = 8;
// Value is the Environment.TickCount64 to remove the proxy from the failure list.
private readonly ConcurrentDictionary<Uri, long> _failedProxies = new ConcurrentDictionary<Uri, long>();
// When Environment.TickCount64 >= _nextFlushTicks, cause a flush.
private long _nextFlushTicks = Environment.TickCount64 + FlushFailuresTimerInMilliseconds;
// This lock can be folded into _nextFlushTicks for space optimization, but
// this class should only have a single instance so would rather have clarity.
private SpinLock _flushLock = new SpinLock(enableThreadOwnerTracking: false); // mutable struct; do not make this readonly
/// <summary>
/// Checks when a proxy will become usable.
/// </summary>
/// <param name="uri">The <see cref="Uri"/> of the proxy to check.</param>
/// <returns>If the proxy can be used, <see cref="Immediate"/>. Otherwise, the next <see cref="Environment.TickCount64"/> that it should be used.</returns>
public long GetProxyRenewTicks(Uri uri)
{
Cleanup();
// If not failed, ready immediately.
if (!_failedProxies.TryGetValue(uri, out long renewTicks))
{
return Immediate;
}
// If we haven't reached out renew time, the proxy can't be used.
if (Environment.TickCount64 < renewTicks)
{
return renewTicks;
}
// Renew time reached, we can remove the proxy from the cache.
if (TryRenewProxy(uri, renewTicks))
{
return Immediate;
}
// Another thread updated the cache before we could remove it.
// We can't know if this is a removal or an update, so check again.
return _failedProxies.TryGetValue(uri, out renewTicks) ? renewTicks : Immediate;
}
/// <summary>
/// Sets a proxy as failed, to avoid trying it again for some time.
/// </summary>
/// <param name="uri">The URI of the proxy.</param>
public void SetProxyFailed(Uri uri)
{
_failedProxies[uri] = Environment.TickCount64 + FailureTimeoutInMilliseconds;
Cleanup();
}
/// <summary>
/// Renews a proxy prior to its period expiring. Used when all proxies are failed to renew the proxy closest to being renewed.
/// </summary>
/// <param name="uri">The <paramref name="uri"/> of the proxy to renew.</param>
/// <param name="renewTicks">The current renewal time for the proxy. If the value has changed from this, the proxy will not be renewed.</param>
public bool TryRenewProxy(Uri uri, long renewTicks) =>
_failedProxies.TryRemove(new KeyValuePair<Uri, long>(uri, renewTicks));
/// <summary>
/// Cleans up any old proxies that should no longer be marked as failing.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void Cleanup()
{
if (_failedProxies.Count > LargeProxyConfigBoundary && Environment.TickCount64 >= Interlocked.Read(ref _nextFlushTicks))
{
CleanupHelper();
}
}
/// <summary>
/// Cleans up any old proxies that should no longer be marked as failing.
/// </summary>
/// <remarks>
/// I expect this to never be called by <see cref="Cleanup"/> in a production system. It is only needed in the case
/// that a system has a very large number of proxies that the PAC script cycles through. It is moderately expensive,
/// so it's only run periodically and is disabled until we exceed <see cref="LargeProxyConfigBoundary"/> failed proxies.
/// </remarks>
[MethodImpl(MethodImplOptions.NoInlining)]
private void CleanupHelper()
{
bool lockTaken = false;
try
{
_flushLock.TryEnter(ref lockTaken);
if (!lockTaken)
{
return;
}
long curTicks = Environment.TickCount64;
foreach (KeyValuePair<Uri, long> kvp in _failedProxies)
{
if (curTicks >= kvp.Value)
{
((ICollection<KeyValuePair<Uri, long>>)_failedProxies).Remove(kvp);
}
}
}
finally
{
if (lockTaken)
{
Interlocked.Exchange(ref _nextFlushTicks, Environment.TickCount64 + FlushFailuresTimerInMilliseconds);
_flushLock.Exit(false);
}
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType />
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType />
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/Loader/classloader/generics/Layout/General/struct01_auto.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
public struct ValX1<T> {}
public struct ValX2<T,U> {}
public struct ValX3<T,U,V>{}
public class RefX1<T> {}
public class RefX2<T,U> {}
public class RefX3<T,U,V>{}
[StructLayout(LayoutKind.Auto)]
public struct Gen<T>
{
public T Fld10;
public int _int0;
public double _double0;
public string _string0;
public Guid _Guid0;
public T Fld11;
public int _int1;
public double _double1;
public string _string1;
public Guid _Guid1;
public T Fld12;
public void VerifyLayout()
{
_int0 = 0;
_double0 = 0;
_string0 = "string0";
_Guid0 = new Guid();
_int1 = int.MaxValue;
_double1 = double.MaxValue;
_string1 = "string1";
_Guid1 = new Guid(1,2,3,4,5,6,7,8,9,10,11);
Test_struct01_auto.Eval(_int0 == 0);
Test_struct01_auto.Eval(_int1 == int.MaxValue) ;
Test_struct01_auto.Eval(_double0 == 0) ;
Test_struct01_auto.Eval(_double1 == double.MaxValue) ;
Test_struct01_auto.Eval(_string0.Equals("string0"));
Test_struct01_auto.Eval(_string1.Equals("string1"));
Test_struct01_auto.Eval(_Guid0 == new Guid());
Test_struct01_auto.Eval(_Guid1 == new Guid(1,2,3,4,5,6,7,8,9,10,11));
}
}
public class Test_struct01_auto
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
new Gen<int>().VerifyLayout();
new Gen<double>().VerifyLayout();
new Gen<string>().VerifyLayout();
new Gen<object>().VerifyLayout();
new Gen<Guid>().VerifyLayout();
new Gen<int[]>().VerifyLayout();
new Gen<double[,]>().VerifyLayout();
new Gen<string[][][]>().VerifyLayout();
new Gen<object[,,,]>().VerifyLayout();
new Gen<Guid[][,,,][]>().VerifyLayout();
new Gen<RefX1<int>[]>().VerifyLayout();
new Gen<RefX1<double>[,]>().VerifyLayout();
new Gen<RefX1<string>[][][]>().VerifyLayout();
new Gen<RefX1<object>[,,,]>().VerifyLayout();
new Gen<RefX1<Guid>[][,,,][]>().VerifyLayout();
new Gen<ValX1<int>[]>().VerifyLayout();
new Gen<ValX1<double>[,]>().VerifyLayout();
new Gen<ValX1<string>[][][]>().VerifyLayout();
new Gen<ValX1<object>[,,,]>().VerifyLayout();
new Gen<ValX1<Guid>[][,,,][]>().VerifyLayout();
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
public struct ValX1<T> {}
public struct ValX2<T,U> {}
public struct ValX3<T,U,V>{}
public class RefX1<T> {}
public class RefX2<T,U> {}
public class RefX3<T,U,V>{}
[StructLayout(LayoutKind.Auto)]
public struct Gen<T>
{
public T Fld10;
public int _int0;
public double _double0;
public string _string0;
public Guid _Guid0;
public T Fld11;
public int _int1;
public double _double1;
public string _string1;
public Guid _Guid1;
public T Fld12;
public void VerifyLayout()
{
_int0 = 0;
_double0 = 0;
_string0 = "string0";
_Guid0 = new Guid();
_int1 = int.MaxValue;
_double1 = double.MaxValue;
_string1 = "string1";
_Guid1 = new Guid(1,2,3,4,5,6,7,8,9,10,11);
Test_struct01_auto.Eval(_int0 == 0);
Test_struct01_auto.Eval(_int1 == int.MaxValue) ;
Test_struct01_auto.Eval(_double0 == 0) ;
Test_struct01_auto.Eval(_double1 == double.MaxValue) ;
Test_struct01_auto.Eval(_string0.Equals("string0"));
Test_struct01_auto.Eval(_string1.Equals("string1"));
Test_struct01_auto.Eval(_Guid0 == new Guid());
Test_struct01_auto.Eval(_Guid1 == new Guid(1,2,3,4,5,6,7,8,9,10,11));
}
}
public class Test_struct01_auto
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
counter++;
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
}
public static int Main()
{
new Gen<int>().VerifyLayout();
new Gen<double>().VerifyLayout();
new Gen<string>().VerifyLayout();
new Gen<object>().VerifyLayout();
new Gen<Guid>().VerifyLayout();
new Gen<int[]>().VerifyLayout();
new Gen<double[,]>().VerifyLayout();
new Gen<string[][][]>().VerifyLayout();
new Gen<object[,,,]>().VerifyLayout();
new Gen<Guid[][,,,][]>().VerifyLayout();
new Gen<RefX1<int>[]>().VerifyLayout();
new Gen<RefX1<double>[,]>().VerifyLayout();
new Gen<RefX1<string>[][][]>().VerifyLayout();
new Gen<RefX1<object>[,,,]>().VerifyLayout();
new Gen<RefX1<Guid>[][,,,][]>().VerifyLayout();
new Gen<ValX1<int>[]>().VerifyLayout();
new Gen<ValX1<double>[,]>().VerifyLayout();
new Gen<ValX1<string>[][][]>().VerifyLayout();
new Gen<ValX1<object>[,,,]>().VerifyLayout();
new Gen<ValX1<Guid>[][,,,][]>().VerifyLayout();
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/src/System/Xml/Core/CharEntityEncoderFallback.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Text;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Xml
{
internal sealed class CharEntityEncoderFallback : EncoderFallback
{
private CharEntityEncoderFallbackBuffer? _fallbackBuffer;
private int[]? _textContentMarks;
private int _endMarkPos;
private int _curMarkPos;
public override int MaxCharCount => 12;
internal int StartOffset { get; set; }
public override EncoderFallbackBuffer CreateFallbackBuffer()
{
return _fallbackBuffer ??= new CharEntityEncoderFallbackBuffer(this);
}
[MemberNotNull(nameof(_textContentMarks))]
internal void Reset(int[] textContentMarks, int endMarkPos)
{
_textContentMarks = textContentMarks;
_endMarkPos = endMarkPos;
_curMarkPos = 0;
}
private bool CanReplaceAt(int index)
{
Debug.Assert(_textContentMarks != null);
int mPos = _curMarkPos;
int charPos = StartOffset + index;
while (mPos < _endMarkPos && charPos >= _textContentMarks[mPos + 1])
{
mPos++;
}
_curMarkPos = mPos;
return (mPos & 1) != 0;
}
private sealed class CharEntityEncoderFallbackBuffer : EncoderFallbackBuffer
{
private readonly CharEntityEncoderFallback _parent;
private string _charEntity = string.Empty;
private int _charEntityIndex = -1;
internal CharEntityEncoderFallbackBuffer(CharEntityEncoderFallback parent)
{
_parent = parent;
}
public override int Remaining => _charEntityIndex == -1 ? 0 : _charEntity.Length - _charEntityIndex;
public override bool Fallback(char charUnknown, int index)
{
// If we are already in fallback, throw, it's probably at the suspect character in charEntity
if (_charEntityIndex >= 0)
{
(new EncoderExceptionFallback()).CreateFallbackBuffer().Fallback(charUnknown, index);
}
// find out if we can replace the character with entity
if (_parent.CanReplaceAt(index))
{
// Create the replacement character entity
_charEntity = string.Create(null, stackalloc char[64], $"&#x{(int)charUnknown:X};");
_charEntityIndex = 0;
return true;
}
EncoderFallbackBuffer errorFallbackBuffer = (new EncoderExceptionFallback()).CreateFallbackBuffer();
errorFallbackBuffer.Fallback(charUnknown, index);
return false;
}
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index)
{
// check input surrogate pair
if (!char.IsSurrogatePair(charUnknownHigh, charUnknownLow))
{
throw XmlConvert.CreateInvalidSurrogatePairException(charUnknownHigh, charUnknownLow);
}
// If we are already in fallback, throw, it's probably at the suspect character in charEntity
if (_charEntityIndex >= 0)
{
(new EncoderExceptionFallback()).CreateFallbackBuffer().Fallback(charUnknownHigh, charUnknownLow, index);
}
if (_parent.CanReplaceAt(index))
{
// Create the replacement character entity
_charEntity = string.Create(null, stackalloc char[64], $"&#x{SurrogateCharToUtf32(charUnknownHigh, charUnknownLow):X};");
_charEntityIndex = 0;
return true;
}
EncoderFallbackBuffer errorFallbackBuffer = (new EncoderExceptionFallback()).CreateFallbackBuffer();
errorFallbackBuffer.Fallback(charUnknownHigh, charUnknownLow, index);
return false;
}
public override char GetNextChar()
{
// The protocol using GetNextChar() and MovePrevious() called by Encoder is not well documented.
// Here we have to signal to Encoder that the previous read was last character. Only AFTER we can
// mark our self as done (-1). Otherwise MovePrevious() can still be called, but -1 is already incorrectly set
// and return false from MovePrevious(). Then Encoder swallowing the rest of the bytes.
if (_charEntityIndex == _charEntity.Length)
{
_charEntityIndex = -1;
}
if (_charEntityIndex == -1)
{
return (char)0;
}
Debug.Assert(_charEntityIndex < _charEntity.Length);
return _charEntity[_charEntityIndex++];
}
public override bool MovePrevious()
{
if (_charEntityIndex == -1)
{
return false;
}
// Could be == length if just read the last character
Debug.Assert(_charEntityIndex <= _charEntity.Length);
if (_charEntityIndex > 0)
{
_charEntityIndex--;
return true;
}
return false;
}
public override void Reset()
{
_charEntityIndex = -1;
}
private static int SurrogateCharToUtf32(char highSurrogate, char lowSurrogate)
{
return XmlCharType.CombineSurrogateChar(lowSurrogate, highSurrogate);
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Text;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Xml
{
internal sealed class CharEntityEncoderFallback : EncoderFallback
{
private CharEntityEncoderFallbackBuffer? _fallbackBuffer;
private int[]? _textContentMarks;
private int _endMarkPos;
private int _curMarkPos;
public override int MaxCharCount => 12;
internal int StartOffset { get; set; }
public override EncoderFallbackBuffer CreateFallbackBuffer()
{
return _fallbackBuffer ??= new CharEntityEncoderFallbackBuffer(this);
}
[MemberNotNull(nameof(_textContentMarks))]
internal void Reset(int[] textContentMarks, int endMarkPos)
{
_textContentMarks = textContentMarks;
_endMarkPos = endMarkPos;
_curMarkPos = 0;
}
private bool CanReplaceAt(int index)
{
Debug.Assert(_textContentMarks != null);
int mPos = _curMarkPos;
int charPos = StartOffset + index;
while (mPos < _endMarkPos && charPos >= _textContentMarks[mPos + 1])
{
mPos++;
}
_curMarkPos = mPos;
return (mPos & 1) != 0;
}
private sealed class CharEntityEncoderFallbackBuffer : EncoderFallbackBuffer
{
private readonly CharEntityEncoderFallback _parent;
private string _charEntity = string.Empty;
private int _charEntityIndex = -1;
internal CharEntityEncoderFallbackBuffer(CharEntityEncoderFallback parent)
{
_parent = parent;
}
public override int Remaining => _charEntityIndex == -1 ? 0 : _charEntity.Length - _charEntityIndex;
public override bool Fallback(char charUnknown, int index)
{
// If we are already in fallback, throw, it's probably at the suspect character in charEntity
if (_charEntityIndex >= 0)
{
(new EncoderExceptionFallback()).CreateFallbackBuffer().Fallback(charUnknown, index);
}
// find out if we can replace the character with entity
if (_parent.CanReplaceAt(index))
{
// Create the replacement character entity
_charEntity = string.Create(null, stackalloc char[64], $"&#x{(int)charUnknown:X};");
_charEntityIndex = 0;
return true;
}
EncoderFallbackBuffer errorFallbackBuffer = (new EncoderExceptionFallback()).CreateFallbackBuffer();
errorFallbackBuffer.Fallback(charUnknown, index);
return false;
}
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index)
{
// check input surrogate pair
if (!char.IsSurrogatePair(charUnknownHigh, charUnknownLow))
{
throw XmlConvert.CreateInvalidSurrogatePairException(charUnknownHigh, charUnknownLow);
}
// If we are already in fallback, throw, it's probably at the suspect character in charEntity
if (_charEntityIndex >= 0)
{
(new EncoderExceptionFallback()).CreateFallbackBuffer().Fallback(charUnknownHigh, charUnknownLow, index);
}
if (_parent.CanReplaceAt(index))
{
// Create the replacement character entity
_charEntity = string.Create(null, stackalloc char[64], $"&#x{SurrogateCharToUtf32(charUnknownHigh, charUnknownLow):X};");
_charEntityIndex = 0;
return true;
}
EncoderFallbackBuffer errorFallbackBuffer = (new EncoderExceptionFallback()).CreateFallbackBuffer();
errorFallbackBuffer.Fallback(charUnknownHigh, charUnknownLow, index);
return false;
}
public override char GetNextChar()
{
// The protocol using GetNextChar() and MovePrevious() called by Encoder is not well documented.
// Here we have to signal to Encoder that the previous read was last character. Only AFTER we can
// mark our self as done (-1). Otherwise MovePrevious() can still be called, but -1 is already incorrectly set
// and return false from MovePrevious(). Then Encoder swallowing the rest of the bytes.
if (_charEntityIndex == _charEntity.Length)
{
_charEntityIndex = -1;
}
if (_charEntityIndex == -1)
{
return (char)0;
}
Debug.Assert(_charEntityIndex < _charEntity.Length);
return _charEntity[_charEntityIndex++];
}
public override bool MovePrevious()
{
if (_charEntityIndex == -1)
{
return false;
}
// Could be == length if just read the last character
Debug.Assert(_charEntityIndex <= _charEntity.Length);
if (_charEntityIndex > 0)
{
_charEntityIndex--;
return true;
}
return false;
}
public override void Reset()
{
_charEntityIndex = -1;
}
private static int SurrogateCharToUtf32(char highSurrogate, char lowSurrogate)
{
return XmlCharType.CombineSurrogateChar(lowSurrogate, highSurrogate);
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/FieldAccessors/RegularStaticFieldAccessor.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Internal.Runtime;
namespace Internal.Reflection.Execution.FieldAccessors
{
internal abstract class RegularStaticFieldAccessor : WritableStaticFieldAccessor
{
protected RegularStaticFieldAccessor(IntPtr cctorContext, IntPtr staticsBase, int fieldOffset, FieldTableFlags fieldBase, RuntimeTypeHandle fieldTypeHandle)
: base(cctorContext, fieldTypeHandle)
{
StaticsBase = staticsBase;
_fieldFlags = fieldBase;
FieldOffset = fieldOffset;
}
protected IntPtr StaticsBase { get; }
private readonly FieldTableFlags _fieldFlags;
protected int FieldOffset { get; }
protected FieldTableFlags FieldBase => _fieldFlags & FieldTableFlags.StorageClass;
protected sealed override bool IsFieldInitOnly => (_fieldFlags & FieldTableFlags.IsInitOnly) == FieldTableFlags.IsInitOnly;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Internal.Runtime;
namespace Internal.Reflection.Execution.FieldAccessors
{
internal abstract class RegularStaticFieldAccessor : WritableStaticFieldAccessor
{
protected RegularStaticFieldAccessor(IntPtr cctorContext, IntPtr staticsBase, int fieldOffset, FieldTableFlags fieldBase, RuntimeTypeHandle fieldTypeHandle)
: base(cctorContext, fieldTypeHandle)
{
StaticsBase = staticsBase;
_fieldFlags = fieldBase;
FieldOffset = fieldOffset;
}
protected IntPtr StaticsBase { get; }
private readonly FieldTableFlags _fieldFlags;
protected int FieldOffset { get; }
protected FieldTableFlags FieldBase => _fieldFlags & FieldTableFlags.StorageClass;
protected sealed override bool IsFieldInitOnly => (_fieldFlags & FieldTableFlags.IsInitOnly) == FieldTableFlags.IsInitOnly;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Net.Ping/tests/FunctionalTests/LoggingTest.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.Tracing;
using Xunit;
namespace System.Net.NetworkInformation.Tests
{
public class LoggingTest
{
[Fact]
public void EventSource_ExistsWithCorrectId()
{
Type esType = typeof(Ping).Assembly.GetType("System.Net.NetEventSource", throwOnError: false, ignoreCase: false);
if (esType != null)
{
Assert.Equal("Private.InternalDiagnostics.System.Net.Ping", EventSource.GetName(esType));
Assert.Equal(Guid.Parse("37627c1f-34a9-539e-ab8c-84303b966b74"), EventSource.GetGuid(esType));
Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location));
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.Tracing;
using Xunit;
namespace System.Net.NetworkInformation.Tests
{
public class LoggingTest
{
[Fact]
public void EventSource_ExistsWithCorrectId()
{
Type esType = typeof(Ping).Assembly.GetType("System.Net.NetEventSource", throwOnError: false, ignoreCase: false);
if (esType != null)
{
Assert.Equal("Private.InternalDiagnostics.System.Net.Ping", EventSource.GetName(esType));
Assert.Equal(Guid.Parse("37627c1f-34a9-539e-ab8c-84303b966b74"), EventSource.GetGuid(esType));
Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location));
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadHelperMethodImport.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Internal.JitInterface;
using Internal.Text;
using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
namespace ILCompiler.DependencyAnalysis.ReadyToRun
{
/// <summary>
/// This class represents a single indirection cell used to call delay load helpers.
/// In addition to PrecodeHelperImport instances of this import type emit GC ref map
/// entries into the R2R executable.
/// </summary>
public class DelayLoadHelperMethodImport : DelayLoadHelperImport, IMethodNode
{
private readonly MethodWithToken _method;
private readonly bool _useInstantiatingStub;
public DelayLoadHelperMethodImport(
NodeFactory factory,
ImportSectionNode importSectionNode,
ReadyToRunHelper helper,
MethodWithToken method,
bool useVirtualCall,
bool useInstantiatingStub,
Signature instanceSignature,
MethodDesc callingMethod = null)
: base(factory, importSectionNode, helper, instanceSignature, useVirtualCall, useJumpableStub: false, callingMethod)
{
_method = method;
_useInstantiatingStub = useInstantiatingStub;
}
public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory)
{
foreach (DependencyListEntry baseEntry in base.GetStaticDependencies(factory))
{
yield return baseEntry;
}
if (_useInstantiatingStub)
{
// Require compilation of the canonical version for instantiating stubs
MethodDesc canonMethod = _method.Method.GetCanonMethodTarget(CanonicalFormKind.Specific);
if (factory.CompilationModuleGroup.ContainsMethodBody(canonMethod, false))
{
ISymbolNode canonMethodNode = factory.CompiledMethodNode(canonMethod);
yield return new DependencyListEntry(canonMethodNode, "Canonical method for instantiating stub");
}
}
}
public override int ClassCode => 192837465;
public MethodDesc Method => _method.Method;
public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
{
DelayLoadHelperMethodImport otherNode = (DelayLoadHelperMethodImport)other;
int result = _useInstantiatingStub.CompareTo(otherNode._useInstantiatingStub);
if (result != 0)
return result;
result = _method.CompareTo(otherNode._method, comparer);
if (result != 0)
return result;
return base.CompareToImpl(other, comparer);
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Internal.JitInterface;
using Internal.Text;
using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
namespace ILCompiler.DependencyAnalysis.ReadyToRun
{
/// <summary>
/// This class represents a single indirection cell used to call delay load helpers.
/// In addition to PrecodeHelperImport instances of this import type emit GC ref map
/// entries into the R2R executable.
/// </summary>
public class DelayLoadHelperMethodImport : DelayLoadHelperImport, IMethodNode
{
private readonly MethodWithToken _method;
private readonly bool _useInstantiatingStub;
public DelayLoadHelperMethodImport(
NodeFactory factory,
ImportSectionNode importSectionNode,
ReadyToRunHelper helper,
MethodWithToken method,
bool useVirtualCall,
bool useInstantiatingStub,
Signature instanceSignature,
MethodDesc callingMethod = null)
: base(factory, importSectionNode, helper, instanceSignature, useVirtualCall, useJumpableStub: false, callingMethod)
{
_method = method;
_useInstantiatingStub = useInstantiatingStub;
}
public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory)
{
foreach (DependencyListEntry baseEntry in base.GetStaticDependencies(factory))
{
yield return baseEntry;
}
if (_useInstantiatingStub)
{
// Require compilation of the canonical version for instantiating stubs
MethodDesc canonMethod = _method.Method.GetCanonMethodTarget(CanonicalFormKind.Specific);
if (factory.CompilationModuleGroup.ContainsMethodBody(canonMethod, false))
{
ISymbolNode canonMethodNode = factory.CompiledMethodNode(canonMethod);
yield return new DependencyListEntry(canonMethodNode, "Canonical method for instantiating stub");
}
}
}
public override int ClassCode => 192837465;
public MethodDesc Method => _method.Method;
public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
{
DelayLoadHelperMethodImport otherNode = (DelayLoadHelperMethodImport)other;
int result = _useInstantiatingStub.CompareTo(otherNode._useInstantiatingStub);
if (result != 0)
return result;
result = _method.CompareTo(otherNode._method, comparer);
if (result != 0)
return result;
return base.CompareToImpl(other, comparer);
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class OpenSslNoInit
{
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
private static partial int OpenSslAvailable();
private static readonly Lazy<bool> s_openSslAvailable =
new Lazy<bool>(() => OpenSslAvailable() != 0);
internal static bool OpenSslIsAvailable => s_openSslAvailable.Value;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class OpenSslNoInit
{
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
private static partial int OpenSslAvailable();
private static readonly Lazy<bool> s_openSslAvailable =
new Lazy<bool>(() => OpenSslAvailable() != 0);
internal static bool OpenSslIsAvailable => s_openSslAvailable.Value;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Collections.Immutable
{
/// <content>
/// Contains the inner Builder class.
/// </content>
public sealed partial class ImmutableList<T>
{
/// <summary>
/// A list that mutates with little or no memory allocations,
/// can produce and/or build on immutable list instances very efficiently.
/// </summary>
/// <remarks>
/// <para>
/// While <see cref="ImmutableList{T}.AddRange"/> and other bulk change methods
/// already provide fast bulk change operations on the collection, this class allows
/// multiple combinations of changes to be made to a set with equal efficiency.
/// </para>
/// <para>
/// Instance members of this class are <em>not</em> thread-safe.
/// </para>
/// </remarks>
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(ImmutableListBuilderDebuggerProxy<>))]
public sealed class Builder : IList<T>, IList, IOrderedCollection<T>, IImmutableListQueries<T>, IReadOnlyList<T>
{
/// <summary>
/// The binary tree used to store the contents of the list. Contents are typically not entirely frozen.
/// </summary>
private Node _root = Node.EmptyNode;
/// <summary>
/// Caches an immutable instance that represents the current state of the collection.
/// </summary>
/// <value>Null if no immutable view has been created for the current version.</value>
private ImmutableList<T>? _immutable;
/// <summary>
/// A number that increments every time the builder changes its contents.
/// </summary>
private int _version;
/// <summary>
/// The object callers may use to synchronize access to this collection.
/// </summary>
private object? _syncRoot;
/// <summary>
/// Initializes a new instance of the <see cref="Builder"/> class.
/// </summary>
/// <param name="list">A list to act as the basis for a new list.</param>
internal Builder(ImmutableList<T> list)
{
Requires.NotNull(list, nameof(list));
_root = list._root;
_immutable = list;
}
#region IList<T> Properties
/// <summary>
/// Gets the number of elements in this list.
/// </summary>
public int Count
{
get { return this.Root.Count; }
}
/// <summary>
/// Gets a value indicating whether this instance is read-only.
/// </summary>
/// <value>Always <c>false</c>.</value>
bool ICollection<T>.IsReadOnly
{
get { return false; }
}
#endregion
/// <summary>
/// Gets the current version of the contents of this builder.
/// </summary>
internal int Version
{
get { return _version; }
}
/// <summary>
/// Gets or sets the root node that represents the data in this collection.
/// </summary>
internal Node Root
{
get
{
return _root;
}
private set
{
// We *always* increment the version number because some mutations
// may not create a new value of root, although the existing root
// instance may have mutated.
_version++;
if (_root != value)
{
_root = value;
// Clear any cached value for the immutable view since it is now invalidated.
_immutable = null;
}
}
}
#region Indexers
/// <summary>
/// Gets or sets the value for a given index into the list.
/// </summary>
/// <param name="index">The index of the desired element.</param>
/// <returns>The value at the specified index.</returns>
public T this[int index]
{
get
{
return this.Root.ItemRef(index);
}
set
{
this.Root = this.Root.ReplaceAt(index, value);
}
}
/// <summary>
/// Gets the element in the collection at a given index.
/// </summary>
T IOrderedCollection<T>.this[int index]
{
get
{
return this[index];
}
}
/// <summary>
/// Gets a read-only reference to the value for a given index into the list.
/// </summary>
/// <param name="index">The index of the desired element.</param>
/// <returns>A read-only reference to the value at the specified index.</returns>
public ref readonly T ItemRef(int index)
{
return ref this.Root.ItemRef(index);
}
#endregion
#region IList<T> Methods
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public int IndexOf(T item)
{
return this.Root.IndexOf(item, EqualityComparer<T>.Default);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Insert(int index, T item)
{
this.Root = this.Root.Insert(index, item);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void RemoveAt(int index)
{
this.Root = this.Root.RemoveAt(index);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Add(T item)
{
this.Root = this.Root.Add(item);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Clear()
{
this.Root = ImmutableList<T>.Node.EmptyNode;
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public bool Contains(T item)
{
return this.IndexOf(item) >= 0;
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public bool Remove(T item)
{
int index = this.IndexOf(item);
if (index < 0)
{
return false;
}
this.Root = this.Root.RemoveAt(index);
return true;
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
public ImmutableList<T>.Enumerator GetEnumerator()
{
return this.Root.GetEnumerator(this);
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
#endregion
#region IImmutableListQueries<T> methods
/// <summary>
/// Performs the specified action on each element of the list.
/// </summary>
/// <param name="action">The System.Action<T> delegate to perform on each element of the list.</param>
public void ForEach(Action<T> action)
{
Requires.NotNull(action, nameof(action));
foreach (T item in this)
{
action(item);
}
}
/// <summary>
/// Copies the entire ImmutableList<T> to a compatible one-dimensional
/// array, starting at the beginning of the target array.
/// </summary>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
public void CopyTo(T[] array) => _root.CopyTo(array);
/// <summary>
/// Copies the entire ImmutableList<T> to a compatible one-dimensional
/// array, starting at the specified index of the target array.
/// </summary>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
/// <param name="arrayIndex">
/// The zero-based index in array at which copying begins.
/// </param>
public void CopyTo(T[] array, int arrayIndex) => _root.CopyTo(array, arrayIndex);
/// <summary>
/// Copies a range of elements from the ImmutableList<T> to
/// a compatible one-dimensional array, starting at the specified index of the
/// target array.
/// </summary>
/// <param name="index">
/// The zero-based index in the source ImmutableList<T> at
/// which copying begins.
/// </param>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
/// <param name="count">The number of elements to copy.</param>
public void CopyTo(int index, T[] array, int arrayIndex, int count) => _root.CopyTo(index, array, arrayIndex, count);
/// <summary>
/// Creates a shallow copy of a range of elements in the source ImmutableList<T>.
/// </summary>
/// <param name="index">
/// The zero-based ImmutableList<T> index at which the range
/// starts.
/// </param>
/// <param name="count">
/// The number of elements in the range.
/// </param>
/// <returns>
/// A shallow copy of a range of elements in the source ImmutableList<T>.
/// </returns>
public ImmutableList<T> GetRange(int index, int count)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
return ImmutableList<T>.WrapNode(Node.NodeTreeFromList(this, index, count));
}
/// <summary>
/// Converts the elements in the current ImmutableList<T> to
/// another type, and returns a list containing the converted elements.
/// </summary>
/// <param name="converter">
/// A System.Converter<TInput,TOutput> delegate that converts each element from
/// one type to another type.
/// </param>
/// <typeparam name="TOutput">
/// The type of the elements of the target array.
/// </typeparam>
/// <returns>
/// A ImmutableList<T> of the target type containing the converted
/// elements from the current ImmutableList<T>.
/// </returns>
public ImmutableList<TOutput> ConvertAll<TOutput>(Func<T, TOutput> converter)
{
Requires.NotNull(converter, nameof(converter));
return ImmutableList<TOutput>.WrapNode(_root.ConvertAll(converter));
}
/// <summary>
/// Determines whether the ImmutableList<T> contains elements
/// that match the conditions defined by the specified predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to search for.
/// </param>
/// <returns>
/// true if the ImmutableList<T> contains one or more elements
/// that match the conditions defined by the specified predicate; otherwise,
/// false.
/// </returns>
public bool Exists(Predicate<T> match) => _root.Exists(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the first occurrence within the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The first element that matches the conditions defined by the specified predicate,
/// if found; otherwise, the default value for type T.
/// </returns>
public T? Find(Predicate<T> match) => _root.Find(match);
/// <summary>
/// Retrieves all the elements that match the conditions defined by the specified
/// predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to search for.
/// </param>
/// <returns>
/// A ImmutableList<T> containing all the elements that match
/// the conditions defined by the specified predicate, if found; otherwise, an
/// empty ImmutableList<T>.
/// </returns>
public ImmutableList<T> FindAll(Predicate<T> match) => _root.FindAll(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(Predicate<T> match) => _root.FindIndex(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the range of elements in the ImmutableList<T> that extends
/// from the specified index to the last element.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element to search for.</param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(int startIndex, Predicate<T> match) => _root.FindIndex(startIndex, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the range of elements in the ImmutableList<T> that starts
/// at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element to search for.</param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(int startIndex, int count, Predicate<T> match) => _root.FindIndex(startIndex, count, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the last occurrence within the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The last element that matches the conditions defined by the specified predicate,
/// if found; otherwise, the default value for type T.
/// </returns>
public T? FindLast(Predicate<T> match) => _root.FindLast(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(Predicate<T> match) => _root.FindLastIndex(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the range of elements in the ImmutableList<T> that extends
/// from the first element to the specified index.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.</param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(int startIndex, Predicate<T> match) => _root.FindLastIndex(startIndex, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the range of elements in the ImmutableList<T> that contains
/// the specified number of elements and ends at the specified index.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(int startIndex, int count, Predicate<T> match) => _root.FindLastIndex(startIndex, count, match);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that extends from the specified index to the last element.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that extends from index
/// to the last element, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index) =>
_root.IndexOf(item, index, this.Count - index, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that starts at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <param name="count">
/// The number of elements in the section to search.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that starts at index and
/// contains count number of elements, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index, int count) =>
_root.IndexOf(item, index, count, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that starts at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <param name="count">
/// The number of elements in the section to search.
/// </param>
/// <param name="equalityComparer">
/// The equality comparer to use in the search.
/// If <c>null</c>, <see cref="EqualityComparer{T}.Default"/> is used.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that starts at index and
/// contains count number of elements, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index, int count, IEqualityComparer<T>? equalityComparer) =>
_root.IndexOf(item, index, count, equalityComparer);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item)
{
if (this.Count == 0)
{
return -1;
}
return _root.LastIndexOf(item, this.Count - 1, this.Count, EqualityComparer<T>.Default);
}
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex)
{
if (this.Count == 0 && startIndex == 0)
{
return -1;
}
return _root.LastIndexOf(item, startIndex, startIndex + 1, EqualityComparer<T>.Default);
}
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex, int count) =>
_root.LastIndexOf(item, startIndex, count, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="equalityComparer">The equality comparer to use in the search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex, int count, IEqualityComparer<T>? equalityComparer) =>
_root.LastIndexOf(item, startIndex, count, equalityComparer);
/// <summary>
/// Determines whether every element in the ImmutableList<T>
/// matches the conditions defined by the specified predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions to check against
/// the elements.
/// </param>
/// <returns>
/// true if every element in the ImmutableList<T> matches the
/// conditions defined by the specified predicate; otherwise, false. If the list
/// has no elements, the return value is true.
/// </returns>
public bool TrueForAll(Predicate<T> match) => _root.TrueForAll(match);
#endregion
#region Public methods
/// <summary>
/// Adds the elements of a sequence to the end of this collection.
/// </summary>
/// <param name="items">
/// The sequence whose elements should be appended to this collection.
/// The sequence itself cannot be null, but it can contain elements that are
/// null, if type <typeparamref name="T"/> is a reference type.
/// </param>
public void AddRange(IEnumerable<T> items)
{
Requires.NotNull(items, nameof(items));
this.Root = this.Root.AddRange(items);
}
/// <summary>
/// Inserts the elements of a collection into the ImmutableList<T>
/// at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index at which the new elements should be inserted.
/// </param>
/// <param name="items">
/// The collection whose elements should be inserted into the ImmutableList<T>.
/// The collection itself cannot be null, but it can contain elements that are
/// null, if type T is a reference type.
/// </param>
public void InsertRange(int index, IEnumerable<T> items)
{
Requires.Range(index >= 0 && index <= this.Count, nameof(index));
Requires.NotNull(items, nameof(items));
this.Root = this.Root.InsertRange(index, items);
}
/// <summary>
/// Removes all the elements that match the conditions defined by the specified
/// predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to remove.
/// </param>
/// <returns>
/// The number of elements removed from the ImmutableList<T>
/// </returns>
public int RemoveAll(Predicate<T> match)
{
Requires.NotNull(match, nameof(match));
int count = this.Count;
this.Root = this.Root.RemoveAll(match);
return count - this.Count;
}
/// <summary>
/// Reverses the order of the elements in the entire ImmutableList<T>.
/// </summary>
public void Reverse()
{
this.Reverse(0, this.Count);
}
/// <summary>
/// Reverses the order of the elements in the specified range.
/// </summary>
/// <param name="index">The zero-based starting index of the range to reverse.</param>
/// <param name="count">The number of elements in the range to reverse.</param>
public void Reverse(int index, int count)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
this.Root = this.Root.Reverse(index, count);
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the default comparer.
/// </summary>
public void Sort()
{
this.Root = this.Root.Sort();
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the specified System.Comparison<T>.
/// </summary>
/// <param name="comparison">
/// The <see cref="Comparison{T}"/> to use when comparing elements.
/// </param>
/// <exception cref="ArgumentNullException"><paramref name="comparison"/> is null.</exception>
public void Sort(Comparison<T> comparison)
{
Requires.NotNull(comparison, nameof(comparison));
this.Root = this.Root.Sort(comparison);
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the specified comparer.
/// </summary>
/// <param name="comparer">
/// The <see cref="IComparer{T}"/> implementation to use when comparing
/// elements, or null to use <see cref="Comparer{T}.Default"/>.
/// </param>
public void Sort(IComparer<T>? comparer)
{
this.Root = this.Root.Sort(comparer);
}
/// <summary>
/// Sorts the elements in a range of elements in ImmutableList<T>
/// using the specified comparer.
/// </summary>
/// <param name="index">
/// The zero-based starting index of the range to sort.
/// </param>
/// <param name="count">
/// The length of the range to sort.
/// </param>
/// <param name="comparer">
/// The <see cref="IComparer{T}"/> implementation to use when comparing
/// elements, or null to use <see cref="Comparer{T}.Default"/>.
/// </param>
public void Sort(int index, int count, IComparer<T>? comparer)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
this.Root = this.Root.Sort(index, count, comparer);
}
/// <summary>
/// Searches the entire sorted System.Collections.Generic.List<T> for an element
/// using the default comparer and returns the zero-based index of the element.
/// </summary>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="InvalidOperationException">
/// The default comparer System.Collections.Generic.Comparer<T>.Default cannot
/// find an implementation of the System.IComparable<T> generic interface or
/// the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(T item)
{
return this.BinarySearch(item, null);
}
/// <summary>
/// Searches the entire sorted System.Collections.Generic.List<T> for an element
/// using the specified comparer and returns the zero-based index of the element.
/// </summary>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <param name="comparer">
/// The System.Collections.Generic.IComparer<T> implementation to use when comparing
/// elements.-or-null to use the default comparer System.Collections.Generic.Comparer<T>.Default.
/// </param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="InvalidOperationException">
/// comparer is null, and the default comparer System.Collections.Generic.Comparer<T>.Default
/// cannot find an implementation of the System.IComparable<T> generic interface
/// or the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(T item, IComparer<T>? comparer)
{
return this.BinarySearch(0, this.Count, item, comparer);
}
/// <summary>
/// Searches a range of elements in the sorted System.Collections.Generic.List<T>
/// for an element using the specified comparer and returns the zero-based index
/// of the element.
/// </summary>
/// <param name="index">The zero-based starting index of the range to search.</param>
/// <param name="count"> The length of the range to search.</param>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <param name="comparer">
/// The System.Collections.Generic.IComparer<T> implementation to use when comparing
/// elements, or null to use the default comparer System.Collections.Generic.Comparer<T>.Default.
/// </param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException">
/// index is less than 0.-or-count is less than 0.
/// </exception>
/// <exception cref="ArgumentException">
/// index and count do not denote a valid range in the System.Collections.Generic.List<T>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// comparer is null, and the default comparer System.Collections.Generic.Comparer<T>.Default
/// cannot find an implementation of the System.IComparable<T> generic interface
/// or the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
{
return this.Root.BinarySearch(index, count, item, comparer);
}
/// <summary>
/// Creates an immutable list based on the contents of this instance.
/// </summary>
/// <returns>An immutable list.</returns>
/// <remarks>
/// This method is an O(n) operation, and approaches O(1) time as the number of
/// actual mutations to the set since the last call to this method approaches 0.
/// </remarks>
public ImmutableList<T> ToImmutable()
{
// Creating an instance of ImmutableList<T> with our root node automatically freezes our tree,
// ensuring that the returned instance is immutable. Any further mutations made to this builder
// will clone (and unfreeze) the spine of modified nodes until the next time this method is invoked.
if (_immutable == null)
{
_immutable = ImmutableList<T>.WrapNode(this.Root);
}
return _immutable;
}
#endregion
#region IList members
/// <summary>
/// Adds an item to the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to add to the <see cref="IList"/>.</param>
/// <returns>
/// The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection,
/// </returns>
int IList.Add(object? value)
{
this.Add((T)value!);
return this.Count - 1;
}
/// <summary>
/// Clears this instance.
/// </summary>
void IList.Clear()
{
this.Clear();
}
/// <summary>
/// Determines whether the <see cref="IList"/> contains a specific value.
/// </summary>
/// <param name="value">The object to locate in the <see cref="IList"/>.</param>
/// <returns>
/// true if the <see cref="object"/> is found in the <see cref="IList"/>; otherwise, false.
/// </returns>
bool IList.Contains(object? value)
{
if (IsCompatibleObject(value))
{
return this.Contains((T)value!);
}
return false;
}
/// <summary>
/// Determines the index of a specific item in the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to locate in the <see cref="IList"/>.</param>
/// <returns>
/// The index of <paramref name="value"/> if found in the list; otherwise, -1.
/// </returns>
int IList.IndexOf(object? value)
{
if (IsCompatibleObject(value))
{
return this.IndexOf((T)value!);
}
return -1;
}
/// <summary>
/// Inserts an item to the <see cref="IList"/> at the specified index.
/// </summary>
/// <param name="index">The zero-based index at which <paramref name="value"/> should be inserted.</param>
/// <param name="value">The object to insert into the <see cref="IList"/>.</param>
void IList.Insert(int index, object? value)
{
this.Insert(index, (T)value!);
}
/// <summary>
/// Gets a value indicating whether the <see cref="IList"/> has a fixed size.
/// </summary>
/// <returns>true if the <see cref="IList"/> has a fixed size; otherwise, false.</returns>
bool IList.IsFixedSize
{
get { return false; }
}
/// <summary>
/// Gets a value indicating whether the <see cref="ICollection{T}"/> is read-only.
/// </summary>
/// <returns>true if the <see cref="ICollection{T}"/> is read-only; otherwise, false.
/// </returns>
bool IList.IsReadOnly
{
get { return false; }
}
/// <summary>
/// Removes the first occurrence of a specific object from the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to remove from the <see cref="IList"/>.</param>
void IList.Remove(object? value)
{
if (IsCompatibleObject(value))
{
this.Remove((T)value!);
}
}
/// <summary>
/// Gets or sets the <see cref="object"/> at the specified index.
/// </summary>
/// <value>
/// The <see cref="object"/>.
/// </value>
/// <param name="index">The index.</param>
/// <returns></returns>
object? IList.this[int index]
{
get { return this[index]; }
set { this[index] = (T)value!; }
}
#endregion
#region ICollection members
/// <summary>
/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
void ICollection.CopyTo(Array array, int arrayIndex)
{
this.Root.CopyTo(array, arrayIndex);
}
/// <summary>
/// Gets a value indicating whether access to the <see cref="ICollection"/> is synchronized (thread safe).
/// </summary>
/// <returns>true if access to the <see cref="ICollection"/> is synchronized (thread safe); otherwise, false.</returns>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
bool ICollection.IsSynchronized
{
get { return false; }
}
/// <summary>
/// Gets an object that can be used to synchronize access to the <see cref="ICollection"/>.
/// </summary>
/// <returns>An object that can be used to synchronize access to the <see cref="ICollection"/>.</returns>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
object ICollection.SyncRoot
{
get
{
if (_syncRoot == null)
{
System.Threading.Interlocked.CompareExchange<object?>(ref _syncRoot, new object(), null);
}
return _syncRoot;
}
}
#endregion
}
}
/// <summary>
/// A simple view of the immutable list that the debugger can show to the developer.
/// </summary>
internal sealed class ImmutableListBuilderDebuggerProxy<T>
{
/// <summary>
/// The collection to be enumerated.
/// </summary>
private readonly ImmutableList<T>.Builder _list;
/// <summary>
/// The simple view of the collection.
/// </summary>
private T[]? _cachedContents;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableListBuilderDebuggerProxy{T}"/> class.
/// </summary>
/// <param name="builder">The list to display in the debugger</param>
public ImmutableListBuilderDebuggerProxy(ImmutableList<T>.Builder builder)
{
Requires.NotNull(builder, nameof(builder));
_list = builder;
}
/// <summary>
/// Gets a simple debugger-viewable list.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Contents
{
get
{
if (_cachedContents == null)
{
_cachedContents = _list.ToArray(_list.Count);
}
return _cachedContents;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Collections.Immutable
{
/// <content>
/// Contains the inner Builder class.
/// </content>
public sealed partial class ImmutableList<T>
{
/// <summary>
/// A list that mutates with little or no memory allocations,
/// can produce and/or build on immutable list instances very efficiently.
/// </summary>
/// <remarks>
/// <para>
/// While <see cref="ImmutableList{T}.AddRange"/> and other bulk change methods
/// already provide fast bulk change operations on the collection, this class allows
/// multiple combinations of changes to be made to a set with equal efficiency.
/// </para>
/// <para>
/// Instance members of this class are <em>not</em> thread-safe.
/// </para>
/// </remarks>
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(ImmutableListBuilderDebuggerProxy<>))]
public sealed class Builder : IList<T>, IList, IOrderedCollection<T>, IImmutableListQueries<T>, IReadOnlyList<T>
{
/// <summary>
/// The binary tree used to store the contents of the list. Contents are typically not entirely frozen.
/// </summary>
private Node _root = Node.EmptyNode;
/// <summary>
/// Caches an immutable instance that represents the current state of the collection.
/// </summary>
/// <value>Null if no immutable view has been created for the current version.</value>
private ImmutableList<T>? _immutable;
/// <summary>
/// A number that increments every time the builder changes its contents.
/// </summary>
private int _version;
/// <summary>
/// The object callers may use to synchronize access to this collection.
/// </summary>
private object? _syncRoot;
/// <summary>
/// Initializes a new instance of the <see cref="Builder"/> class.
/// </summary>
/// <param name="list">A list to act as the basis for a new list.</param>
internal Builder(ImmutableList<T> list)
{
Requires.NotNull(list, nameof(list));
_root = list._root;
_immutable = list;
}
#region IList<T> Properties
/// <summary>
/// Gets the number of elements in this list.
/// </summary>
public int Count
{
get { return this.Root.Count; }
}
/// <summary>
/// Gets a value indicating whether this instance is read-only.
/// </summary>
/// <value>Always <c>false</c>.</value>
bool ICollection<T>.IsReadOnly
{
get { return false; }
}
#endregion
/// <summary>
/// Gets the current version of the contents of this builder.
/// </summary>
internal int Version
{
get { return _version; }
}
/// <summary>
/// Gets or sets the root node that represents the data in this collection.
/// </summary>
internal Node Root
{
get
{
return _root;
}
private set
{
// We *always* increment the version number because some mutations
// may not create a new value of root, although the existing root
// instance may have mutated.
_version++;
if (_root != value)
{
_root = value;
// Clear any cached value for the immutable view since it is now invalidated.
_immutable = null;
}
}
}
#region Indexers
/// <summary>
/// Gets or sets the value for a given index into the list.
/// </summary>
/// <param name="index">The index of the desired element.</param>
/// <returns>The value at the specified index.</returns>
public T this[int index]
{
get
{
return this.Root.ItemRef(index);
}
set
{
this.Root = this.Root.ReplaceAt(index, value);
}
}
/// <summary>
/// Gets the element in the collection at a given index.
/// </summary>
T IOrderedCollection<T>.this[int index]
{
get
{
return this[index];
}
}
/// <summary>
/// Gets a read-only reference to the value for a given index into the list.
/// </summary>
/// <param name="index">The index of the desired element.</param>
/// <returns>A read-only reference to the value at the specified index.</returns>
public ref readonly T ItemRef(int index)
{
return ref this.Root.ItemRef(index);
}
#endregion
#region IList<T> Methods
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public int IndexOf(T item)
{
return this.Root.IndexOf(item, EqualityComparer<T>.Default);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Insert(int index, T item)
{
this.Root = this.Root.Insert(index, item);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void RemoveAt(int index)
{
this.Root = this.Root.RemoveAt(index);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Add(T item)
{
this.Root = this.Root.Add(item);
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public void Clear()
{
this.Root = ImmutableList<T>.Node.EmptyNode;
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public bool Contains(T item)
{
return this.IndexOf(item) >= 0;
}
/// <summary>
/// See <see cref="IList{T}"/>
/// </summary>
public bool Remove(T item)
{
int index = this.IndexOf(item);
if (index < 0)
{
return false;
}
this.Root = this.Root.RemoveAt(index);
return true;
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
public ImmutableList<T>.Enumerator GetEnumerator()
{
return this.Root.GetEnumerator(this);
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="IEnumerator{T}"/> that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
#endregion
#region IImmutableListQueries<T> methods
/// <summary>
/// Performs the specified action on each element of the list.
/// </summary>
/// <param name="action">The System.Action<T> delegate to perform on each element of the list.</param>
public void ForEach(Action<T> action)
{
Requires.NotNull(action, nameof(action));
foreach (T item in this)
{
action(item);
}
}
/// <summary>
/// Copies the entire ImmutableList<T> to a compatible one-dimensional
/// array, starting at the beginning of the target array.
/// </summary>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
public void CopyTo(T[] array) => _root.CopyTo(array);
/// <summary>
/// Copies the entire ImmutableList<T> to a compatible one-dimensional
/// array, starting at the specified index of the target array.
/// </summary>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
/// <param name="arrayIndex">
/// The zero-based index in array at which copying begins.
/// </param>
public void CopyTo(T[] array, int arrayIndex) => _root.CopyTo(array, arrayIndex);
/// <summary>
/// Copies a range of elements from the ImmutableList<T> to
/// a compatible one-dimensional array, starting at the specified index of the
/// target array.
/// </summary>
/// <param name="index">
/// The zero-based index in the source ImmutableList<T> at
/// which copying begins.
/// </param>
/// <param name="array">
/// The one-dimensional System.Array that is the destination of the elements
/// copied from ImmutableList<T>. The System.Array must have
/// zero-based indexing.
/// </param>
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
/// <param name="count">The number of elements to copy.</param>
public void CopyTo(int index, T[] array, int arrayIndex, int count) => _root.CopyTo(index, array, arrayIndex, count);
/// <summary>
/// Creates a shallow copy of a range of elements in the source ImmutableList<T>.
/// </summary>
/// <param name="index">
/// The zero-based ImmutableList<T> index at which the range
/// starts.
/// </param>
/// <param name="count">
/// The number of elements in the range.
/// </param>
/// <returns>
/// A shallow copy of a range of elements in the source ImmutableList<T>.
/// </returns>
public ImmutableList<T> GetRange(int index, int count)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
return ImmutableList<T>.WrapNode(Node.NodeTreeFromList(this, index, count));
}
/// <summary>
/// Converts the elements in the current ImmutableList<T> to
/// another type, and returns a list containing the converted elements.
/// </summary>
/// <param name="converter">
/// A System.Converter<TInput,TOutput> delegate that converts each element from
/// one type to another type.
/// </param>
/// <typeparam name="TOutput">
/// The type of the elements of the target array.
/// </typeparam>
/// <returns>
/// A ImmutableList<T> of the target type containing the converted
/// elements from the current ImmutableList<T>.
/// </returns>
public ImmutableList<TOutput> ConvertAll<TOutput>(Func<T, TOutput> converter)
{
Requires.NotNull(converter, nameof(converter));
return ImmutableList<TOutput>.WrapNode(_root.ConvertAll(converter));
}
/// <summary>
/// Determines whether the ImmutableList<T> contains elements
/// that match the conditions defined by the specified predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to search for.
/// </param>
/// <returns>
/// true if the ImmutableList<T> contains one or more elements
/// that match the conditions defined by the specified predicate; otherwise,
/// false.
/// </returns>
public bool Exists(Predicate<T> match) => _root.Exists(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the first occurrence within the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The first element that matches the conditions defined by the specified predicate,
/// if found; otherwise, the default value for type T.
/// </returns>
public T? Find(Predicate<T> match) => _root.Find(match);
/// <summary>
/// Retrieves all the elements that match the conditions defined by the specified
/// predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to search for.
/// </param>
/// <returns>
/// A ImmutableList<T> containing all the elements that match
/// the conditions defined by the specified predicate, if found; otherwise, an
/// empty ImmutableList<T>.
/// </returns>
public ImmutableList<T> FindAll(Predicate<T> match) => _root.FindAll(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(Predicate<T> match) => _root.FindIndex(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the range of elements in the ImmutableList<T> that extends
/// from the specified index to the last element.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element to search for.</param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(int startIndex, Predicate<T> match) => _root.FindIndex(startIndex, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the first occurrence within
/// the range of elements in the ImmutableList<T> that starts
/// at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element to search for.</param>
/// <returns>
/// The zero-based index of the first occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindIndex(int startIndex, int count, Predicate<T> match) => _root.FindIndex(startIndex, count, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the last occurrence within the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The last element that matches the conditions defined by the specified predicate,
/// if found; otherwise, the default value for type T.
/// </returns>
public T? FindLast(Predicate<T> match) => _root.FindLast(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the entire ImmutableList<T>.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(Predicate<T> match) => _root.FindLastIndex(match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the range of elements in the ImmutableList<T> that extends
/// from the first element to the specified index.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="match">The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.</param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(int startIndex, Predicate<T> match) => _root.FindLastIndex(startIndex, match);
/// <summary>
/// Searches for an element that matches the conditions defined by the specified
/// predicate, and returns the zero-based index of the last occurrence within
/// the range of elements in the ImmutableList<T> that contains
/// the specified number of elements and ends at the specified index.
/// </summary>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the element
/// to search for.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of an element that matches the
/// conditions defined by match, if found; otherwise, -1.
/// </returns>
public int FindLastIndex(int startIndex, int count, Predicate<T> match) => _root.FindLastIndex(startIndex, count, match);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that extends from the specified index to the last element.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that extends from index
/// to the last element, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index) =>
_root.IndexOf(item, index, this.Count - index, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that starts at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <param name="count">
/// The number of elements in the section to search.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that starts at index and
/// contains count number of elements, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index, int count) =>
_root.IndexOf(item, index, count, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// first occurrence within the range of elements in the ImmutableList<T>
/// that starts at the specified index and contains the specified number of elements.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="index">
/// The zero-based starting index of the search. 0 (zero) is valid in an empty
/// list.
/// </param>
/// <param name="count">
/// The number of elements in the section to search.
/// </param>
/// <param name="equalityComparer">
/// The equality comparer to use in the search.
/// If <c>null</c>, <see cref="EqualityComparer{T}.Default"/> is used.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of item within the range of
/// elements in the ImmutableList<T> that starts at index and
/// contains count number of elements, if found; otherwise, -1.
/// </returns>
public int IndexOf(T item, int index, int count, IEqualityComparer<T>? equalityComparer) =>
_root.IndexOf(item, index, count, equalityComparer);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item)
{
if (this.Count == 0)
{
return -1;
}
return _root.LastIndexOf(item, this.Count - 1, this.Count, EqualityComparer<T>.Default);
}
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex)
{
if (this.Count == 0 && startIndex == 0)
{
return -1;
}
return _root.LastIndexOf(item, startIndex, startIndex + 1, EqualityComparer<T>.Default);
}
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex, int count) =>
_root.LastIndexOf(item, startIndex, count, EqualityComparer<T>.Default);
/// <summary>
/// Searches for the specified object and returns the zero-based index of the
/// last occurrence within the range of elements in the ImmutableList<T>
/// that contains the specified number of elements and ends at the specified
/// index.
/// </summary>
/// <param name="item">
/// The object to locate in the ImmutableList<T>. The value
/// can be null for reference types.
/// </param>
/// <param name="startIndex">The zero-based starting index of the backward search.</param>
/// <param name="count">The number of elements in the section to search.</param>
/// <param name="equalityComparer">The equality comparer to use in the search.</param>
/// <returns>
/// The zero-based index of the last occurrence of item within the range of elements
/// in the ImmutableList<T> that contains count number of elements
/// and ends at index, if found; otherwise, -1.
/// </returns>
public int LastIndexOf(T item, int startIndex, int count, IEqualityComparer<T>? equalityComparer) =>
_root.LastIndexOf(item, startIndex, count, equalityComparer);
/// <summary>
/// Determines whether every element in the ImmutableList<T>
/// matches the conditions defined by the specified predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions to check against
/// the elements.
/// </param>
/// <returns>
/// true if every element in the ImmutableList<T> matches the
/// conditions defined by the specified predicate; otherwise, false. If the list
/// has no elements, the return value is true.
/// </returns>
public bool TrueForAll(Predicate<T> match) => _root.TrueForAll(match);
#endregion
#region Public methods
/// <summary>
/// Adds the elements of a sequence to the end of this collection.
/// </summary>
/// <param name="items">
/// The sequence whose elements should be appended to this collection.
/// The sequence itself cannot be null, but it can contain elements that are
/// null, if type <typeparamref name="T"/> is a reference type.
/// </param>
public void AddRange(IEnumerable<T> items)
{
Requires.NotNull(items, nameof(items));
this.Root = this.Root.AddRange(items);
}
/// <summary>
/// Inserts the elements of a collection into the ImmutableList<T>
/// at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index at which the new elements should be inserted.
/// </param>
/// <param name="items">
/// The collection whose elements should be inserted into the ImmutableList<T>.
/// The collection itself cannot be null, but it can contain elements that are
/// null, if type T is a reference type.
/// </param>
public void InsertRange(int index, IEnumerable<T> items)
{
Requires.Range(index >= 0 && index <= this.Count, nameof(index));
Requires.NotNull(items, nameof(items));
this.Root = this.Root.InsertRange(index, items);
}
/// <summary>
/// Removes all the elements that match the conditions defined by the specified
/// predicate.
/// </summary>
/// <param name="match">
/// The System.Predicate<T> delegate that defines the conditions of the elements
/// to remove.
/// </param>
/// <returns>
/// The number of elements removed from the ImmutableList<T>
/// </returns>
public int RemoveAll(Predicate<T> match)
{
Requires.NotNull(match, nameof(match));
int count = this.Count;
this.Root = this.Root.RemoveAll(match);
return count - this.Count;
}
/// <summary>
/// Reverses the order of the elements in the entire ImmutableList<T>.
/// </summary>
public void Reverse()
{
this.Reverse(0, this.Count);
}
/// <summary>
/// Reverses the order of the elements in the specified range.
/// </summary>
/// <param name="index">The zero-based starting index of the range to reverse.</param>
/// <param name="count">The number of elements in the range to reverse.</param>
public void Reverse(int index, int count)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
this.Root = this.Root.Reverse(index, count);
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the default comparer.
/// </summary>
public void Sort()
{
this.Root = this.Root.Sort();
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the specified System.Comparison<T>.
/// </summary>
/// <param name="comparison">
/// The <see cref="Comparison{T}"/> to use when comparing elements.
/// </param>
/// <exception cref="ArgumentNullException"><paramref name="comparison"/> is null.</exception>
public void Sort(Comparison<T> comparison)
{
Requires.NotNull(comparison, nameof(comparison));
this.Root = this.Root.Sort(comparison);
}
/// <summary>
/// Sorts the elements in the entire ImmutableList<T> using
/// the specified comparer.
/// </summary>
/// <param name="comparer">
/// The <see cref="IComparer{T}"/> implementation to use when comparing
/// elements, or null to use <see cref="Comparer{T}.Default"/>.
/// </param>
public void Sort(IComparer<T>? comparer)
{
this.Root = this.Root.Sort(comparer);
}
/// <summary>
/// Sorts the elements in a range of elements in ImmutableList<T>
/// using the specified comparer.
/// </summary>
/// <param name="index">
/// The zero-based starting index of the range to sort.
/// </param>
/// <param name="count">
/// The length of the range to sort.
/// </param>
/// <param name="comparer">
/// The <see cref="IComparer{T}"/> implementation to use when comparing
/// elements, or null to use <see cref="Comparer{T}.Default"/>.
/// </param>
public void Sort(int index, int count, IComparer<T>? comparer)
{
Requires.Range(index >= 0, nameof(index));
Requires.Range(count >= 0, nameof(count));
Requires.Range(index + count <= this.Count, nameof(count));
this.Root = this.Root.Sort(index, count, comparer);
}
/// <summary>
/// Searches the entire sorted System.Collections.Generic.List<T> for an element
/// using the default comparer and returns the zero-based index of the element.
/// </summary>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="InvalidOperationException">
/// The default comparer System.Collections.Generic.Comparer<T>.Default cannot
/// find an implementation of the System.IComparable<T> generic interface or
/// the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(T item)
{
return this.BinarySearch(item, null);
}
/// <summary>
/// Searches the entire sorted System.Collections.Generic.List<T> for an element
/// using the specified comparer and returns the zero-based index of the element.
/// </summary>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <param name="comparer">
/// The System.Collections.Generic.IComparer<T> implementation to use when comparing
/// elements.-or-null to use the default comparer System.Collections.Generic.Comparer<T>.Default.
/// </param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="InvalidOperationException">
/// comparer is null, and the default comparer System.Collections.Generic.Comparer<T>.Default
/// cannot find an implementation of the System.IComparable<T> generic interface
/// or the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(T item, IComparer<T>? comparer)
{
return this.BinarySearch(0, this.Count, item, comparer);
}
/// <summary>
/// Searches a range of elements in the sorted System.Collections.Generic.List<T>
/// for an element using the specified comparer and returns the zero-based index
/// of the element.
/// </summary>
/// <param name="index">The zero-based starting index of the range to search.</param>
/// <param name="count"> The length of the range to search.</param>
/// <param name="item">The object to locate. The value can be null for reference types.</param>
/// <param name="comparer">
/// The System.Collections.Generic.IComparer<T> implementation to use when comparing
/// elements, or null to use the default comparer System.Collections.Generic.Comparer<T>.Default.
/// </param>
/// <returns>
/// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
/// if item is found; otherwise, a negative number that is the bitwise complement
/// of the index of the next element that is larger than item or, if there is
/// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException">
/// index is less than 0.-or-count is less than 0.
/// </exception>
/// <exception cref="ArgumentException">
/// index and count do not denote a valid range in the System.Collections.Generic.List<T>.
/// </exception>
/// <exception cref="InvalidOperationException">
/// comparer is null, and the default comparer System.Collections.Generic.Comparer<T>.Default
/// cannot find an implementation of the System.IComparable<T> generic interface
/// or the System.IComparable interface for type T.
/// </exception>
public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
{
return this.Root.BinarySearch(index, count, item, comparer);
}
/// <summary>
/// Creates an immutable list based on the contents of this instance.
/// </summary>
/// <returns>An immutable list.</returns>
/// <remarks>
/// This method is an O(n) operation, and approaches O(1) time as the number of
/// actual mutations to the set since the last call to this method approaches 0.
/// </remarks>
public ImmutableList<T> ToImmutable()
{
// Creating an instance of ImmutableList<T> with our root node automatically freezes our tree,
// ensuring that the returned instance is immutable. Any further mutations made to this builder
// will clone (and unfreeze) the spine of modified nodes until the next time this method is invoked.
if (_immutable == null)
{
_immutable = ImmutableList<T>.WrapNode(this.Root);
}
return _immutable;
}
#endregion
#region IList members
/// <summary>
/// Adds an item to the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to add to the <see cref="IList"/>.</param>
/// <returns>
/// The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection,
/// </returns>
int IList.Add(object? value)
{
this.Add((T)value!);
return this.Count - 1;
}
/// <summary>
/// Clears this instance.
/// </summary>
void IList.Clear()
{
this.Clear();
}
/// <summary>
/// Determines whether the <see cref="IList"/> contains a specific value.
/// </summary>
/// <param name="value">The object to locate in the <see cref="IList"/>.</param>
/// <returns>
/// true if the <see cref="object"/> is found in the <see cref="IList"/>; otherwise, false.
/// </returns>
bool IList.Contains(object? value)
{
if (IsCompatibleObject(value))
{
return this.Contains((T)value!);
}
return false;
}
/// <summary>
/// Determines the index of a specific item in the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to locate in the <see cref="IList"/>.</param>
/// <returns>
/// The index of <paramref name="value"/> if found in the list; otherwise, -1.
/// </returns>
int IList.IndexOf(object? value)
{
if (IsCompatibleObject(value))
{
return this.IndexOf((T)value!);
}
return -1;
}
/// <summary>
/// Inserts an item to the <see cref="IList"/> at the specified index.
/// </summary>
/// <param name="index">The zero-based index at which <paramref name="value"/> should be inserted.</param>
/// <param name="value">The object to insert into the <see cref="IList"/>.</param>
void IList.Insert(int index, object? value)
{
this.Insert(index, (T)value!);
}
/// <summary>
/// Gets a value indicating whether the <see cref="IList"/> has a fixed size.
/// </summary>
/// <returns>true if the <see cref="IList"/> has a fixed size; otherwise, false.</returns>
bool IList.IsFixedSize
{
get { return false; }
}
/// <summary>
/// Gets a value indicating whether the <see cref="ICollection{T}"/> is read-only.
/// </summary>
/// <returns>true if the <see cref="ICollection{T}"/> is read-only; otherwise, false.
/// </returns>
bool IList.IsReadOnly
{
get { return false; }
}
/// <summary>
/// Removes the first occurrence of a specific object from the <see cref="IList"/>.
/// </summary>
/// <param name="value">The object to remove from the <see cref="IList"/>.</param>
void IList.Remove(object? value)
{
if (IsCompatibleObject(value))
{
this.Remove((T)value!);
}
}
/// <summary>
/// Gets or sets the <see cref="object"/> at the specified index.
/// </summary>
/// <value>
/// The <see cref="object"/>.
/// </value>
/// <param name="index">The index.</param>
/// <returns></returns>
object? IList.this[int index]
{
get { return this[index]; }
set { this[index] = (T)value!; }
}
#endregion
#region ICollection members
/// <summary>
/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
void ICollection.CopyTo(Array array, int arrayIndex)
{
this.Root.CopyTo(array, arrayIndex);
}
/// <summary>
/// Gets a value indicating whether access to the <see cref="ICollection"/> is synchronized (thread safe).
/// </summary>
/// <returns>true if access to the <see cref="ICollection"/> is synchronized (thread safe); otherwise, false.</returns>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
bool ICollection.IsSynchronized
{
get { return false; }
}
/// <summary>
/// Gets an object that can be used to synchronize access to the <see cref="ICollection"/>.
/// </summary>
/// <returns>An object that can be used to synchronize access to the <see cref="ICollection"/>.</returns>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
object ICollection.SyncRoot
{
get
{
if (_syncRoot == null)
{
System.Threading.Interlocked.CompareExchange<object?>(ref _syncRoot, new object(), null);
}
return _syncRoot;
}
}
#endregion
}
}
/// <summary>
/// A simple view of the immutable list that the debugger can show to the developer.
/// </summary>
internal sealed class ImmutableListBuilderDebuggerProxy<T>
{
/// <summary>
/// The collection to be enumerated.
/// </summary>
private readonly ImmutableList<T>.Builder _list;
/// <summary>
/// The simple view of the collection.
/// </summary>
private T[]? _cachedContents;
/// <summary>
/// Initializes a new instance of the <see cref="ImmutableListBuilderDebuggerProxy{T}"/> class.
/// </summary>
/// <param name="builder">The list to display in the debugger</param>
public ImmutableListBuilderDebuggerProxy(ImmutableList<T>.Builder builder)
{
Requires.NotNull(builder, nameof(builder));
_list = builder;
}
/// <summary>
/// Gets a simple debugger-viewable list.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Contents
{
get
{
if (_cachedContents == null)
{
_cachedContents = _list.ToArray(_list.Count);
}
return _cachedContents;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector128/AndNot.UInt16.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void AndNotUInt16()
{
var test = new VectorBinaryOpTest__AndNotUInt16();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__AndNotUInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt16> _fld1;
public Vector128<UInt16> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__AndNotUInt16 testClass)
{
var result = Vector128.AndNot(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static UInt16[] _data2 = new UInt16[Op2ElementCount];
private static Vector128<UInt16> _clsVar1;
private static Vector128<UInt16> _clsVar2;
private Vector128<UInt16> _fld1;
private Vector128<UInt16> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__AndNotUInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
}
public VectorBinaryOpTest__AndNotUInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.AndNot(
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.AndNot), new Type[] {
typeof(Vector128<UInt16>),
typeof(Vector128<UInt16>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.AndNot), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt16));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.AndNot(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr);
var result = Vector128.AndNot(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__AndNotUInt16();
var result = Vector128.AndNot(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.AndNot(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.AndNot(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt16> op1, Vector128<UInt16> op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (ushort)(left[0] & ~right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (ushort)(left[i] & ~right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.AndNot)}<UInt16>(Vector128<UInt16>, Vector128<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void AndNotUInt16()
{
var test = new VectorBinaryOpTest__AndNotUInt16();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__AndNotUInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt16> _fld1;
public Vector128<UInt16> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__AndNotUInt16 testClass)
{
var result = Vector128.AndNot(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static UInt16[] _data2 = new UInt16[Op2ElementCount];
private static Vector128<UInt16> _clsVar1;
private static Vector128<UInt16> _clsVar2;
private Vector128<UInt16> _fld1;
private Vector128<UInt16> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__AndNotUInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
}
public VectorBinaryOpTest__AndNotUInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.AndNot(
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.AndNot), new Type[] {
typeof(Vector128<UInt16>),
typeof(Vector128<UInt16>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.AndNot), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt16));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.AndNot(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr);
var result = Vector128.AndNot(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__AndNotUInt16();
var result = Vector128.AndNot(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.AndNot(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.AndNot(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt16> op1, Vector128<UInt16> op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (ushort)(left[0] & ~right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (ushort)(left[i] & ~right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.AndNot)}<UInt16>(Vector128<UInt16>, Vector128<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/API/GC/Collect.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
<!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. -->
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="Collect.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<GCStressIncompatible>true</GCStressIncompatible>
</PropertyGroup>
<PropertyGroup>
<!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. -->
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="Collect.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/mono/mono/tests/pinvoke3.cs | //
// pinvoke3.cs:
//
// Tests for native->managed marshalling
//
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
public class Tests {
[StructLayout (LayoutKind.Sequential)]
public struct SimpleStruct {
public bool a;
public bool b;
public bool c;
public string d;
[MarshalAs(UnmanagedType.LPWStr)]
public string d2;
}
[StructLayout (LayoutKind.Sequential)]
public class SimpleClass {
public bool a;
public bool b;
public bool c;
public string d;
}
public static SimpleStruct delegate_test_struct (SimpleStruct ss)
{
SimpleStruct res;
res.a = !ss.a;
res.b = !ss.b;
res.c = !ss.c;
res.d = ss.d + "-RES";
res.d2 = ss.d2 + "-RES";
return res;
}
public static int delegate_test_struct_byref (int a, ref SimpleStruct ss, int b)
{
if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2") {
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
return 0;
}
return 1;
}
public static int delegate_test_struct_out (int a, out SimpleStruct ss, int b)
{
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
ss.d2 = "TEST4";
return 0;
}
public static int delegate_test_struct_in (int a, [In] ref SimpleStruct ss, int b)
{
if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2") {
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
return 0;
}
return 1;
}
public static SimpleClass delegate_test_class (SimpleClass ss)
{
if (ss == null)
return null;
if (! (!ss.a && ss.b && !ss.c && ss.d == "TEST"))
return null;
SimpleClass res = ss;
return res;
}
public static int delegate_test_class_byref (ref SimpleClass ss)
{
if (ss == null)
return -1;
if (!ss.a && ss.b && !ss.c && ss.d == "TEST") {
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
return 1;
}
public static int delegate_test_class_out (out SimpleClass ss)
{
ss = new SimpleClass ();
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
public static int delegate_test_primitive_byref (ref int i)
{
if (i != 1)
return 1;
i = 2;
return 0;
}
public static int delegate_test_string_marshalling (string s)
{
return s == "ABC" ? 0 : 1;
}
public static int delegate_test_string_builder_marshalling (StringBuilder s)
{
if (s == null)
return 2;
else
return s.ToString () == "ABC" ? 0 : 1;
}
[DllImport ("libtest", EntryPoint="mono_test_ref_vtype")]
public static extern int mono_test_ref_vtype (int a, ref SimpleStruct ss, int b, TestDelegate d);
public delegate int OutStructDelegate (int a, out SimpleStruct ss, int b);
public delegate int InStructDelegate (int a, [In] ref SimpleStruct ss, int b);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_struct")]
public static extern int mono_test_marshal_out_struct (int a, out SimpleStruct ss, int b, OutStructDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_in_struct")]
public static extern int mono_test_marshal_in_struct (int a, ref SimpleStruct ss, int b, InStructDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate2")]
public static extern int mono_test_marshal_delegate2 (SimpleDelegate2 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate4")]
public static extern int mono_test_marshal_delegate4 (SimpleDelegate4 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate5")]
public static extern int mono_test_marshal_delegate5 (SimpleDelegate5 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate6")]
public static extern int mono_test_marshal_delegate6 (SimpleDelegate5 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate7")]
public static extern int mono_test_marshal_delegate7 (SimpleDelegate7 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate8", CharSet=CharSet.Unicode)]
public static extern int mono_test_marshal_delegate8 (SimpleDelegate8 d, string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate9")]
public static extern int mono_test_marshal_delegate9 (SimpleDelegate9 d, return_int_delegate d2);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate10")]
public static extern int mono_test_marshal_delegate10 (SimpleDelegate9 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate8")]
public static extern int mono_test_marshal_delegate11 (SimpleDelegate11 d, string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_primitive_byref_delegate")]
public static extern int mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_ref_delegate")]
public static extern int mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_virtual_delegate")]
public static extern int mono_test_marshal_virtual_delegate (VirtualDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_icall_delegate")]
public static extern int mono_test_marshal_icall_delegate (IcallDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_nullable_ret_delegate")]
public static extern int mono_test_marshal_nullable_ret_delegate (NullableReturnDelegate del);
public delegate string IcallDelegate (IntPtr p);
public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
public delegate SimpleClass SimpleDelegate4 (SimpleClass ss);
public delegate int SimpleDelegate5 (ref SimpleClass ss);
public delegate int SimpleDelegate7 (out SimpleClass ss);
public delegate int SimpleDelegate8 ([MarshalAs (UnmanagedType.LPWStr)] string s1);
public delegate int return_int_delegate (int i);
public delegate int SimpleDelegate9 (return_int_delegate del);
public delegate int SimpleDelegate11 (StringBuilder s1);
public delegate int PrimitiveByrefDelegate (ref int i);
public delegate return_int_delegate ReturnDelegateDelegate ();
public delegate int DelegateByrefDelegate (ref return_int_delegate del);
public delegate int VirtualDelegate (int i);
public delegate Nullable<int> NullableReturnDelegate ();
public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
/* Test structures as arguments and return values of delegates */
public static int test_0_marshal_struct_delegate () {
SimpleDelegate2 d = new SimpleDelegate2 (delegate_test_struct);
return mono_test_marshal_delegate2 (d);
}
/* Test structures as byref arguments of delegates */
public static int test_0_marshal_byref_struct_delegate () {
SimpleStruct ss = new SimpleStruct ();
TestDelegate d = new TestDelegate (delegate_test_struct_byref);
ss.b = true;
ss.d = "TEST1";
if (mono_test_ref_vtype (1, ref ss, 2, d) != 0)
return 1;
if (! (ss.a && ss.b && ss.c && ss.d == "TEST3"))
return 2;
return 0;
}
/* Test structures as out arguments of delegates */
public static int test_0_marshal_out_struct_delegate () {
SimpleStruct ss = new SimpleStruct ();
OutStructDelegate d = new OutStructDelegate (delegate_test_struct_out);
return mono_test_marshal_out_struct (1, out ss, 2, d);
}
/* Test structures as in arguments of delegates */
public static int test_0_marshal_in_struct_delegate () {
SimpleStruct ss = new SimpleStruct () { a = true, b = false, c = true, d = "TEST2" };
InStructDelegate d = new InStructDelegate (delegate_test_struct_in);
return mono_test_marshal_in_struct (1, ref ss, 2, d);
}
/* Test classes as arguments and return values of delegates */
public static int test_0_marshal_class_delegate () {
SimpleDelegate4 d = new SimpleDelegate4 (delegate_test_class);
return mono_test_marshal_delegate4 (d);
}
/* Test classes as byref arguments of delegates */
public static int test_0_marshal_byref_class_delegate () {
SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
return mono_test_marshal_delegate5 (d);
}
/* Test classes as out arguments of delegates */
public static int test_0_marshal_out_class_delegate () {
SimpleDelegate7 d = new SimpleDelegate7 (delegate_test_class_out);
return mono_test_marshal_delegate7 (d);
}
/* Test string marshalling with delegates */
public static int test_0_marshal_string_delegate () {
SimpleDelegate8 d = new SimpleDelegate8 (delegate_test_string_marshalling);
return mono_test_marshal_delegate8 (d, "ABC");
}
/* Test string builder marshalling with delegates */
public static int test_0_marshal_string_builder_delegate () {
SimpleDelegate11 d = new SimpleDelegate11 (delegate_test_string_builder_marshalling);
if (mono_test_marshal_delegate11 (d, null) != 2)
return 2;
return mono_test_marshal_delegate11 (d, "ABC");
}
/* Test that the delegate wrapper correctly catches null byref arguments */
public static int test_0_marshal_byref_class_delegate_null () {
SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
try {
mono_test_marshal_delegate6 (d);
return 1;
}
catch (ArgumentNullException ex) {
return 0;
}
}
static int return_self (int i) {
return i;
}
static int call_int_delegate (return_int_delegate d) {
return d (55);
}
public static int test_55_marshal_delegate_delegate () {
SimpleDelegate9 d = new SimpleDelegate9 (call_int_delegate);
return mono_test_marshal_delegate9 (d, new return_int_delegate (return_self));
}
public static int test_0_marshal_primitive_byref_delegate () {
PrimitiveByrefDelegate d = new PrimitiveByrefDelegate (delegate_test_primitive_byref);
return mono_test_marshal_primitive_byref_delegate (d);
}
public static return_int_delegate return_delegate () {
return new return_int_delegate (return_self);
}
public static int test_55_marshal_return_delegate_delegate () {
return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
}
public static int return_plus_1 (int i) {
return i + 1;
}
public static int ref_delegate_delegate (ref return_int_delegate del) {
del = return_plus_1;
return 0;
}
public static int test_55_marshal_delegate_ref_delegate () {
var del = new DelegateByrefDelegate (ref_delegate_delegate);
return mono_test_marshal_delegate_ref_delegate (del);
}
/* Passing and returning strings */
public delegate String ReturnStringDelegate (String s);
[DllImport ("libtest", EntryPoint="mono_test_return_string")]
public static extern String mono_test_marshal_return_string_delegate (ReturnStringDelegate d);
public static String managed_return_string (String s) {
if (s != "TEST")
return "";
else
return "12345";
}
public static int test_0_marshal_return_string_delegate () {
ReturnStringDelegate d = new ReturnStringDelegate (managed_return_string);
String s = mono_test_marshal_return_string_delegate (d);
return (s == "12345") ? 0 : 1;
}
/* Passing and returning enums */
public enum FooEnum {
Foo1,
Foo2,
Foo3
};
public delegate FooEnum ReturnEnumDelegate (FooEnum e);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_enum_delegate")]
public static extern int mono_test_marshal_return_enum_delegate (ReturnEnumDelegate d);
public static FooEnum managed_return_enum (FooEnum e) {
return (FooEnum)((int)e + 1);
}
public static int test_0_marshal_return_enum_delegate () {
ReturnEnumDelegate d = new ReturnEnumDelegate (managed_return_enum);
FooEnum e = (FooEnum)mono_test_marshal_return_enum_delegate (d);
return e == FooEnum.Foo3 ? 0 : 1;
}
/* Passing and returning blittable structs */
[StructLayout (LayoutKind.Sequential)]
public struct BlittableStruct {
public int a, b, c;
public long d;
}
public static BlittableStruct delegate_test_blittable_struct (BlittableStruct ss)
{
BlittableStruct res;
res.a = -ss.a;
res.b = -ss.b;
res.c = -ss.c;
res.d = -ss.d;
return res;
}
public delegate BlittableStruct SimpleDelegate10 (BlittableStruct ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_blittable_struct_delegate")]
public static extern int mono_test_marshal_blittable_struct_delegate (SimpleDelegate10 d);
public static int test_0_marshal_blittable_struct_delegate () {
return mono_test_marshal_blittable_struct_delegate (new SimpleDelegate10 (delegate_test_blittable_struct));
}
/*
* Passing and returning small structs
*/
/* TEST 1: 4 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct1 {
public int i;
}
public static SmallStruct1 delegate_test_struct (SmallStruct1 ss) {
SmallStruct1 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct1 SmallStructDelegate1 (SmallStruct1 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate1")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate1 d);
public static int test_0_marshal_small_struct_delegate1 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate1 (delegate_test_struct));
}
/* TEST 2: 2+2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct2 {
public short i, j;
}
public static SmallStruct2 delegate_test_struct (SmallStruct2 ss) {
SmallStruct2 res;
res.i = (short)-ss.i;
res.j = (short)-ss.j;
return res;
}
public delegate SmallStruct2 SmallStructDelegate2 (SmallStruct2 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate2")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate2 d);
public static int test_0_marshal_small_struct_delegate2 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate2 (delegate_test_struct));
}
/* TEST 3: 2+1 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct3 {
public short i;
public byte j;
}
public static SmallStruct3 delegate_test_struct (SmallStruct3 ss) {
SmallStruct3 res;
res.i = (short)-ss.i;
res.j = (byte)-ss.j;
return res;
}
public delegate SmallStruct3 SmallStructDelegate3 (SmallStruct3 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate3")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate3 d);
public static int test_0_marshal_small_struct_delegate3 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate3 (delegate_test_struct));
}
/* TEST 4: 2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct4 {
public short i;
}
public static SmallStruct4 delegate_test_struct (SmallStruct4 ss) {
SmallStruct4 res;
res.i = (short)-ss.i;
return res;
}
public delegate SmallStruct4 SmallStructDelegate4 (SmallStruct4 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate4")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate4 d);
public static int test_0_marshal_small_struct_delegate4 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate4 (delegate_test_struct));
}
/* TEST 5: 8 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct5 {
public long l;
}
public static SmallStruct5 delegate_test_struct (SmallStruct5 ss) {
SmallStruct5 res;
res.l = -ss.l;
return res;
}
public delegate SmallStruct5 SmallStructDelegate5 (SmallStruct5 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate5")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate5 d);
public static int test_0_marshal_small_struct_delegate5 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate5 (delegate_test_struct));
}
/* TEST 6: 4+4 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct6 {
public int i, j;
}
public static SmallStruct6 delegate_test_struct (SmallStruct6 ss) {
SmallStruct6 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct6 SmallStructDelegate6 (SmallStruct6 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate6")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate6 d);
public static int test_0_marshal_small_struct_delegate6 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate6 (delegate_test_struct));
}
/* TEST 7: 4+2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct7 {
public int i;
public short j;
}
public static SmallStruct7 delegate_test_struct (SmallStruct7 ss) {
SmallStruct7 res;
res.i = -ss.i;
res.j = (short)-ss.j;
return res;
}
public delegate SmallStruct7 SmallStructDelegate7 (SmallStruct7 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate7")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate7 d);
public static int test_0_marshal_small_struct_delegate7 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate7 (delegate_test_struct));
}
/* TEST 8: 4 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct8 {
public float i;
}
public static SmallStruct8 delegate_test_struct (SmallStruct8 ss) {
SmallStruct8 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct8 SmallStructDelegate8 (SmallStruct8 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate8")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate8 d);
public static int test_0_marshal_small_struct_delegate8 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate8 (delegate_test_struct));
}
/* TEST 9: 8 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct9 {
public double i;
}
public static SmallStruct9 delegate_test_struct (SmallStruct9 ss) {
SmallStruct9 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct9 SmallStructDelegate9 (SmallStruct9 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate9")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate9 d);
public static int test_0_marshal_small_struct_delegate9 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate9 (delegate_test_struct));
}
/* TEST 10: 4+4 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct10 {
public float i;
public float j;
}
public static SmallStruct10 delegate_test_struct (SmallStruct10 ss) {
SmallStruct10 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct10 SmallStructDelegate10 (SmallStruct10 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate10")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate10 d);
public static int test_0_marshal_small_struct_delegate10 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate10 (delegate_test_struct));
}
/* TEST 11: 4+4 byte long MIXED struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct11 {
public float i;
public int j;
}
public static SmallStruct11 delegate_test_struct (SmallStruct11 ss) {
SmallStruct11 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct11 SmallStructDelegate11 (SmallStruct11 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate11")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate11 d);
public static int test_0_marshal_small_struct_delegate11 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate11 (delegate_test_struct));
}
/*
* Passing arrays
*/
public delegate int ArrayDelegate1 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegate1 d);
public static int array_delegate1 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_string () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate1 (arr, arr.Length, new ArrayDelegate1 (array_delegate1));
}
public static int array_delegate2 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_null () {
return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegate1 (array_delegate2));
}
public delegate int ArrayDelegateBlittable (int i, string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegateBlittable d);
public static int array_delegate_null_blittable (int i, string j, int[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_null_blittable () {
return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegateBlittable (array_delegate_null_blittable));
}
public delegate int ArrayDelegate3 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=3)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate3 (string[] arr, int len, ArrayDelegate3 d);
public static int array_delegate3 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_bad_paramindex () {
try {
mono_test_marshal_array_delegate3 (null, 0, new ArrayDelegate3 (array_delegate3));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4 (string[] arr, int len, ArrayDelegate4 d);
public static int array_delegate4 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_bad_paramtype () {
try {
mono_test_marshal_array_delegate4 (null, 0, new ArrayDelegate4 (array_delegate4));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4_2 (int i,
string j,
string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4_2 (string[] arr, int len, ArrayDelegate4_2 d);
public static int array_delegate4_2 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_no_marshal_directive () {
try {
mono_test_marshal_array_delegate4_2 (null, 0, new ArrayDelegate4_2 (array_delegate4_2));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4_3 (int i,
string j,
string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4_3 (string[] arr, int len, ArrayDelegate4_3 d);
public int array_delegate4_3 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_no_marshal_directive_instance () {
try {
Tests t = new Tests ();
mono_test_marshal_array_delegate4_3 (null, 0, new ArrayDelegate4_3 (t.array_delegate4_3));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate5 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate", CharSet=CharSet.Unicode)]
public static extern int mono_test_marshal_array_delegate5 (string[] arr, int len, ArrayDelegate5 d);
public static int array_delegate5 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_unicode_string () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate5 (arr, arr.Length, new ArrayDelegate5 (array_delegate5));
}
public delegate int ArrayDelegate6 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=2)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate6 (string[] arr, int len, ArrayDelegate6 d);
public static int array_delegate6 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_sizeconst () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate6 (arr, 1024, new ArrayDelegate6 (array_delegate6));
}
public delegate int ArrayDelegate7 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=1, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate7 (string[] arr, int len, ArrayDelegate7 d);
public static int array_delegate7 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_sizeconst_paramindex () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate7 (arr, 1, new ArrayDelegate7 (array_delegate7));
}
public delegate int ArrayDelegate8 (int i, string j,
[In, MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=0)]
int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate8 (int[] arr, int len, ArrayDelegate8 d);
public static int array_delegate8 (int i, string j, int[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != 42) || (arr [1] != 43))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_blittable () {
int[] arr = new int [] { 42, 43 };
return mono_test_marshal_array_delegate8 (arr, 2, new ArrayDelegate8 (array_delegate8));
}
/* Array with size param of type long */
public delegate int ArrayDelegate8_2 (long i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate_long")]
public static extern int mono_test_marshal_array_delegate8_2 (string[] arr, long len, ArrayDelegate8_2 d);
public static int array_delegate8_2 (long i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_long_param () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate8_2 (arr, arr.Length, new ArrayDelegate8_2 (array_delegate8_2));
}
/*
* [Out] blittable arrays
*/
public delegate int ArrayDelegate9 (int i, string j,
[Out, MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=0)]
int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_array_delegate")]
public static extern int mono_test_marshal_out_array_delegate (int[] arr, int len, ArrayDelegate9 d);
public static int array_delegate9 (int i, string j, int[] arr) {
if (arr.Length != 2)
return 1;
arr [0] = 1;
arr [1] = 2;
return 0;
}
public static int test_0_marshal_out_array_delegate () {
int[] arr = new int [] { 42, 43 };
return mono_test_marshal_out_array_delegate (arr, 2, new ArrayDelegate9 (array_delegate9));
}
/*
* [Out] string arrays
*/
public delegate int ArrayDelegate10 (int i,
string j,
[Out, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=2)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_string_array_delegate")]
public static extern int mono_test_marshal_out_string_array_delegate (string[] arr, int len, ArrayDelegate10 d);
public static int array_delegate10 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
arr [0] = "ABC";
arr [1] = "DEF";
return 0;
}
public static int test_0_marshal_out_string_array_delegate () {
string[] arr = new string [] { "", "" };
return mono_test_marshal_out_string_array_delegate (arr, 2, new ArrayDelegate10 (array_delegate10));
}
/*
* [In, Out] classes
*/
public delegate int InOutByvalClassDelegate ([In, Out] SimpleClass ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_inout_byval_class_delegate")]
public static extern int mono_test_marshal_inout_byval_class_delegate (InOutByvalClassDelegate d);
public static int delegate_test_byval_class_inout (SimpleClass ss) {
if ((ss.a != false) || (ss.b != true) || (ss.c != false) || (ss.d != "FOO"))
return 1;
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
public static int test_0_marshal_inout_byval_class_delegate () {
return mono_test_marshal_inout_byval_class_delegate (new InOutByvalClassDelegate (delegate_test_byval_class_inout));
}
/*
* Returning unicode strings
*/
[return: MarshalAs(UnmanagedType.LPWStr)]
public delegate string ReturnUnicodeStringDelegate([MarshalAs(UnmanagedType.LPWStr)] string message);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_unicode_string_delegate")]
public static extern int mono_test_marshal_return_unicode_string_delegate (ReturnUnicodeStringDelegate d);
public static String return_unicode_string_delegate (string message) {
return message;
}
public static int test_0_marshal_return_unicode_string_delegate () {
return mono_test_marshal_return_unicode_string_delegate (new ReturnUnicodeStringDelegate (return_unicode_string_delegate));
}
/*
* Returning string arrays
*/
public delegate string[] ReturnArrayDelegate (int i);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_string_array_delegate")]
public static extern int mono_test_marshal_return_string_array_delegate (ReturnArrayDelegate d);
public static String[] return_array_delegate (int i) {
String[] arr = new String [2];
arr [0] = "ABC";
arr [1] = "DEF";
return arr;
}
public static String[] return_array_delegate_null (int i) {
return null;
}
public static int test_0_marshal_return_string_array_delegate () {
return mono_test_marshal_return_string_array_delegate (new ReturnArrayDelegate (return_array_delegate));
}
public static int test_3_marshal_return_string_array_delegate_null () {
return mono_test_marshal_return_string_array_delegate (new ReturnArrayDelegate (return_array_delegate_null));
}
/*
* Byref string marshalling
*/
public delegate int ByrefStringDelegate (ref string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_byref_string_delegate")]
public static extern int mono_test_marshal_byref_string_delegate (ByrefStringDelegate d);
public static int byref_string_delegate (ref string s) {
if (s != "ABC")
return 1;
s = "DEF";
return 0;
}
public static int test_0_marshal_byref_string_delegate () {
return mono_test_marshal_byref_string_delegate (new ByrefStringDelegate (byref_string_delegate));
}
/*
* Thread attach
*/
public delegate int SimpleDelegate (int i);
[DllImport ("libtest", EntryPoint="mono_test_marshal_thread_attach")]
public static extern int mono_test_marshal_thread_attach (SimpleDelegate d);
public static int test_43_thread_attach () {
int res = mono_test_marshal_thread_attach (delegate (int i) {
if (!Thread.CurrentThread.IsBackground)
return 0;
return i + 1;
});
return res;
}
public struct LargeStruct {
public Int16 s;
public Int16 v;
public UInt32 p;
public UInt32 e;
public Int32 l;
public Int32 ll;
public UInt16 h;
public Int16 r;
public Int16 pp;
public Int32 hh;
public Int32 bn;
public Int32 dn;
public Int32 dr;
public Int32 sh;
public Int32 ra;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] angle;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] width;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] edge;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3 * 1024)]
public byte[] echo;
}
public delegate int LargeStructDelegate (ref LargeStruct s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_thread_attach_large_vt")]
public static extern int mono_test_marshal_thread_attach_large_vt (LargeStructDelegate d);
public static int test_43_thread_attach_large_vt () {
int res = mono_test_marshal_thread_attach_large_vt (delegate (ref LargeStruct s) {
return 43;
});
return res;
}
class Worker {
volatile bool stop = false;
public void Stop () {
stop = true;
}
public void Work () {
while (!stop) {
for (int i = 0; i < 100; i++) {
var a = new double[80000];
Thread.Sleep (1);
}
GC.Collect ();
}
}
}
public static int test_43_thread_attach_detach_contested () {
// Test plan: we want to create a race between the GC
// and native threads detaching. When a native thread
// calls a managed delegate, it's attached to the
// runtime by the wrapper. It is detached when the
// thread is destroyed and the TLS key destructor for
// MonoThreadInfo runs. That destructor wants to take
// the GC lock. So we create a lot of native threads
// while at the same time running a worker that
// allocates garbage and invokes the collector.
var w = new Worker ();
Thread t = new Thread(new ThreadStart (w.Work));
t.Start ();
for (int count = 0; count < 500; count++) {
int res = mono_test_marshal_thread_attach (delegate (int i) {
Thread.Sleep (0);
return i + 1;
});
}
Thread.Sleep (1000);
w.Stop ();
t.Join ();
return 43;
}
/*
* Appdomain save/restore
*/
static Func<int> callback;
[DllImport ("libtest", EntryPoint="mono_test_marshal_set_callback")]
public static extern int mono_test_marshal_set_callback (Func<int> a);
[DllImport ("libtest", EntryPoint="mono_test_marshal_call_callback")]
public static extern int mono_test_marshal_call_callback ();
public static int test_0_appdomain_switch () {
// FIXME: The appdomain unload hangs
//return 0;
AppDomain ad = AppDomain.CreateDomain ("foo");
var c = (CallbackClass)ad.CreateInstanceAndUnwrap (
typeof (CallbackClass).Assembly.FullName, "Tests/CallbackClass");
c.SetCallback ();
int domain_id = AppDomain.CurrentDomain.Id;
int new_id = mono_test_marshal_call_callback ();
int res = 0;
if (new_id == domain_id)
res = 1;
if (AppDomain.CurrentDomain.Id != domain_id)
res = 2;
AppDomain.Unload (ad);
return res;
}
static int domain_callback () {
return AppDomain.CurrentDomain.Id;
}
class CallbackClass : MarshalByRefObject {
public int SetCallback () {
mono_test_marshal_set_callback (domain_callback);
return 0;
}
}
class Base {
public VirtualDelegate get_del () {
return delegate_test;
}
public virtual int delegate_test (int i) {
return i;
}
}
class Derived : Base {
public override int delegate_test (int i) {
return i + 1;
}
}
public static int test_43_virtual () {
Base b = new Derived ();
return mono_test_marshal_virtual_delegate (b.get_del ());
}
public static int test_0_icall_delegate () {
var m = typeof (Marshal).GetMethod ("PtrToStringAnsi", new Type[] { typeof (IntPtr) });
return mono_test_marshal_icall_delegate ((IcallDelegate)Delegate.CreateDelegate (typeof (IcallDelegate), m));
}
private static Nullable<int> nullable_ret_cb () {
return 0;
}
public static int test_0_generic_return () {
try {
Marshal.GetFunctionPointerForDelegate<NullableReturnDelegate> (nullable_ret_cb);
return 1;
} catch (MarshalDirectiveException) {
}
try {
mono_test_marshal_nullable_ret_delegate (nullable_ret_cb);
return 2;
} catch (MarshalDirectiveException) {
}
return 0;
}
}
| //
// pinvoke3.cs:
//
// Tests for native->managed marshalling
//
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
public class Tests {
[StructLayout (LayoutKind.Sequential)]
public struct SimpleStruct {
public bool a;
public bool b;
public bool c;
public string d;
[MarshalAs(UnmanagedType.LPWStr)]
public string d2;
}
[StructLayout (LayoutKind.Sequential)]
public class SimpleClass {
public bool a;
public bool b;
public bool c;
public string d;
}
public static SimpleStruct delegate_test_struct (SimpleStruct ss)
{
SimpleStruct res;
res.a = !ss.a;
res.b = !ss.b;
res.c = !ss.c;
res.d = ss.d + "-RES";
res.d2 = ss.d2 + "-RES";
return res;
}
public static int delegate_test_struct_byref (int a, ref SimpleStruct ss, int b)
{
if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2") {
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
return 0;
}
return 1;
}
public static int delegate_test_struct_out (int a, out SimpleStruct ss, int b)
{
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
ss.d2 = "TEST4";
return 0;
}
public static int delegate_test_struct_in (int a, [In] ref SimpleStruct ss, int b)
{
if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2") {
ss.a = true;
ss.b = true;
ss.c = true;
ss.d = "TEST3";
return 0;
}
return 1;
}
public static SimpleClass delegate_test_class (SimpleClass ss)
{
if (ss == null)
return null;
if (! (!ss.a && ss.b && !ss.c && ss.d == "TEST"))
return null;
SimpleClass res = ss;
return res;
}
public static int delegate_test_class_byref (ref SimpleClass ss)
{
if (ss == null)
return -1;
if (!ss.a && ss.b && !ss.c && ss.d == "TEST") {
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
return 1;
}
public static int delegate_test_class_out (out SimpleClass ss)
{
ss = new SimpleClass ();
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
public static int delegate_test_primitive_byref (ref int i)
{
if (i != 1)
return 1;
i = 2;
return 0;
}
public static int delegate_test_string_marshalling (string s)
{
return s == "ABC" ? 0 : 1;
}
public static int delegate_test_string_builder_marshalling (StringBuilder s)
{
if (s == null)
return 2;
else
return s.ToString () == "ABC" ? 0 : 1;
}
[DllImport ("libtest", EntryPoint="mono_test_ref_vtype")]
public static extern int mono_test_ref_vtype (int a, ref SimpleStruct ss, int b, TestDelegate d);
public delegate int OutStructDelegate (int a, out SimpleStruct ss, int b);
public delegate int InStructDelegate (int a, [In] ref SimpleStruct ss, int b);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_struct")]
public static extern int mono_test_marshal_out_struct (int a, out SimpleStruct ss, int b, OutStructDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_in_struct")]
public static extern int mono_test_marshal_in_struct (int a, ref SimpleStruct ss, int b, InStructDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate2")]
public static extern int mono_test_marshal_delegate2 (SimpleDelegate2 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate4")]
public static extern int mono_test_marshal_delegate4 (SimpleDelegate4 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate5")]
public static extern int mono_test_marshal_delegate5 (SimpleDelegate5 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate6")]
public static extern int mono_test_marshal_delegate6 (SimpleDelegate5 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate7")]
public static extern int mono_test_marshal_delegate7 (SimpleDelegate7 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate8", CharSet=CharSet.Unicode)]
public static extern int mono_test_marshal_delegate8 (SimpleDelegate8 d, string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate9")]
public static extern int mono_test_marshal_delegate9 (SimpleDelegate9 d, return_int_delegate d2);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate10")]
public static extern int mono_test_marshal_delegate10 (SimpleDelegate9 d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate8")]
public static extern int mono_test_marshal_delegate11 (SimpleDelegate11 d, string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_primitive_byref_delegate")]
public static extern int mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
[DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_ref_delegate")]
public static extern int mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_virtual_delegate")]
public static extern int mono_test_marshal_virtual_delegate (VirtualDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_icall_delegate")]
public static extern int mono_test_marshal_icall_delegate (IcallDelegate del);
[DllImport ("libtest", EntryPoint="mono_test_marshal_nullable_ret_delegate")]
public static extern int mono_test_marshal_nullable_ret_delegate (NullableReturnDelegate del);
public delegate string IcallDelegate (IntPtr p);
public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
public delegate SimpleClass SimpleDelegate4 (SimpleClass ss);
public delegate int SimpleDelegate5 (ref SimpleClass ss);
public delegate int SimpleDelegate7 (out SimpleClass ss);
public delegate int SimpleDelegate8 ([MarshalAs (UnmanagedType.LPWStr)] string s1);
public delegate int return_int_delegate (int i);
public delegate int SimpleDelegate9 (return_int_delegate del);
public delegate int SimpleDelegate11 (StringBuilder s1);
public delegate int PrimitiveByrefDelegate (ref int i);
public delegate return_int_delegate ReturnDelegateDelegate ();
public delegate int DelegateByrefDelegate (ref return_int_delegate del);
public delegate int VirtualDelegate (int i);
public delegate Nullable<int> NullableReturnDelegate ();
public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
/* Test structures as arguments and return values of delegates */
public static int test_0_marshal_struct_delegate () {
SimpleDelegate2 d = new SimpleDelegate2 (delegate_test_struct);
return mono_test_marshal_delegate2 (d);
}
/* Test structures as byref arguments of delegates */
public static int test_0_marshal_byref_struct_delegate () {
SimpleStruct ss = new SimpleStruct ();
TestDelegate d = new TestDelegate (delegate_test_struct_byref);
ss.b = true;
ss.d = "TEST1";
if (mono_test_ref_vtype (1, ref ss, 2, d) != 0)
return 1;
if (! (ss.a && ss.b && ss.c && ss.d == "TEST3"))
return 2;
return 0;
}
/* Test structures as out arguments of delegates */
public static int test_0_marshal_out_struct_delegate () {
SimpleStruct ss = new SimpleStruct ();
OutStructDelegate d = new OutStructDelegate (delegate_test_struct_out);
return mono_test_marshal_out_struct (1, out ss, 2, d);
}
/* Test structures as in arguments of delegates */
public static int test_0_marshal_in_struct_delegate () {
SimpleStruct ss = new SimpleStruct () { a = true, b = false, c = true, d = "TEST2" };
InStructDelegate d = new InStructDelegate (delegate_test_struct_in);
return mono_test_marshal_in_struct (1, ref ss, 2, d);
}
/* Test classes as arguments and return values of delegates */
public static int test_0_marshal_class_delegate () {
SimpleDelegate4 d = new SimpleDelegate4 (delegate_test_class);
return mono_test_marshal_delegate4 (d);
}
/* Test classes as byref arguments of delegates */
public static int test_0_marshal_byref_class_delegate () {
SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
return mono_test_marshal_delegate5 (d);
}
/* Test classes as out arguments of delegates */
public static int test_0_marshal_out_class_delegate () {
SimpleDelegate7 d = new SimpleDelegate7 (delegate_test_class_out);
return mono_test_marshal_delegate7 (d);
}
/* Test string marshalling with delegates */
public static int test_0_marshal_string_delegate () {
SimpleDelegate8 d = new SimpleDelegate8 (delegate_test_string_marshalling);
return mono_test_marshal_delegate8 (d, "ABC");
}
/* Test string builder marshalling with delegates */
public static int test_0_marshal_string_builder_delegate () {
SimpleDelegate11 d = new SimpleDelegate11 (delegate_test_string_builder_marshalling);
if (mono_test_marshal_delegate11 (d, null) != 2)
return 2;
return mono_test_marshal_delegate11 (d, "ABC");
}
/* Test that the delegate wrapper correctly catches null byref arguments */
public static int test_0_marshal_byref_class_delegate_null () {
SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
try {
mono_test_marshal_delegate6 (d);
return 1;
}
catch (ArgumentNullException ex) {
return 0;
}
}
static int return_self (int i) {
return i;
}
static int call_int_delegate (return_int_delegate d) {
return d (55);
}
public static int test_55_marshal_delegate_delegate () {
SimpleDelegate9 d = new SimpleDelegate9 (call_int_delegate);
return mono_test_marshal_delegate9 (d, new return_int_delegate (return_self));
}
public static int test_0_marshal_primitive_byref_delegate () {
PrimitiveByrefDelegate d = new PrimitiveByrefDelegate (delegate_test_primitive_byref);
return mono_test_marshal_primitive_byref_delegate (d);
}
public static return_int_delegate return_delegate () {
return new return_int_delegate (return_self);
}
public static int test_55_marshal_return_delegate_delegate () {
return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
}
public static int return_plus_1 (int i) {
return i + 1;
}
public static int ref_delegate_delegate (ref return_int_delegate del) {
del = return_plus_1;
return 0;
}
public static int test_55_marshal_delegate_ref_delegate () {
var del = new DelegateByrefDelegate (ref_delegate_delegate);
return mono_test_marshal_delegate_ref_delegate (del);
}
/* Passing and returning strings */
public delegate String ReturnStringDelegate (String s);
[DllImport ("libtest", EntryPoint="mono_test_return_string")]
public static extern String mono_test_marshal_return_string_delegate (ReturnStringDelegate d);
public static String managed_return_string (String s) {
if (s != "TEST")
return "";
else
return "12345";
}
public static int test_0_marshal_return_string_delegate () {
ReturnStringDelegate d = new ReturnStringDelegate (managed_return_string);
String s = mono_test_marshal_return_string_delegate (d);
return (s == "12345") ? 0 : 1;
}
/* Passing and returning enums */
public enum FooEnum {
Foo1,
Foo2,
Foo3
};
public delegate FooEnum ReturnEnumDelegate (FooEnum e);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_enum_delegate")]
public static extern int mono_test_marshal_return_enum_delegate (ReturnEnumDelegate d);
public static FooEnum managed_return_enum (FooEnum e) {
return (FooEnum)((int)e + 1);
}
public static int test_0_marshal_return_enum_delegate () {
ReturnEnumDelegate d = new ReturnEnumDelegate (managed_return_enum);
FooEnum e = (FooEnum)mono_test_marshal_return_enum_delegate (d);
return e == FooEnum.Foo3 ? 0 : 1;
}
/* Passing and returning blittable structs */
[StructLayout (LayoutKind.Sequential)]
public struct BlittableStruct {
public int a, b, c;
public long d;
}
public static BlittableStruct delegate_test_blittable_struct (BlittableStruct ss)
{
BlittableStruct res;
res.a = -ss.a;
res.b = -ss.b;
res.c = -ss.c;
res.d = -ss.d;
return res;
}
public delegate BlittableStruct SimpleDelegate10 (BlittableStruct ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_blittable_struct_delegate")]
public static extern int mono_test_marshal_blittable_struct_delegate (SimpleDelegate10 d);
public static int test_0_marshal_blittable_struct_delegate () {
return mono_test_marshal_blittable_struct_delegate (new SimpleDelegate10 (delegate_test_blittable_struct));
}
/*
* Passing and returning small structs
*/
/* TEST 1: 4 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct1 {
public int i;
}
public static SmallStruct1 delegate_test_struct (SmallStruct1 ss) {
SmallStruct1 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct1 SmallStructDelegate1 (SmallStruct1 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate1")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate1 d);
public static int test_0_marshal_small_struct_delegate1 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate1 (delegate_test_struct));
}
/* TEST 2: 2+2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct2 {
public short i, j;
}
public static SmallStruct2 delegate_test_struct (SmallStruct2 ss) {
SmallStruct2 res;
res.i = (short)-ss.i;
res.j = (short)-ss.j;
return res;
}
public delegate SmallStruct2 SmallStructDelegate2 (SmallStruct2 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate2")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate2 d);
public static int test_0_marshal_small_struct_delegate2 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate2 (delegate_test_struct));
}
/* TEST 3: 2+1 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct3 {
public short i;
public byte j;
}
public static SmallStruct3 delegate_test_struct (SmallStruct3 ss) {
SmallStruct3 res;
res.i = (short)-ss.i;
res.j = (byte)-ss.j;
return res;
}
public delegate SmallStruct3 SmallStructDelegate3 (SmallStruct3 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate3")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate3 d);
public static int test_0_marshal_small_struct_delegate3 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate3 (delegate_test_struct));
}
/* TEST 4: 2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct4 {
public short i;
}
public static SmallStruct4 delegate_test_struct (SmallStruct4 ss) {
SmallStruct4 res;
res.i = (short)-ss.i;
return res;
}
public delegate SmallStruct4 SmallStructDelegate4 (SmallStruct4 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate4")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate4 d);
public static int test_0_marshal_small_struct_delegate4 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate4 (delegate_test_struct));
}
/* TEST 5: 8 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct5 {
public long l;
}
public static SmallStruct5 delegate_test_struct (SmallStruct5 ss) {
SmallStruct5 res;
res.l = -ss.l;
return res;
}
public delegate SmallStruct5 SmallStructDelegate5 (SmallStruct5 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate5")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate5 d);
public static int test_0_marshal_small_struct_delegate5 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate5 (delegate_test_struct));
}
/* TEST 6: 4+4 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct6 {
public int i, j;
}
public static SmallStruct6 delegate_test_struct (SmallStruct6 ss) {
SmallStruct6 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct6 SmallStructDelegate6 (SmallStruct6 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate6")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate6 d);
public static int test_0_marshal_small_struct_delegate6 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate6 (delegate_test_struct));
}
/* TEST 7: 4+2 byte long INTEGER struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct7 {
public int i;
public short j;
}
public static SmallStruct7 delegate_test_struct (SmallStruct7 ss) {
SmallStruct7 res;
res.i = -ss.i;
res.j = (short)-ss.j;
return res;
}
public delegate SmallStruct7 SmallStructDelegate7 (SmallStruct7 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate7")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate7 d);
public static int test_0_marshal_small_struct_delegate7 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate7 (delegate_test_struct));
}
/* TEST 8: 4 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct8 {
public float i;
}
public static SmallStruct8 delegate_test_struct (SmallStruct8 ss) {
SmallStruct8 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct8 SmallStructDelegate8 (SmallStruct8 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate8")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate8 d);
public static int test_0_marshal_small_struct_delegate8 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate8 (delegate_test_struct));
}
/* TEST 9: 8 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct9 {
public double i;
}
public static SmallStruct9 delegate_test_struct (SmallStruct9 ss) {
SmallStruct9 res;
res.i = -ss.i;
return res;
}
public delegate SmallStruct9 SmallStructDelegate9 (SmallStruct9 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate9")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate9 d);
public static int test_0_marshal_small_struct_delegate9 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate9 (delegate_test_struct));
}
/* TEST 10: 4+4 byte long FLOAT struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct10 {
public float i;
public float j;
}
public static SmallStruct10 delegate_test_struct (SmallStruct10 ss) {
SmallStruct10 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct10 SmallStructDelegate10 (SmallStruct10 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate10")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate10 d);
public static int test_0_marshal_small_struct_delegate10 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate10 (delegate_test_struct));
}
/* TEST 11: 4+4 byte long MIXED struct */
[StructLayout (LayoutKind.Sequential)]
public struct SmallStruct11 {
public float i;
public int j;
}
public static SmallStruct11 delegate_test_struct (SmallStruct11 ss) {
SmallStruct11 res;
res.i = -ss.i;
res.j = -ss.j;
return res;
}
public delegate SmallStruct11 SmallStructDelegate11 (SmallStruct11 ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_small_struct_delegate11")]
public static extern int mono_test_marshal_small_struct_delegate (SmallStructDelegate11 d);
public static int test_0_marshal_small_struct_delegate11 () {
return mono_test_marshal_small_struct_delegate (new SmallStructDelegate11 (delegate_test_struct));
}
/*
* Passing arrays
*/
public delegate int ArrayDelegate1 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegate1 d);
public static int array_delegate1 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_string () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate1 (arr, arr.Length, new ArrayDelegate1 (array_delegate1));
}
public static int array_delegate2 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_null () {
return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegate1 (array_delegate2));
}
public delegate int ArrayDelegateBlittable (int i, string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegateBlittable d);
public static int array_delegate_null_blittable (int i, string j, int[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_null_blittable () {
return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegateBlittable (array_delegate_null_blittable));
}
public delegate int ArrayDelegate3 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=3)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate3 (string[] arr, int len, ArrayDelegate3 d);
public static int array_delegate3 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_bad_paramindex () {
try {
mono_test_marshal_array_delegate3 (null, 0, new ArrayDelegate3 (array_delegate3));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4 (string[] arr, int len, ArrayDelegate4 d);
public static int array_delegate4 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_bad_paramtype () {
try {
mono_test_marshal_array_delegate4 (null, 0, new ArrayDelegate4 (array_delegate4));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4_2 (int i,
string j,
string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4_2 (string[] arr, int len, ArrayDelegate4_2 d);
public static int array_delegate4_2 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_no_marshal_directive () {
try {
mono_test_marshal_array_delegate4_2 (null, 0, new ArrayDelegate4_2 (array_delegate4_2));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate4_3 (int i,
string j,
string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate4_3 (string[] arr, int len, ArrayDelegate4_3 d);
public int array_delegate4_3 (int i, string j, string[] arr) {
return (arr == null) ? 0 : 1;
}
public static int test_0_marshal_array_delegate_no_marshal_directive_instance () {
try {
Tests t = new Tests ();
mono_test_marshal_array_delegate4_3 (null, 0, new ArrayDelegate4_3 (t.array_delegate4_3));
return 1;
}
catch (MarshalDirectiveException) {
return 0;
}
}
public delegate int ArrayDelegate5 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate", CharSet=CharSet.Unicode)]
public static extern int mono_test_marshal_array_delegate5 (string[] arr, int len, ArrayDelegate5 d);
public static int array_delegate5 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_unicode_string () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate5 (arr, arr.Length, new ArrayDelegate5 (array_delegate5));
}
public delegate int ArrayDelegate6 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=2)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate6 (string[] arr, int len, ArrayDelegate6 d);
public static int array_delegate6 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_sizeconst () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate6 (arr, 1024, new ArrayDelegate6 (array_delegate6));
}
public delegate int ArrayDelegate7 (int i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=1, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate7 (string[] arr, int len, ArrayDelegate7 d);
public static int array_delegate7 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_sizeconst_paramindex () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate7 (arr, 1, new ArrayDelegate7 (array_delegate7));
}
public delegate int ArrayDelegate8 (int i, string j,
[In, MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=0)]
int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
public static extern int mono_test_marshal_array_delegate8 (int[] arr, int len, ArrayDelegate8 d);
public static int array_delegate8 (int i, string j, int[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != 42) || (arr [1] != 43))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_blittable () {
int[] arr = new int [] { 42, 43 };
return mono_test_marshal_array_delegate8 (arr, 2, new ArrayDelegate8 (array_delegate8));
}
/* Array with size param of type long */
public delegate int ArrayDelegate8_2 (long i,
string j,
[In, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate_long")]
public static extern int mono_test_marshal_array_delegate8_2 (string[] arr, long len, ArrayDelegate8_2 d);
public static int array_delegate8_2 (long i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
if ((arr [0] != "ABC") || (arr [1] != "DEF"))
return 2;
return 0;
}
public static int test_0_marshal_array_delegate_long_param () {
string[] arr = new string [] { "ABC", "DEF" };
return mono_test_marshal_array_delegate8_2 (arr, arr.Length, new ArrayDelegate8_2 (array_delegate8_2));
}
/*
* [Out] blittable arrays
*/
public delegate int ArrayDelegate9 (int i, string j,
[Out, MarshalAs(UnmanagedType.LPArray,
SizeParamIndex=0)]
int[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_array_delegate")]
public static extern int mono_test_marshal_out_array_delegate (int[] arr, int len, ArrayDelegate9 d);
public static int array_delegate9 (int i, string j, int[] arr) {
if (arr.Length != 2)
return 1;
arr [0] = 1;
arr [1] = 2;
return 0;
}
public static int test_0_marshal_out_array_delegate () {
int[] arr = new int [] { 42, 43 };
return mono_test_marshal_out_array_delegate (arr, 2, new ArrayDelegate9 (array_delegate9));
}
/*
* [Out] string arrays
*/
public delegate int ArrayDelegate10 (int i,
string j,
[Out, MarshalAs(UnmanagedType.LPArray,
ArraySubType=UnmanagedType.LPStr, SizeConst=2)] string[] arr);
[DllImport ("libtest", EntryPoint="mono_test_marshal_out_string_array_delegate")]
public static extern int mono_test_marshal_out_string_array_delegate (string[] arr, int len, ArrayDelegate10 d);
public static int array_delegate10 (int i, string j, string[] arr) {
if (arr.Length != 2)
return 1;
arr [0] = "ABC";
arr [1] = "DEF";
return 0;
}
public static int test_0_marshal_out_string_array_delegate () {
string[] arr = new string [] { "", "" };
return mono_test_marshal_out_string_array_delegate (arr, 2, new ArrayDelegate10 (array_delegate10));
}
/*
* [In, Out] classes
*/
public delegate int InOutByvalClassDelegate ([In, Out] SimpleClass ss);
[DllImport ("libtest", EntryPoint="mono_test_marshal_inout_byval_class_delegate")]
public static extern int mono_test_marshal_inout_byval_class_delegate (InOutByvalClassDelegate d);
public static int delegate_test_byval_class_inout (SimpleClass ss) {
if ((ss.a != false) || (ss.b != true) || (ss.c != false) || (ss.d != "FOO"))
return 1;
ss.a = true;
ss.b = false;
ss.c = true;
ss.d = "RES";
return 0;
}
public static int test_0_marshal_inout_byval_class_delegate () {
return mono_test_marshal_inout_byval_class_delegate (new InOutByvalClassDelegate (delegate_test_byval_class_inout));
}
/*
* Returning unicode strings
*/
[return: MarshalAs(UnmanagedType.LPWStr)]
public delegate string ReturnUnicodeStringDelegate([MarshalAs(UnmanagedType.LPWStr)] string message);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_unicode_string_delegate")]
public static extern int mono_test_marshal_return_unicode_string_delegate (ReturnUnicodeStringDelegate d);
public static String return_unicode_string_delegate (string message) {
return message;
}
public static int test_0_marshal_return_unicode_string_delegate () {
return mono_test_marshal_return_unicode_string_delegate (new ReturnUnicodeStringDelegate (return_unicode_string_delegate));
}
/*
* Returning string arrays
*/
public delegate string[] ReturnArrayDelegate (int i);
[DllImport ("libtest", EntryPoint="mono_test_marshal_return_string_array_delegate")]
public static extern int mono_test_marshal_return_string_array_delegate (ReturnArrayDelegate d);
public static String[] return_array_delegate (int i) {
String[] arr = new String [2];
arr [0] = "ABC";
arr [1] = "DEF";
return arr;
}
public static String[] return_array_delegate_null (int i) {
return null;
}
public static int test_0_marshal_return_string_array_delegate () {
return mono_test_marshal_return_string_array_delegate (new ReturnArrayDelegate (return_array_delegate));
}
public static int test_3_marshal_return_string_array_delegate_null () {
return mono_test_marshal_return_string_array_delegate (new ReturnArrayDelegate (return_array_delegate_null));
}
/*
* Byref string marshalling
*/
public delegate int ByrefStringDelegate (ref string s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_byref_string_delegate")]
public static extern int mono_test_marshal_byref_string_delegate (ByrefStringDelegate d);
public static int byref_string_delegate (ref string s) {
if (s != "ABC")
return 1;
s = "DEF";
return 0;
}
public static int test_0_marshal_byref_string_delegate () {
return mono_test_marshal_byref_string_delegate (new ByrefStringDelegate (byref_string_delegate));
}
/*
* Thread attach
*/
public delegate int SimpleDelegate (int i);
[DllImport ("libtest", EntryPoint="mono_test_marshal_thread_attach")]
public static extern int mono_test_marshal_thread_attach (SimpleDelegate d);
public static int test_43_thread_attach () {
int res = mono_test_marshal_thread_attach (delegate (int i) {
if (!Thread.CurrentThread.IsBackground)
return 0;
return i + 1;
});
return res;
}
public struct LargeStruct {
public Int16 s;
public Int16 v;
public UInt32 p;
public UInt32 e;
public Int32 l;
public Int32 ll;
public UInt16 h;
public Int16 r;
public Int16 pp;
public Int32 hh;
public Int32 bn;
public Int32 dn;
public Int32 dr;
public Int32 sh;
public Int32 ra;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] angle;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] width;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public Int32[] edge;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3 * 1024)]
public byte[] echo;
}
public delegate int LargeStructDelegate (ref LargeStruct s);
[DllImport ("libtest", EntryPoint="mono_test_marshal_thread_attach_large_vt")]
public static extern int mono_test_marshal_thread_attach_large_vt (LargeStructDelegate d);
public static int test_43_thread_attach_large_vt () {
int res = mono_test_marshal_thread_attach_large_vt (delegate (ref LargeStruct s) {
return 43;
});
return res;
}
class Worker {
volatile bool stop = false;
public void Stop () {
stop = true;
}
public void Work () {
while (!stop) {
for (int i = 0; i < 100; i++) {
var a = new double[80000];
Thread.Sleep (1);
}
GC.Collect ();
}
}
}
public static int test_43_thread_attach_detach_contested () {
// Test plan: we want to create a race between the GC
// and native threads detaching. When a native thread
// calls a managed delegate, it's attached to the
// runtime by the wrapper. It is detached when the
// thread is destroyed and the TLS key destructor for
// MonoThreadInfo runs. That destructor wants to take
// the GC lock. So we create a lot of native threads
// while at the same time running a worker that
// allocates garbage and invokes the collector.
var w = new Worker ();
Thread t = new Thread(new ThreadStart (w.Work));
t.Start ();
for (int count = 0; count < 500; count++) {
int res = mono_test_marshal_thread_attach (delegate (int i) {
Thread.Sleep (0);
return i + 1;
});
}
Thread.Sleep (1000);
w.Stop ();
t.Join ();
return 43;
}
/*
* Appdomain save/restore
*/
static Func<int> callback;
[DllImport ("libtest", EntryPoint="mono_test_marshal_set_callback")]
public static extern int mono_test_marshal_set_callback (Func<int> a);
[DllImport ("libtest", EntryPoint="mono_test_marshal_call_callback")]
public static extern int mono_test_marshal_call_callback ();
public static int test_0_appdomain_switch () {
// FIXME: The appdomain unload hangs
//return 0;
AppDomain ad = AppDomain.CreateDomain ("foo");
var c = (CallbackClass)ad.CreateInstanceAndUnwrap (
typeof (CallbackClass).Assembly.FullName, "Tests/CallbackClass");
c.SetCallback ();
int domain_id = AppDomain.CurrentDomain.Id;
int new_id = mono_test_marshal_call_callback ();
int res = 0;
if (new_id == domain_id)
res = 1;
if (AppDomain.CurrentDomain.Id != domain_id)
res = 2;
AppDomain.Unload (ad);
return res;
}
static int domain_callback () {
return AppDomain.CurrentDomain.Id;
}
class CallbackClass : MarshalByRefObject {
public int SetCallback () {
mono_test_marshal_set_callback (domain_callback);
return 0;
}
}
class Base {
public VirtualDelegate get_del () {
return delegate_test;
}
public virtual int delegate_test (int i) {
return i;
}
}
class Derived : Base {
public override int delegate_test (int i) {
return i + 1;
}
}
public static int test_43_virtual () {
Base b = new Derived ();
return mono_test_marshal_virtual_delegate (b.get_del ());
}
public static int test_0_icall_delegate () {
var m = typeof (Marshal).GetMethod ("PtrToStringAnsi", new Type[] { typeof (IntPtr) });
return mono_test_marshal_icall_delegate ((IcallDelegate)Delegate.CreateDelegate (typeof (IcallDelegate), m));
}
private static Nullable<int> nullable_ret_cb () {
return 0;
}
public static int test_0_generic_return () {
try {
Marshal.GetFunctionPointerForDelegate<NullableReturnDelegate> (nullable_ret_cb);
return 1;
} catch (MarshalDirectiveException) {
}
try {
mono_test_marshal_nullable_ret_delegate (nullable_ret_cb);
return 2;
} catch (MarshalDirectiveException) {
}
return 0;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/GC/Scenarios/DoublinkList/DoubLink.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<GCStressIncompatible>true</GCStressIncompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="DoubLink.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<GCStressIncompatible>true</GCStressIncompatible>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="DoubLink.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b13178/b13178.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.ComponentModel.Composition/tests/System/UnitTesting/ExpectationOfIO.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.UnitTesting
{
public class Expectation<TInput, TOutput>
{
public Expectation(TInput input, TOutput output)
{
Input = input;
Output = output;
}
public TInput Input
{
get;
private set;
}
public TOutput Output
{
get;
private set;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.UnitTesting
{
public class Expectation<TInput, TOutput>
{
public Expectation(TInput input, TOutput output)
{
Input = input;
Output = output;
}
public TInput Input
{
get;
private set;
}
public TOutput Output
{
get;
private set;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.UInt16.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void OnesComplementUInt16()
{
var test = new VectorUnaryOpTest__OnesComplementUInt16();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__OnesComplementUInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<UInt16> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementUInt16 testClass)
{
var result = Vector64.OnesComplement(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static Vector64<UInt16> _clsVar1;
private Vector64<UInt16> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__OnesComplementUInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
}
public VectorUnaryOpTest__OnesComplementUInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.OnesComplement(
Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), new Type[] {
typeof(Vector64<UInt16>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt16));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.OnesComplement(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr);
var result = Vector64.OnesComplement(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__OnesComplementUInt16();
var result = Vector64.OnesComplement(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.OnesComplement(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.OnesComplement(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<UInt16> op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (ushort)(~firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (ushort)(~firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.OnesComplement)}<UInt16>(Vector64<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void OnesComplementUInt16()
{
var test = new VectorUnaryOpTest__OnesComplementUInt16();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__OnesComplementUInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<UInt16> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementUInt16 testClass)
{
var result = Vector64.OnesComplement(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static Vector64<UInt16> _clsVar1;
private Vector64<UInt16> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__OnesComplementUInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
}
public VectorUnaryOpTest__OnesComplementUInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, new UInt16[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.OnesComplement(
Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), new Type[] {
typeof(Vector64<UInt16>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt16));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.OnesComplement(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr);
var result = Vector64.OnesComplement(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__OnesComplementUInt16();
var result = Vector64.OnesComplement(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.OnesComplement(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.OnesComplement(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<UInt16> op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt16[] firstOp, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (ushort)(~firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (ushort)(~firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.OnesComplement)}<UInt16>(Vector64<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Net.Security/src/System/Net/Security/SslCertificateTrust.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
using System.Security.Cryptography.X509Certificates;
namespace System.Net.Security
{
public sealed class SslCertificateTrust
{
internal X509Store? _store;
internal X509Certificate2Collection? _trustList;
internal bool _sendTrustInHandshake;
public static SslCertificateTrust CreateForX509Store(X509Store store, bool sendTrustInHandshake = false)
{
#if TARGET_WINDOWS
if (sendTrustInHandshake && store.Location != StoreLocation.LocalMachine)
{
throw new PlatformNotSupportedException(SR.net_ssl_trust_store);
}
#else
if (sendTrustInHandshake && !System.OperatingSystem.IsLinux() && !System.OperatingSystem.IsMacOS())
{
// to be removed when implemented.
throw new PlatformNotSupportedException(SR.net_ssl_trust_handshake);
}
#endif
if (!store.IsOpen)
{
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
}
var trust = new SslCertificateTrust();
trust._store = store;
trust._sendTrustInHandshake = sendTrustInHandshake;
return trust;
}
[UnsupportedOSPlatform("windows")]
public static SslCertificateTrust CreateForX509Collection(X509Certificate2Collection trustList, bool sendTrustInHandshake = false)
{
if (sendTrustInHandshake && !System.OperatingSystem.IsLinux() && !System.OperatingSystem.IsMacOS())
{
// to be removed when implemented.
throw new PlatformNotSupportedException(SR.net_ssl_trust_handshake);
}
#if TARGET_WINDOWS
if (sendTrustInHandshake)
{
throw new PlatformNotSupportedException(SR.net_ssl_trust_collection);
}
#endif
var trust = new SslCertificateTrust();
trust._trustList = trustList;
trust._sendTrustInHandshake = sendTrustInHandshake;
return trust;
}
private SslCertificateTrust() { }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.Versioning;
using System.Security.Cryptography.X509Certificates;
namespace System.Net.Security
{
public sealed class SslCertificateTrust
{
internal X509Store? _store;
internal X509Certificate2Collection? _trustList;
internal bool _sendTrustInHandshake;
public static SslCertificateTrust CreateForX509Store(X509Store store, bool sendTrustInHandshake = false)
{
#if TARGET_WINDOWS
if (sendTrustInHandshake && store.Location != StoreLocation.LocalMachine)
{
throw new PlatformNotSupportedException(SR.net_ssl_trust_store);
}
#else
if (sendTrustInHandshake && !System.OperatingSystem.IsLinux() && !System.OperatingSystem.IsMacOS())
{
// to be removed when implemented.
throw new PlatformNotSupportedException(SR.net_ssl_trust_handshake);
}
#endif
if (!store.IsOpen)
{
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
}
var trust = new SslCertificateTrust();
trust._store = store;
trust._sendTrustInHandshake = sendTrustInHandshake;
return trust;
}
[UnsupportedOSPlatform("windows")]
public static SslCertificateTrust CreateForX509Collection(X509Certificate2Collection trustList, bool sendTrustInHandshake = false)
{
if (sendTrustInHandshake && !System.OperatingSystem.IsLinux() && !System.OperatingSystem.IsMacOS())
{
// to be removed when implemented.
throw new PlatformNotSupportedException(SR.net_ssl_trust_handshake);
}
#if TARGET_WINDOWS
if (sendTrustInHandshake)
{
throw new PlatformNotSupportedException(SR.net_ssl_trust_collection);
}
#endif
var trust = new SslCertificateTrust();
trust._trustList = trustList;
trust._sendTrustInHandshake = sendTrustInHandshake;
return trust;
}
private SslCertificateTrust() { }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
public class Runtime_61908
{
public static bool s_3;
public static int Main()
{
var vr6 = M3(s_3);
if (M3(vr6))
{
return -1;
}
return 100;
}
public static bool M3(bool arg0)
{
arg0 = !arg0;
return arg0;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
public class Runtime_61908
{
public static bool s_3;
public static int Main()
{
var vr6 = M3(s_3);
if (M3(vr6))
{
return -1;
}
return 100;
}
public static bool M3(bool arg0)
{
arg0 = !arg0;
return arg0;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathArrayIterator.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml;
using System.Xml.XPath;
namespace MS.Internal.Xml.XPath
{
[DebuggerDisplay("Position={CurrentPosition}, Current={debuggerDisplayProxy, nq}")]
internal class XPathArrayIterator : ResetableIterator
{
protected IList list;
protected int index;
public XPathArrayIterator(IList list)
{
this.list = list;
}
public XPathArrayIterator(XPathArrayIterator it)
{
this.list = it.list;
this.index = it.index;
}
public XPathArrayIterator(XPathNodeIterator nodeIterator)
{
this.list = new ArrayList();
while (nodeIterator.MoveNext())
{
Debug.Assert(nodeIterator.Current != null);
this.list.Add(nodeIterator.Current.Clone());
}
}
public IList AsList
{
get { return this.list; }
}
public override XPathNodeIterator Clone()
{
return new XPathArrayIterator(this);
}
public override XPathNavigator? Current
{
get
{
Debug.Assert(index <= list.Count);
if (index < 1)
{
throw new InvalidOperationException(SR.Format(SR.Sch_EnumNotStarted, string.Empty));
}
return (XPathNavigator?)list[index - 1];
}
}
public override int CurrentPosition { get { return index; } }
public override int Count { get { return list.Count; } }
public override bool MoveNext()
{
Debug.Assert(index <= list.Count);
if (index == list.Count)
{
return false;
}
index++;
return true;
}
public override void Reset()
{
index = 0;
}
public override IEnumerator GetEnumerator()
{
return list.GetEnumerator();
}
private object? debuggerDisplayProxy { get { return index < 1 ? null : (object)new XPathNavigator.DebuggerDisplayProxy(Current!); } }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml;
using System.Xml.XPath;
namespace MS.Internal.Xml.XPath
{
[DebuggerDisplay("Position={CurrentPosition}, Current={debuggerDisplayProxy, nq}")]
internal class XPathArrayIterator : ResetableIterator
{
protected IList list;
protected int index;
public XPathArrayIterator(IList list)
{
this.list = list;
}
public XPathArrayIterator(XPathArrayIterator it)
{
this.list = it.list;
this.index = it.index;
}
public XPathArrayIterator(XPathNodeIterator nodeIterator)
{
this.list = new ArrayList();
while (nodeIterator.MoveNext())
{
Debug.Assert(nodeIterator.Current != null);
this.list.Add(nodeIterator.Current.Clone());
}
}
public IList AsList
{
get { return this.list; }
}
public override XPathNodeIterator Clone()
{
return new XPathArrayIterator(this);
}
public override XPathNavigator? Current
{
get
{
Debug.Assert(index <= list.Count);
if (index < 1)
{
throw new InvalidOperationException(SR.Format(SR.Sch_EnumNotStarted, string.Empty));
}
return (XPathNavigator?)list[index - 1];
}
}
public override int CurrentPosition { get { return index; } }
public override int Count { get { return list.Count; } }
public override bool MoveNext()
{
Debug.Assert(index <= list.Count);
if (index == list.Count)
{
return false;
}
index++;
return true;
}
public override void Reset()
{
index = 0;
}
public override IEnumerator GetEnumerator()
{
return list.GetEnumerator();
}
private object? debuggerDisplayProxy { get { return index < 1 ? null : (object)new XPathNavigator.DebuggerDisplayProxy(Current!); } }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using System.Text;
internal static partial class Interop
{
internal static partial class Advapi32
{
internal enum GetDefaultProviderFlags : int
{
CRYPT_MACHINE_DEFAULT = 0x00000001,
CRYPT_USER_DEFAULT = 0x00000002
}
[GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetDefaultProvider(
int dwProvType,
IntPtr pdwReserved,
GetDefaultProviderFlags dwFlags,
[Out] char[]? pszProvName,
ref int pcbProvName);
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using System.Text;
internal static partial class Interop
{
internal static partial class Advapi32
{
internal enum GetDefaultProviderFlags : int
{
CRYPT_MACHINE_DEFAULT = 0x00000001,
CRYPT_USER_DEFAULT = 0x00000002
}
[GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool CryptGetDefaultProvider(
int dwProvType,
IntPtr pdwReserved,
GetDefaultProviderFlags dwFlags,
[Out] char[]? pszProvName,
ref int pcbProvName);
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
namespace System.Reflection.Emit
{
public sealed partial class EnumBuilder : TypeInfo
{
internal EnumBuilder()
{
// Prevent generating a default constructor
}
public override Assembly Assembly
{
get
{
return default;
}
}
public override string AssemblyQualifiedName
{
get
{
return default;
}
}
public override Type BaseType
{
get
{
return default;
}
}
public override Type DeclaringType
{
get
{
return default;
}
}
public override string FullName
{
get
{
return default;
}
}
public override Guid GUID
{
get
{
return default;
}
}
public override bool IsConstructedGenericType
{
get
{
return default;
}
}
public override Module Module
{
get
{
return default;
}
}
public override string Name
{
get
{
return default;
}
}
public override string Namespace
{
get
{
return default;
}
}
public override Type ReflectedType
{
get
{
return default;
}
}
public override RuntimeTypeHandle TypeHandle
{
get
{
return default;
}
}
public FieldBuilder UnderlyingField
{
get
{
return default;
}
}
public override Type UnderlyingSystemType
{
get
{
return default;
}
}
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public Type? CreateType()
{
return default;
}
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public TypeInfo? CreateTypeInfo()
{
return default;
}
public FieldBuilder DefineLiteral(string literalName, object literalValue)
{
return default;
}
protected override TypeAttributes GetAttributeFlagsImpl()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
return default;
}
public override object[] GetCustomAttributes(bool inherit)
{
return default;
}
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return default;
}
public override Type GetElementType()
{
return default;
}
public override Type GetEnumUnderlyingType()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)]
public override EventInfo[] GetEvents()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public override Type? GetInterface(string name, bool ignoreCase)
{
return default;
}
public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public override Type[] GetInterfaces()
{
return default;
}
[DynamicallyAccessedMembers(GetAllMembers)]
public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(GetAllMembers)]
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, System.Type[] types, ParameterModifier[] modifiers)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
return default;
}
protected override bool HasElementTypeImpl()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public override object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, Globalization.CultureInfo? culture, string[]? namedParameters)
{
return default;
}
protected override bool IsArrayImpl()
{
return default;
}
public override bool IsAssignableFrom([NotNullWhen(true)] TypeInfo? typeInfo)
{
return default;
}
protected override bool IsByRefImpl()
{
return default;
}
public override bool IsByRefLike
{
get
{
return default;
}
}
protected override bool IsCOMObjectImpl()
{
return default;
}
public override bool IsDefined(Type attributeType, bool inherit)
{
return default;
}
protected override bool IsPointerImpl()
{
return default;
}
protected override bool IsPrimitiveImpl()
{
return default;
}
public override bool IsTypeDefinition
{
get
{
return default;
}
}
public override bool IsSZArray
{
get
{
return default;
}
}
public override bool IsVariableBoundArray
{
get
{
return default;
}
}
protected override bool IsValueTypeImpl()
{
return default;
}
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public override Type MakeArrayType()
{
return default;
}
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public override Type MakeArrayType(int rank)
{
return default;
}
public override Type MakeByRefType()
{
return default;
}
public override Type MakePointerType()
{
return default;
}
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
}
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
namespace System.Reflection.Emit
{
public sealed partial class EnumBuilder : TypeInfo
{
internal EnumBuilder()
{
// Prevent generating a default constructor
}
public override Assembly Assembly
{
get
{
return default;
}
}
public override string AssemblyQualifiedName
{
get
{
return default;
}
}
public override Type BaseType
{
get
{
return default;
}
}
public override Type DeclaringType
{
get
{
return default;
}
}
public override string FullName
{
get
{
return default;
}
}
public override Guid GUID
{
get
{
return default;
}
}
public override bool IsConstructedGenericType
{
get
{
return default;
}
}
public override Module Module
{
get
{
return default;
}
}
public override string Name
{
get
{
return default;
}
}
public override string Namespace
{
get
{
return default;
}
}
public override Type ReflectedType
{
get
{
return default;
}
}
public override RuntimeTypeHandle TypeHandle
{
get
{
return default;
}
}
public FieldBuilder UnderlyingField
{
get
{
return default;
}
}
public override Type UnderlyingSystemType
{
get
{
return default;
}
}
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public Type? CreateType()
{
return default;
}
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public TypeInfo? CreateTypeInfo()
{
return default;
}
public FieldBuilder DefineLiteral(string literalName, object literalValue)
{
return default;
}
protected override TypeAttributes GetAttributeFlagsImpl()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
return default;
}
public override object[] GetCustomAttributes(bool inherit)
{
return default;
}
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return default;
}
public override Type GetElementType()
{
return default;
}
public override Type GetEnumUnderlyingType()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)]
public override EventInfo[] GetEvents()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents)]
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)]
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public override Type? GetInterface(string name, bool ignoreCase)
{
return default;
}
public override InterfaceMapping GetInterfaceMap([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type interfaceType)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
public override Type[] GetInterfaces()
{
return default;
}
[DynamicallyAccessedMembers(GetAllMembers)]
public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(GetAllMembers)]
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, System.Type[] types, ParameterModifier[] modifiers)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)]
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes)]
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)]
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
return default;
}
protected override bool HasElementTypeImpl()
{
return default;
}
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public override object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, Globalization.CultureInfo? culture, string[]? namedParameters)
{
return default;
}
protected override bool IsArrayImpl()
{
return default;
}
public override bool IsAssignableFrom([NotNullWhen(true)] TypeInfo? typeInfo)
{
return default;
}
protected override bool IsByRefImpl()
{
return default;
}
public override bool IsByRefLike
{
get
{
return default;
}
}
protected override bool IsCOMObjectImpl()
{
return default;
}
public override bool IsDefined(Type attributeType, bool inherit)
{
return default;
}
protected override bool IsPointerImpl()
{
return default;
}
protected override bool IsPrimitiveImpl()
{
return default;
}
public override bool IsTypeDefinition
{
get
{
return default;
}
}
public override bool IsSZArray
{
get
{
return default;
}
}
public override bool IsVariableBoundArray
{
get
{
return default;
}
}
protected override bool IsValueTypeImpl()
{
return default;
}
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public override Type MakeArrayType()
{
return default;
}
[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public override Type MakeArrayType(int rank)
{
return default;
}
public override Type MakeByRefType()
{
return default;
}
public override Type MakePointerType()
{
return default;
}
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
}
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Reflection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderSetInterfaceConstraints.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class GenericTypeParameterBuilderSetInterfaceConstraints
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
public void SetInterfaceConstraints_OneCustomInterface()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(typeof(EmptyNonGenericInterface1));
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[] { typeof(EmptyNonGenericInterface1) }, genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
[Fact]
public void SetInterfaceConstraints_Null()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(null);
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[0], genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
public void SetInterfaceConstraints_MultipleCustomInterfaces()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(new Type[] { typeof(EmptyNonGenericInterface1), typeof(EmptyNonGenericInterface2) });
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[] { typeof(EmptyNonGenericInterface1), typeof(EmptyNonGenericInterface2) }, genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class GenericTypeParameterBuilderSetInterfaceConstraints
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
public void SetInterfaceConstraints_OneCustomInterface()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(typeof(EmptyNonGenericInterface1));
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[] { typeof(EmptyNonGenericInterface1) }, genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
[Fact]
public void SetInterfaceConstraints_Null()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(null);
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[0], genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
public void SetInterfaceConstraints_MultipleCustomInterfaces()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);
string[] typeParamNames = new string[] { "TFirst" };
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames);
typeParams[0].SetInterfaceConstraints(new Type[] { typeof(EmptyNonGenericInterface1), typeof(EmptyNonGenericInterface2) });
Type resultType = type.CreateTypeInfo().AsType();
Type[] genericTypeParams = resultType.GetGenericArguments();
Assert.Equal(1, genericTypeParams.Length);
Assert.Equal(new Type[] { typeof(EmptyNonGenericInterface1), typeof(EmptyNonGenericInterface2) }, genericTypeParams[0].GetTypeInfo().GetGenericParameterConstraints());
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/src/System/Xml/Schema/ConstraintStruct.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Xml.XPath;
using MS.Internal.Xml.XPath;
namespace System.Xml.Schema
{
internal sealed class ConstraintStruct
{
// for each constraint
internal CompiledIdentityConstraint constraint; // pointer to constraint
internal SelectorActiveAxis axisSelector;
internal ArrayList axisFields; // Add tableDim * LocatedActiveAxis in a loop
internal Hashtable? qualifiedTable; // Checking confliction
internal Hashtable? keyrefTable; // several keyref tables having connections to this one is possible
private readonly int _tableDim; // dimension of table = numbers of fields;
internal int TableDim
{
get { return _tableDim; }
}
internal ConstraintStruct(CompiledIdentityConstraint constraint)
{
this.constraint = constraint;
_tableDim = constraint.Fields.Length;
this.axisFields = new ArrayList(); // empty fields
this.axisSelector = new SelectorActiveAxis(constraint.Selector, this);
if (this.constraint.Role != CompiledIdentityConstraint.ConstraintRole.Keyref)
{
this.qualifiedTable = new Hashtable();
}
}
}
// ActiveAxis plus the location plus the state of matching in the constraint table : only for field
internal sealed class LocatedActiveAxis : ActiveAxis
{
private readonly int _column; // the column in the table (the field sequence)
internal bool isMatched; // if it's matched, then fill value in the validator later
internal KeySequence Ks; // associated with a keysequence it will fills in
internal int Column
{
get { return _column; }
}
internal LocatedActiveAxis(Asttree astfield, KeySequence ks, int column) : base(astfield)
{
this.Ks = ks;
_column = column;
this.isMatched = false;
}
internal void Reactivate(KeySequence ks)
{
Reactivate();
this.Ks = ks;
}
}
// exist for optimization purpose
// ActiveAxis plus
// 1. overload endelement function from parent to return result
// 2. combine locatedactiveaxis and keysequence more closely
// 3. enable locatedactiveaxis reusing (the most important optimization point)
// 4. enable ks adding to hashtable right after moving out selector node (to enable 3)
// 5. will modify locatedactiveaxis class accordingly
// 6. taking care of updating ConstraintStruct.axisFields
// 7. remove constraintTable from ConstraintStruct
// 8. still need centralized locatedactiveaxis for movetoattribute purpose
internal sealed class SelectorActiveAxis : ActiveAxis
{
private readonly ConstraintStruct _cs; // pointer of constraintstruct, to enable 6
private readonly ArrayList _KSs; // stack of KSStruct, will not become less
private int _KSpointer; // indicate current stack top (next available element);
public int lastDepth
{
get { return (_KSpointer == 0) ? -1 : ((KSStruct)_KSs[_KSpointer - 1]!).depth; }
}
public SelectorActiveAxis(Asttree axisTree, ConstraintStruct cs) : base(axisTree)
{
_KSs = new ArrayList();
_cs = cs;
}
public override bool EndElement(string localname, string? URN)
{
base.EndElement(localname, URN);
if (_KSpointer > 0 && this.CurrentDepth == lastDepth)
{
return true;
// next step PopPS, and insert into hash
}
return false;
}
// update constraintStruct.axisFields as well, if it's new LocatedActiveAxis
public int PushKS(int errline, int errcol)
{
// new KeySequence each time
KeySequence ks = new KeySequence(_cs.TableDim, errline, errcol);
// needs to clear KSStruct before using
KSStruct kss;
if (_KSpointer < _KSs.Count)
{
// reuse, clear up KSs.KSpointer
kss = (KSStruct)_KSs[_KSpointer]!;
kss.ks = ks;
// reactivate LocatedActiveAxis
for (int i = 0; i < _cs.TableDim; i++)
{
kss.fields[i].Reactivate(ks); // reassociate key sequence
}
}
else
{ // "==", new
kss = new KSStruct(ks, _cs.TableDim);
for (int i = 0; i < _cs.TableDim; i++)
{
kss.fields[i] = new LocatedActiveAxis(_cs.constraint.Fields[i], ks, i);
_cs.axisFields.Add(kss.fields[i]); // new, add to axisFields
}
_KSs.Add(kss);
}
kss.depth = this.CurrentDepth - 1;
return (_KSpointer++);
}
public KeySequence PopKS()
{
return ((KSStruct)_KSs[--_KSpointer]!).ks;
}
}
internal sealed class KSStruct
{
public int depth; // depth of selector when it matches
public KeySequence ks; // ks of selector when it matches and assigned -- needs to new each time
public LocatedActiveAxis[] fields; // array of fields activeaxis when it matches and assigned
public KSStruct(KeySequence ks, int dim)
{
this.ks = ks;
this.fields = new LocatedActiveAxis[dim];
}
}
internal sealed class TypedObject
{
private sealed class DecimalStruct
{
private bool _isDecimal; // rare case it will be used...
private readonly decimal[] _dvalue; // to accelerate equals operation. array <-> list
public bool IsDecimal
{
get { return _isDecimal; }
set { _isDecimal = value; }
}
public decimal[] Dvalue
{
get { return _dvalue; }
}
public DecimalStruct()
{
_dvalue = new decimal[1];
}
//list
public DecimalStruct(int dim)
{
_dvalue = new decimal[dim];
}
}
private DecimalStruct? _dstruct;
private object? _ovalue;
private readonly string _svalue; // only for output
private XmlSchemaDatatype _xsdtype;
private readonly int _dim = 1;
private readonly bool _isList;
public int Dim
{
get { return _dim; }
}
public bool IsList
{
get { return _isList; }
}
public bool IsDecimal
{
get
{
Debug.Assert(_dstruct != null);
return _dstruct.IsDecimal;
}
}
public decimal[] Dvalue
{
get
{
Debug.Assert(_dstruct != null);
return _dstruct.Dvalue;
}
}
public object? Value
{
get { return _ovalue; }
set { _ovalue = value; }
}
public XmlSchemaDatatype Type
{
get { return _xsdtype; }
set { _xsdtype = value; }
}
public TypedObject(object? obj, string svalue, XmlSchemaDatatype xsdtype)
{
_ovalue = obj;
_svalue = svalue;
_xsdtype = xsdtype;
if (xsdtype.Variety == XmlSchemaDatatypeVariety.List ||
xsdtype is Datatype_base64Binary ||
xsdtype is Datatype_hexBinary)
{
_isList = true;
_dim = ((Array)obj!).Length;
}
}
public override string ToString()
{
// only for exception
return _svalue;
}
public void SetDecimal()
{
if (_dstruct != null)
{
return;
}
// Debug.Assert(!this.IsDecimal);
switch (_xsdtype.TypeCode)
{
case XmlTypeCode.Byte:
case XmlTypeCode.UnsignedByte:
case XmlTypeCode.Short:
case XmlTypeCode.UnsignedShort:
case XmlTypeCode.Int:
case XmlTypeCode.UnsignedInt:
case XmlTypeCode.Long:
case XmlTypeCode.UnsignedLong:
case XmlTypeCode.Decimal:
case XmlTypeCode.Integer:
case XmlTypeCode.PositiveInteger:
case XmlTypeCode.NonNegativeInteger:
case XmlTypeCode.NegativeInteger:
case XmlTypeCode.NonPositiveInteger:
if (_isList)
{
_dstruct = new DecimalStruct(_dim);
for (int i = 0; i < _dim; i++)
{
_dstruct.Dvalue[i] = Convert.ToDecimal(((Array)_ovalue!).GetValue(i), NumberFormatInfo.InvariantInfo);
}
}
else
{ //not list
_dstruct = new DecimalStruct();
//possibility of list of length 1.
_dstruct.Dvalue[0] = Convert.ToDecimal(_ovalue, NumberFormatInfo.InvariantInfo);
}
_dstruct.IsDecimal = true;
break;
default:
if (_isList)
{
_dstruct = new DecimalStruct(_dim);
}
else
{
_dstruct = new DecimalStruct();
}
break;
}
}
private bool ListDValueEquals(TypedObject other)
{
for (int i = 0; i < this.Dim; i++)
{
if (this.Dvalue[i] != other.Dvalue[i])
{
return false;
}
}
return true;
}
public bool Equals(TypedObject other)
{
// ? one is list with one member, another is not list -- still might be equal
if (this.Dim != other.Dim)
{
return false;
}
if (this.Type != other.Type)
{
//Check if types are comparable
if (!(this.Type.IsComparable(other.Type)))
{
return false;
}
other.SetDecimal(); // can't use cast and other.Type.IsEqual (value1, value2)
this.SetDecimal();
if (this.IsDecimal && other.IsDecimal)
{ //Both are decimal / derived types
return this.ListDValueEquals(other);
}
}
// not-Decimal derivation or type equal
if (this.IsList)
{
if (other.IsList)
{ //Both are lists and values are XmlAtomicValue[] or clrvalue[]. So use Datatype_List.Compare
return this.Type.Compare(this.Value!, other.Value!) == 0;
}
else
{ //this is a list and other is a single value
Array? arr1 = this.Value as System.Array;
XmlAtomicValue[]? atomicValues1 = arr1 as XmlAtomicValue[];
if (atomicValues1 != null)
{ // this is a list of union
return atomicValues1.Length == 1 && atomicValues1.GetValue(0)!.Equals(other.Value);
}
else
{
Debug.Assert(arr1 != null);
return arr1.Length == 1 && arr1.GetValue(0)!.Equals(other.Value);
}
}
}
else if (other.IsList)
{
Array? arr2 = other.Value as System.Array;
XmlAtomicValue[]? atomicValues2 = arr2 as XmlAtomicValue[];
if (atomicValues2 != null)
{ // other is a list of union
return atomicValues2.Length == 1 && atomicValues2.GetValue(0)!.Equals(this.Value);
}
else
{
Debug.Assert(arr2 != null);
return arr2.Length == 1 && arr2.GetValue(0)!.Equals(this.Value);
}
}
else
{ //Both are not lists
return this.Value!.Equals(other.Value);
}
}
}
internal sealed class KeySequence
{
private readonly TypedObject[] _ks;
private readonly int _dim;
private int _hashcode = -1;
private readonly int _posline, _poscol; // for error reporting
internal KeySequence(int dim, int line, int col)
{
Debug.Assert(dim > 0);
_dim = dim;
_ks = new TypedObject[dim];
_posline = line;
_poscol = col;
}
public int PosLine
{
get { return _posline; }
}
public int PosCol
{
get { return _poscol; }
}
public object this[int index]
{
get
{
object result = _ks[index];
return result;
}
set
{
_ks[index] = (TypedObject)value;
}
}
// return true if no null field
internal bool IsQualified()
{
for (int i = 0; i < _ks.Length; ++i)
{
if ((_ks[i] == null) || (_ks[i].Value == null)) return false;
}
return true;
}
// it's not directly suit for hashtable, because it's always calculating address
public override int GetHashCode()
{
if (_hashcode != -1)
{
return _hashcode;
}
_hashcode = 0; // indicate it's changed. even the calculated hashcode below is 0
for (int i = 0; i < _ks.Length; i++)
{
// extract its primitive value to calculate hashcode
// decimal is handled differently to enable among different CLR types
_ks[i].SetDecimal();
if (_ks[i].IsDecimal)
{
for (int j = 0; j < _ks[i].Dim; j++)
{
_hashcode += _ks[i].Dvalue[j].GetHashCode();
}
}
// BUGBUG: will need to change below parts, using canonical presentation.
else
{
if (_ks[i].Value is Array arr)
{
XmlAtomicValue[]? atomicValues = arr as XmlAtomicValue[];
if (atomicValues != null)
{
for (int j = 0; j < atomicValues.Length; j++)
{
_hashcode += ((XmlAtomicValue)atomicValues.GetValue(j)!).TypedValue.GetHashCode();
}
}
else
{
for (int j = 0; j < ((Array)_ks[i].Value!).Length; j++)
{
_hashcode += ((Array)_ks[i].Value!).GetValue(j)!.GetHashCode();
}
}
}
else
{ //not a list
_hashcode += _ks[i].Value!.GetHashCode();
}
}
}
return _hashcode;
}
// considering about derived type
public override bool Equals([NotNullWhen(true)] object? other)
{
// each key sequence member can have different type
if (other is KeySequence keySequence)
{
for (int i = 0; i < _ks.Length; i++)
{
if (!_ks[i].Equals(keySequence._ks[i]))
{
return false;
}
}
return true;
}
else
{
Debug.Fail($"{nameof(other)} is not of type {nameof(KeySequence)}");
return false;
}
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append(_ks[0].ToString());
for (int i = 1; i < _ks.Length; i++)
{
sb.Append(' ');
sb.Append(_ks[i].ToString());
}
return sb.ToString();
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Xml.XPath;
using MS.Internal.Xml.XPath;
namespace System.Xml.Schema
{
internal sealed class ConstraintStruct
{
// for each constraint
internal CompiledIdentityConstraint constraint; // pointer to constraint
internal SelectorActiveAxis axisSelector;
internal ArrayList axisFields; // Add tableDim * LocatedActiveAxis in a loop
internal Hashtable? qualifiedTable; // Checking confliction
internal Hashtable? keyrefTable; // several keyref tables having connections to this one is possible
private readonly int _tableDim; // dimension of table = numbers of fields;
internal int TableDim
{
get { return _tableDim; }
}
internal ConstraintStruct(CompiledIdentityConstraint constraint)
{
this.constraint = constraint;
_tableDim = constraint.Fields.Length;
this.axisFields = new ArrayList(); // empty fields
this.axisSelector = new SelectorActiveAxis(constraint.Selector, this);
if (this.constraint.Role != CompiledIdentityConstraint.ConstraintRole.Keyref)
{
this.qualifiedTable = new Hashtable();
}
}
}
// ActiveAxis plus the location plus the state of matching in the constraint table : only for field
internal sealed class LocatedActiveAxis : ActiveAxis
{
private readonly int _column; // the column in the table (the field sequence)
internal bool isMatched; // if it's matched, then fill value in the validator later
internal KeySequence Ks; // associated with a keysequence it will fills in
internal int Column
{
get { return _column; }
}
internal LocatedActiveAxis(Asttree astfield, KeySequence ks, int column) : base(astfield)
{
this.Ks = ks;
_column = column;
this.isMatched = false;
}
internal void Reactivate(KeySequence ks)
{
Reactivate();
this.Ks = ks;
}
}
// exist for optimization purpose
// ActiveAxis plus
// 1. overload endelement function from parent to return result
// 2. combine locatedactiveaxis and keysequence more closely
// 3. enable locatedactiveaxis reusing (the most important optimization point)
// 4. enable ks adding to hashtable right after moving out selector node (to enable 3)
// 5. will modify locatedactiveaxis class accordingly
// 6. taking care of updating ConstraintStruct.axisFields
// 7. remove constraintTable from ConstraintStruct
// 8. still need centralized locatedactiveaxis for movetoattribute purpose
internal sealed class SelectorActiveAxis : ActiveAxis
{
private readonly ConstraintStruct _cs; // pointer of constraintstruct, to enable 6
private readonly ArrayList _KSs; // stack of KSStruct, will not become less
private int _KSpointer; // indicate current stack top (next available element);
public int lastDepth
{
get { return (_KSpointer == 0) ? -1 : ((KSStruct)_KSs[_KSpointer - 1]!).depth; }
}
public SelectorActiveAxis(Asttree axisTree, ConstraintStruct cs) : base(axisTree)
{
_KSs = new ArrayList();
_cs = cs;
}
public override bool EndElement(string localname, string? URN)
{
base.EndElement(localname, URN);
if (_KSpointer > 0 && this.CurrentDepth == lastDepth)
{
return true;
// next step PopPS, and insert into hash
}
return false;
}
// update constraintStruct.axisFields as well, if it's new LocatedActiveAxis
public int PushKS(int errline, int errcol)
{
// new KeySequence each time
KeySequence ks = new KeySequence(_cs.TableDim, errline, errcol);
// needs to clear KSStruct before using
KSStruct kss;
if (_KSpointer < _KSs.Count)
{
// reuse, clear up KSs.KSpointer
kss = (KSStruct)_KSs[_KSpointer]!;
kss.ks = ks;
// reactivate LocatedActiveAxis
for (int i = 0; i < _cs.TableDim; i++)
{
kss.fields[i].Reactivate(ks); // reassociate key sequence
}
}
else
{ // "==", new
kss = new KSStruct(ks, _cs.TableDim);
for (int i = 0; i < _cs.TableDim; i++)
{
kss.fields[i] = new LocatedActiveAxis(_cs.constraint.Fields[i], ks, i);
_cs.axisFields.Add(kss.fields[i]); // new, add to axisFields
}
_KSs.Add(kss);
}
kss.depth = this.CurrentDepth - 1;
return (_KSpointer++);
}
public KeySequence PopKS()
{
return ((KSStruct)_KSs[--_KSpointer]!).ks;
}
}
internal sealed class KSStruct
{
public int depth; // depth of selector when it matches
public KeySequence ks; // ks of selector when it matches and assigned -- needs to new each time
public LocatedActiveAxis[] fields; // array of fields activeaxis when it matches and assigned
public KSStruct(KeySequence ks, int dim)
{
this.ks = ks;
this.fields = new LocatedActiveAxis[dim];
}
}
internal sealed class TypedObject
{
private sealed class DecimalStruct
{
private bool _isDecimal; // rare case it will be used...
private readonly decimal[] _dvalue; // to accelerate equals operation. array <-> list
public bool IsDecimal
{
get { return _isDecimal; }
set { _isDecimal = value; }
}
public decimal[] Dvalue
{
get { return _dvalue; }
}
public DecimalStruct()
{
_dvalue = new decimal[1];
}
//list
public DecimalStruct(int dim)
{
_dvalue = new decimal[dim];
}
}
private DecimalStruct? _dstruct;
private object? _ovalue;
private readonly string _svalue; // only for output
private XmlSchemaDatatype _xsdtype;
private readonly int _dim = 1;
private readonly bool _isList;
public int Dim
{
get { return _dim; }
}
public bool IsList
{
get { return _isList; }
}
public bool IsDecimal
{
get
{
Debug.Assert(_dstruct != null);
return _dstruct.IsDecimal;
}
}
public decimal[] Dvalue
{
get
{
Debug.Assert(_dstruct != null);
return _dstruct.Dvalue;
}
}
public object? Value
{
get { return _ovalue; }
set { _ovalue = value; }
}
public XmlSchemaDatatype Type
{
get { return _xsdtype; }
set { _xsdtype = value; }
}
public TypedObject(object? obj, string svalue, XmlSchemaDatatype xsdtype)
{
_ovalue = obj;
_svalue = svalue;
_xsdtype = xsdtype;
if (xsdtype.Variety == XmlSchemaDatatypeVariety.List ||
xsdtype is Datatype_base64Binary ||
xsdtype is Datatype_hexBinary)
{
_isList = true;
_dim = ((Array)obj!).Length;
}
}
public override string ToString()
{
// only for exception
return _svalue;
}
public void SetDecimal()
{
if (_dstruct != null)
{
return;
}
// Debug.Assert(!this.IsDecimal);
switch (_xsdtype.TypeCode)
{
case XmlTypeCode.Byte:
case XmlTypeCode.UnsignedByte:
case XmlTypeCode.Short:
case XmlTypeCode.UnsignedShort:
case XmlTypeCode.Int:
case XmlTypeCode.UnsignedInt:
case XmlTypeCode.Long:
case XmlTypeCode.UnsignedLong:
case XmlTypeCode.Decimal:
case XmlTypeCode.Integer:
case XmlTypeCode.PositiveInteger:
case XmlTypeCode.NonNegativeInteger:
case XmlTypeCode.NegativeInteger:
case XmlTypeCode.NonPositiveInteger:
if (_isList)
{
_dstruct = new DecimalStruct(_dim);
for (int i = 0; i < _dim; i++)
{
_dstruct.Dvalue[i] = Convert.ToDecimal(((Array)_ovalue!).GetValue(i), NumberFormatInfo.InvariantInfo);
}
}
else
{ //not list
_dstruct = new DecimalStruct();
//possibility of list of length 1.
_dstruct.Dvalue[0] = Convert.ToDecimal(_ovalue, NumberFormatInfo.InvariantInfo);
}
_dstruct.IsDecimal = true;
break;
default:
if (_isList)
{
_dstruct = new DecimalStruct(_dim);
}
else
{
_dstruct = new DecimalStruct();
}
break;
}
}
private bool ListDValueEquals(TypedObject other)
{
for (int i = 0; i < this.Dim; i++)
{
if (this.Dvalue[i] != other.Dvalue[i])
{
return false;
}
}
return true;
}
public bool Equals(TypedObject other)
{
// ? one is list with one member, another is not list -- still might be equal
if (this.Dim != other.Dim)
{
return false;
}
if (this.Type != other.Type)
{
//Check if types are comparable
if (!(this.Type.IsComparable(other.Type)))
{
return false;
}
other.SetDecimal(); // can't use cast and other.Type.IsEqual (value1, value2)
this.SetDecimal();
if (this.IsDecimal && other.IsDecimal)
{ //Both are decimal / derived types
return this.ListDValueEquals(other);
}
}
// not-Decimal derivation or type equal
if (this.IsList)
{
if (other.IsList)
{ //Both are lists and values are XmlAtomicValue[] or clrvalue[]. So use Datatype_List.Compare
return this.Type.Compare(this.Value!, other.Value!) == 0;
}
else
{ //this is a list and other is a single value
Array? arr1 = this.Value as System.Array;
XmlAtomicValue[]? atomicValues1 = arr1 as XmlAtomicValue[];
if (atomicValues1 != null)
{ // this is a list of union
return atomicValues1.Length == 1 && atomicValues1.GetValue(0)!.Equals(other.Value);
}
else
{
Debug.Assert(arr1 != null);
return arr1.Length == 1 && arr1.GetValue(0)!.Equals(other.Value);
}
}
}
else if (other.IsList)
{
Array? arr2 = other.Value as System.Array;
XmlAtomicValue[]? atomicValues2 = arr2 as XmlAtomicValue[];
if (atomicValues2 != null)
{ // other is a list of union
return atomicValues2.Length == 1 && atomicValues2.GetValue(0)!.Equals(this.Value);
}
else
{
Debug.Assert(arr2 != null);
return arr2.Length == 1 && arr2.GetValue(0)!.Equals(this.Value);
}
}
else
{ //Both are not lists
return this.Value!.Equals(other.Value);
}
}
}
internal sealed class KeySequence
{
private readonly TypedObject[] _ks;
private readonly int _dim;
private int _hashcode = -1;
private readonly int _posline, _poscol; // for error reporting
internal KeySequence(int dim, int line, int col)
{
Debug.Assert(dim > 0);
_dim = dim;
_ks = new TypedObject[dim];
_posline = line;
_poscol = col;
}
public int PosLine
{
get { return _posline; }
}
public int PosCol
{
get { return _poscol; }
}
public object this[int index]
{
get
{
object result = _ks[index];
return result;
}
set
{
_ks[index] = (TypedObject)value;
}
}
// return true if no null field
internal bool IsQualified()
{
for (int i = 0; i < _ks.Length; ++i)
{
if ((_ks[i] == null) || (_ks[i].Value == null)) return false;
}
return true;
}
// it's not directly suit for hashtable, because it's always calculating address
public override int GetHashCode()
{
if (_hashcode != -1)
{
return _hashcode;
}
_hashcode = 0; // indicate it's changed. even the calculated hashcode below is 0
for (int i = 0; i < _ks.Length; i++)
{
// extract its primitive value to calculate hashcode
// decimal is handled differently to enable among different CLR types
_ks[i].SetDecimal();
if (_ks[i].IsDecimal)
{
for (int j = 0; j < _ks[i].Dim; j++)
{
_hashcode += _ks[i].Dvalue[j].GetHashCode();
}
}
// BUGBUG: will need to change below parts, using canonical presentation.
else
{
if (_ks[i].Value is Array arr)
{
XmlAtomicValue[]? atomicValues = arr as XmlAtomicValue[];
if (atomicValues != null)
{
for (int j = 0; j < atomicValues.Length; j++)
{
_hashcode += ((XmlAtomicValue)atomicValues.GetValue(j)!).TypedValue.GetHashCode();
}
}
else
{
for (int j = 0; j < ((Array)_ks[i].Value!).Length; j++)
{
_hashcode += ((Array)_ks[i].Value!).GetValue(j)!.GetHashCode();
}
}
}
else
{ //not a list
_hashcode += _ks[i].Value!.GetHashCode();
}
}
}
return _hashcode;
}
// considering about derived type
public override bool Equals([NotNullWhen(true)] object? other)
{
// each key sequence member can have different type
if (other is KeySequence keySequence)
{
for (int i = 0; i < _ks.Length; i++)
{
if (!_ks[i].Equals(keySequence._ks[i]))
{
return false;
}
}
return true;
}
else
{
Debug.Fail($"{nameof(other)} is not of type {nameof(KeySequence)}");
return false;
}
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append(_ks[0].ToString());
for (int i = 1; i < _ks.Length; i++)
{
sb.Append(' ');
sb.Append(_ks[i].ToString());
}
return sb.ToString();
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/vm/typeequivalencehash.hpp | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Hash table associated with each module that records for all types defined in that module the mapping
// between type name and token (or TypeHandle).
//
#ifndef __TYPEEQUIVALENCE_HASH_INCLUDED
#define __TYPEEQUIVALENCE_HASH_INCLUDED
#ifdef FEATURE_TYPEEQUIVALENCE
#include "dacenumerablehash.h"
// The type of each entry in the hash.
typedef DPTR(struct TypeEquivalenceEntry) PTR_TypeEquivalenceEntry;
struct TypeEquivalenceEntry
{
static DacEnumerableHashValue HashTypeHandles(TypeHandle thA, TypeHandle thB)
{
LIMITED_METHOD_CONTRACT;
UINT_PTR aPtr = thA.AsTAddr();
UINT_PTR bPtr = thB.AsTAddr();
DWORD hash = (DWORD)((aPtr + bPtr) >> 3);
return hash;
}
bool Match(TypeHandle thA, TypeHandle thB)
{
LIMITED_METHOD_CONTRACT;
return (((thA == m_thA) && (thB == m_thB))
|| ((thB == m_thA) && (thA == m_thB)));
}
void SetData(TypeHandle thA, TypeHandle thB, bool fEquivalent)
{
LIMITED_METHOD_CONTRACT;
m_thA = thA;
m_thB = thB;
m_fEquivalent = fEquivalent;
}
bool GetEquivalence()
{
LIMITED_METHOD_CONTRACT;
return m_fEquivalent;
}
private:
TypeHandle m_thA;
TypeHandle m_thB;
bool m_fEquivalent;
};
// The hash type itself. All common logic is provided by the DacEnumerableHashTable templated base class. See
// DacEnumerableHash.h for details.
typedef DPTR(class TypeEquivalenceHashTable) PTR_TypeEquivalenceHashTable;
class TypeEquivalenceHashTable : public DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>
{
public:
enum EquivalenceMatch
{
MatchUnknown,
Match,
NoMatch
};
// The LookupContext type we export to track GetValue/FindNextNestedClass enumerations is simply a rename
// of the base classes' hash value enumerator.
typedef DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>::LookupContext LookupContext;
#ifndef DACCESS_COMPILE
static TypeEquivalenceHashTable *Create(AppDomain *pDomain, DWORD dwNumBuckets, CrstExplicitInit *pCrst);
void RecordEquivalence(TypeHandle thA, TypeHandle thB, EquivalenceMatch match);
#endif
EquivalenceMatch CheckEquivalence(TypeHandle thA, TypeHandle thB);
private:
#ifndef DACCESS_COMPILE
TypeEquivalenceHashTable(LoaderHeap *pHeap, DWORD cInitialBuckets, CrstExplicitInit *pCrst)
: DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>(NULL, pHeap, cInitialBuckets)
, m_pHashTableCrst(pCrst)
{
}
#endif // DACCESS_COMPILE
CrstExplicitInit* m_pHashTableCrst;
};
#endif // FEATURE_TYPEEQUIVALENCE
#endif // !__TYPEEQUIVALENCE_HASH_INCLUDED
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Hash table associated with each module that records for all types defined in that module the mapping
// between type name and token (or TypeHandle).
//
#ifndef __TYPEEQUIVALENCE_HASH_INCLUDED
#define __TYPEEQUIVALENCE_HASH_INCLUDED
#ifdef FEATURE_TYPEEQUIVALENCE
#include "dacenumerablehash.h"
// The type of each entry in the hash.
typedef DPTR(struct TypeEquivalenceEntry) PTR_TypeEquivalenceEntry;
struct TypeEquivalenceEntry
{
static DacEnumerableHashValue HashTypeHandles(TypeHandle thA, TypeHandle thB)
{
LIMITED_METHOD_CONTRACT;
UINT_PTR aPtr = thA.AsTAddr();
UINT_PTR bPtr = thB.AsTAddr();
DWORD hash = (DWORD)((aPtr + bPtr) >> 3);
return hash;
}
bool Match(TypeHandle thA, TypeHandle thB)
{
LIMITED_METHOD_CONTRACT;
return (((thA == m_thA) && (thB == m_thB))
|| ((thB == m_thA) && (thA == m_thB)));
}
void SetData(TypeHandle thA, TypeHandle thB, bool fEquivalent)
{
LIMITED_METHOD_CONTRACT;
m_thA = thA;
m_thB = thB;
m_fEquivalent = fEquivalent;
}
bool GetEquivalence()
{
LIMITED_METHOD_CONTRACT;
return m_fEquivalent;
}
private:
TypeHandle m_thA;
TypeHandle m_thB;
bool m_fEquivalent;
};
// The hash type itself. All common logic is provided by the DacEnumerableHashTable templated base class. See
// DacEnumerableHash.h for details.
typedef DPTR(class TypeEquivalenceHashTable) PTR_TypeEquivalenceHashTable;
class TypeEquivalenceHashTable : public DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>
{
public:
enum EquivalenceMatch
{
MatchUnknown,
Match,
NoMatch
};
// The LookupContext type we export to track GetValue/FindNextNestedClass enumerations is simply a rename
// of the base classes' hash value enumerator.
typedef DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>::LookupContext LookupContext;
#ifndef DACCESS_COMPILE
static TypeEquivalenceHashTable *Create(AppDomain *pDomain, DWORD dwNumBuckets, CrstExplicitInit *pCrst);
void RecordEquivalence(TypeHandle thA, TypeHandle thB, EquivalenceMatch match);
#endif
EquivalenceMatch CheckEquivalence(TypeHandle thA, TypeHandle thB);
private:
#ifndef DACCESS_COMPILE
TypeEquivalenceHashTable(LoaderHeap *pHeap, DWORD cInitialBuckets, CrstExplicitInit *pCrst)
: DacEnumerableHashTable<TypeEquivalenceHashTable, TypeEquivalenceEntry, 4>(NULL, pHeap, cInitialBuckets)
, m_pHashTableCrst(pCrst)
{
}
#endif // DACCESS_COMPILE
CrstExplicitInit* m_pHashTableCrst;
};
#endif // FEATURE_TYPEEQUIVALENCE
#endif // !__TYPEEQUIVALENCE_HASH_INCLUDED
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/native/corehost/ijwhost/arm/bootstrap_thunk.cpp | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "bootstrap_thunk.h"
#include "corhdr.h"
#include "pal.h"
//=================================================================================
// Get thunk from the address that the thunk code provided
bootstrap_thunk *bootstrap_thunk::get_thunk_from_cookie(std::uintptr_t cookie)
{
// Cookie is generated via the first thunk instruction:
// mov r12, pc
// The pc is returned from the hardware as the pc at the start of the instruction (i.e. the thunk address)
// + 4. So we can recover the thunk address simply by subtracting 4 from the cookie.
return (bootstrap_thunk *)(cookie - 4);
}
//=================================================================================
// Get thunk from the thunk code entry point address
bootstrap_thunk *bootstrap_thunk::get_thunk_from_entrypoint(std::uintptr_t entryAddr)
{
// The entry point is at the start of the thunk but the code address will have the low-order bit set to
// indicate Thumb code and we need to mask that out.
return (bootstrap_thunk *)(entryAddr & ~1);
}
//=================================================================================
// Returns the slot address of the vtable entry for this thunk
std::uintptr_t *bootstrap_thunk::get_slot_address()
{
return m_slot;
}
//=================================================================================
// Returns the pal::dll_t for this thunk's module
pal::dll_t bootstrap_thunk::get_dll_handle()
{
return m_dll;
}
//=================================================================================
// Returns the token of this thunk
std::uint32_t bootstrap_thunk::get_token()
{
return m_token;
}
//=================================================================================
std::uintptr_t bootstrap_thunk::get_entrypoint()
{
// Set the low-order bit of the address returned to indicate to the hardware that it's Thumb code.
return (std::uintptr_t)this | 1;
}
//=================================================================================
// Initializes the thunk to point to the bootstrap helper that will load the
// runtime and perform the real thunk initialization.
//
void bootstrap_thunk::initialize(std::uintptr_t pThunkInitFcn,
pal::dll_t dll,
std::uint32_t token,
std::uintptr_t *pSlot)
{
// Initialize code section of the thunk:
WORD rgCode[] = {
0x46fc, // mov r12, pc
0xf8df, 0xf004, // ldr pc, [pc, #4]
0x0000 // padding for 4-byte alignment of target address that follows
};
BYTE *pCode = (BYTE*)this;
memcpy(pCode, rgCode, sizeof(rgCode));
pCode += sizeof(rgCode);
*(std::uintptr_t*)pCode = pThunkInitFcn;
m_dll = dll;
m_slot = pSlot;
m_token = token;
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "bootstrap_thunk.h"
#include "corhdr.h"
#include "pal.h"
//=================================================================================
// Get thunk from the address that the thunk code provided
bootstrap_thunk *bootstrap_thunk::get_thunk_from_cookie(std::uintptr_t cookie)
{
// Cookie is generated via the first thunk instruction:
// mov r12, pc
// The pc is returned from the hardware as the pc at the start of the instruction (i.e. the thunk address)
// + 4. So we can recover the thunk address simply by subtracting 4 from the cookie.
return (bootstrap_thunk *)(cookie - 4);
}
//=================================================================================
// Get thunk from the thunk code entry point address
bootstrap_thunk *bootstrap_thunk::get_thunk_from_entrypoint(std::uintptr_t entryAddr)
{
// The entry point is at the start of the thunk but the code address will have the low-order bit set to
// indicate Thumb code and we need to mask that out.
return (bootstrap_thunk *)(entryAddr & ~1);
}
//=================================================================================
// Returns the slot address of the vtable entry for this thunk
std::uintptr_t *bootstrap_thunk::get_slot_address()
{
return m_slot;
}
//=================================================================================
// Returns the pal::dll_t for this thunk's module
pal::dll_t bootstrap_thunk::get_dll_handle()
{
return m_dll;
}
//=================================================================================
// Returns the token of this thunk
std::uint32_t bootstrap_thunk::get_token()
{
return m_token;
}
//=================================================================================
std::uintptr_t bootstrap_thunk::get_entrypoint()
{
// Set the low-order bit of the address returned to indicate to the hardware that it's Thumb code.
return (std::uintptr_t)this | 1;
}
//=================================================================================
// Initializes the thunk to point to the bootstrap helper that will load the
// runtime and perform the real thunk initialization.
//
void bootstrap_thunk::initialize(std::uintptr_t pThunkInitFcn,
pal::dll_t dll,
std::uint32_t token,
std::uintptr_t *pSlot)
{
// Initialize code section of the thunk:
WORD rgCode[] = {
0x46fc, // mov r12, pc
0xf8df, 0xf004, // ldr pc, [pc, #4]
0x0000 // padding for 4-byte alignment of target address that follows
};
BYTE *pCode = (BYTE*)this;
memcpy(pCode, rgCode, sizeof(rgCode));
pCode += sizeof(rgCode);
*(std::uintptr_t*)pCode = pThunkInitFcn;
m_dll = dll;
m_slot = pSlot;
m_token = token;
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.Int32.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void BitwiseOrInt32()
{
var test = new VectorBinaryOpTest__BitwiseOrInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__BitwiseOrInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrInt32 testClass)
{
var result = Vector64.BitwiseOr(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__BitwiseOrInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
}
public VectorBinaryOpTest__BitwiseOrInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.BitwiseOr(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), new Type[] {
typeof(Vector64<Int32>),
typeof(Vector64<Int32>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Int32));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.BitwiseOr(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var result = Vector64.BitwiseOr(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__BitwiseOrInt32();
var result = Vector64.BitwiseOr(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.BitwiseOr(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.BitwiseOr(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (int)(left[0] | right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (int)(left[i] | right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.BitwiseOr)}<Int32>(Vector64<Int32>, Vector64<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void BitwiseOrInt32()
{
var test = new VectorBinaryOpTest__BitwiseOrInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__BitwiseOrInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrInt32 testClass)
{
var result = Vector64.BitwiseOr(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__BitwiseOrInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
}
public VectorBinaryOpTest__BitwiseOrInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.BitwiseOr(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), new Type[] {
typeof(Vector64<Int32>),
typeof(Vector64<Int32>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Int32));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.BitwiseOr(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var result = Vector64.BitwiseOr(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__BitwiseOrInt32();
var result = Vector64.BitwiseOr(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.BitwiseOr(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.BitwiseOr(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (int)(left[0] | right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (int)(left[i] | right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.BitwiseOr)}<Int32>(Vector64<Int32>, Vector64<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/baseservices/exceptions/generics/try-filter-finally02.ilproj | <Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="try-filter-finally02.il" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="try-filter-finally02.il" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/HttpClientHandlerTestBase.WinHttpHandler.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Test.Common;
using System.IO;
namespace System.Net.Http.Functional.Tests
{
public abstract partial class HttpClientHandlerTestBase : FileCleanupTestBase
{
protected static bool IsWinHttpHandler => true;
protected static WinHttpClientHandler CreateHttpClientHandler(Version useVersion = null, bool allowAllHttp2Certificates = true)
{
useVersion ??= HttpVersion.Version11;
WinHttpClientHandler handler = new WinHttpClientHandler(useVersion);
if (useVersion >= HttpVersion20.Value && allowAllHttp2Certificates)
{
handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates;
}
return handler;
}
protected WinHttpClientHandler CreateHttpClientHandler() => CreateHttpClientHandler(UseVersion);
protected static WinHttpClientHandler CreateHttpClientHandler(string useVersionString) =>
CreateHttpClientHandler(Version.Parse(useVersionString));
protected static HttpRequestMessage CreateRequest(HttpMethod method, Uri uri, Version version, bool exactVersion = false) =>
new HttpRequestMessage(method, uri)
{
Version = version
};
protected LoopbackServerFactory LoopbackServerFactory => GetFactoryForVersion(UseVersion);
protected static LoopbackServerFactory GetFactoryForVersion(Version useVersion)
{
return useVersion.Major switch
{
2 => Http2LoopbackServerFactory.Singleton,
_ => Http11LoopbackServerFactory.Singleton
};
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Test.Common;
using System.IO;
namespace System.Net.Http.Functional.Tests
{
public abstract partial class HttpClientHandlerTestBase : FileCleanupTestBase
{
protected static bool IsWinHttpHandler => true;
protected static WinHttpClientHandler CreateHttpClientHandler(Version useVersion = null, bool allowAllHttp2Certificates = true)
{
useVersion ??= HttpVersion.Version11;
WinHttpClientHandler handler = new WinHttpClientHandler(useVersion);
if (useVersion >= HttpVersion20.Value && allowAllHttp2Certificates)
{
handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates;
}
return handler;
}
protected WinHttpClientHandler CreateHttpClientHandler() => CreateHttpClientHandler(UseVersion);
protected static WinHttpClientHandler CreateHttpClientHandler(string useVersionString) =>
CreateHttpClientHandler(Version.Parse(useVersionString));
protected static HttpRequestMessage CreateRequest(HttpMethod method, Uri uri, Version version, bool exactVersion = false) =>
new HttpRequestMessage(method, uri)
{
Version = version
};
protected LoopbackServerFactory LoopbackServerFactory => GetFactoryForVersion(UseVersion);
protected static LoopbackServerFactory GetFactoryForVersion(Version useVersion)
{
return useVersion.Major switch
{
2 => Http2LoopbackServerFactory.Singleton,
_ => Http11LoopbackServerFactory.Singleton
};
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/Common/wasm-test-runner/WasmTestRunner.proj | <!-- This project requires an explicit SDK version number because it is used on Helix,
and global.json is not available. -->
<Project Sdk="Microsoft.Build.NoTargets/1.0.53" DefaultTargets="WasmBuildApp">
<Import Project="$(CORE_ROOT)\build\WasmApp.InTree.props" />
<PropertyGroup>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<MicrosoftNetCoreAppRuntimePackDir>$(CORE_ROOT)\runtimepack-non-existant</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$(CORE_ROOT)\runtimepack</MicrosoftNetCoreAppRuntimePackRidDir>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<BuildDir>$(MSBuildThisFileDirectory)\obj\$(Configuration)\wasm</BuildDir>
<AppDir>$(TestBinDir)/WasmApp/</AppDir>
<NETCoreAppMaximumVersion>99.0</NETCoreAppMaximumVersion>
<IsWasmProject>true</IsWasmProject>
<WasmGenerateAppBundle>true</WasmGenerateAppBundle>
<WasmAppBuilderTasksAssemblyPath>$(CORE_ROOT)\WasmAppBuilder\WasmAppBuilder.dll</WasmAppBuilderTasksAssemblyPath>
<MonoAOTCompilerTasksAssemblyPath>$(CORE_ROOT)\MonoAOTCompiler\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
<MonoTargetsTasksAssemblyPath>$(CORE_ROOT)\MonoTargetsTasks\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
<WasmBuildAppDependsOn>BuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
</PropertyGroup>
<Target Name="BuildApp">
<PropertyGroup>
<WasmMainAssemblyFileName>$(TestAssemblyFileName)</WasmMainAssemblyFileName>
<WasmAppDir>$(AppDir)</WasmAppDir>
<WasmMainJSPath>$(CORE_ROOT)\runtime-test\test-main.js</WasmMainJSPath>
<WasmResolveAssembliesBeforeBuild>true</WasmResolveAssembliesBeforeBuild>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
<WasmSkipMissingAssemblies>true</WasmSkipMissingAssemblies>
</PropertyGroup>
<ItemGroup>
<WasmAssembliesToBundle Include="$(TestBinDir)\*.dll" />
<WasmAssembliesToBundle Include="$(CORE_ROOT)\System.Private.Runtime.InteropServices.JavaScript.dll" />
<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)\native"/>
<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)"/>
<WasmAssemblySearchPaths Include="$(CORE_ROOT)/TargetingPack" />
<WasmAssemblySearchPaths Include="$(TestBinDir)" />
</ItemGroup>
<Message Importance="High" Text="AppDir: $(AppDir)" />
<Message Importance="High" Text="TestBinDir: $(TestBinDir)" />
<Message Importance="High" Text="ArtifactsBinDir: $(ArtifactsBinDir)" />
</Target>
<Import Project="$(CORE_ROOT)\build\WasmApp.InTree.targets" />
</Project>
| <!-- This project requires an explicit SDK version number because it is used on Helix,
and global.json is not available. -->
<Project Sdk="Microsoft.Build.NoTargets/1.0.53" DefaultTargets="WasmBuildApp">
<Import Project="$(CORE_ROOT)\build\WasmApp.InTree.props" />
<PropertyGroup>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<MicrosoftNetCoreAppRuntimePackDir>$(CORE_ROOT)\runtimepack-non-existant</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$(CORE_ROOT)\runtimepack</MicrosoftNetCoreAppRuntimePackRidDir>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<BuildDir>$(MSBuildThisFileDirectory)\obj\$(Configuration)\wasm</BuildDir>
<AppDir>$(TestBinDir)/WasmApp/</AppDir>
<NETCoreAppMaximumVersion>99.0</NETCoreAppMaximumVersion>
<IsWasmProject>true</IsWasmProject>
<WasmGenerateAppBundle>true</WasmGenerateAppBundle>
<WasmAppBuilderTasksAssemblyPath>$(CORE_ROOT)\WasmAppBuilder\WasmAppBuilder.dll</WasmAppBuilderTasksAssemblyPath>
<MonoAOTCompilerTasksAssemblyPath>$(CORE_ROOT)\MonoAOTCompiler\MonoAOTCompiler.dll</MonoAOTCompilerTasksAssemblyPath>
<MonoTargetsTasksAssemblyPath>$(CORE_ROOT)\MonoTargetsTasks\MonoTargetsTasks.dll</MonoTargetsTasksAssemblyPath>
<WasmBuildAppDependsOn>BuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
</PropertyGroup>
<Target Name="BuildApp">
<PropertyGroup>
<WasmMainAssemblyFileName>$(TestAssemblyFileName)</WasmMainAssemblyFileName>
<WasmAppDir>$(AppDir)</WasmAppDir>
<WasmMainJSPath>$(CORE_ROOT)\runtime-test\test-main.js</WasmMainJSPath>
<WasmResolveAssembliesBeforeBuild>true</WasmResolveAssembliesBeforeBuild>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
<WasmSkipMissingAssemblies>true</WasmSkipMissingAssemblies>
</PropertyGroup>
<ItemGroup>
<WasmAssembliesToBundle Include="$(TestBinDir)\*.dll" />
<WasmAssembliesToBundle Include="$(CORE_ROOT)\System.Private.Runtime.InteropServices.JavaScript.dll" />
<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)\native"/>
<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)"/>
<WasmAssemblySearchPaths Include="$(CORE_ROOT)/TargetingPack" />
<WasmAssemblySearchPaths Include="$(TestBinDir)" />
</ItemGroup>
<Message Importance="High" Text="AppDir: $(AppDir)" />
<Message Importance="High" Text="TestBinDir: $(TestBinDir)" />
<Message Importance="High" Text="ArtifactsBinDir: $(ArtifactsBinDir)" />
</Target>
<Import Project="$(CORE_ROOT)\build\WasmApp.InTree.targets" />
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Runtime.Serialization.Formatters/tests/TypeSerializableValue.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Runtime.Serialization.Formatters.Tests
{
public readonly struct TypeSerializableValue
{
public readonly string Base64Blob;
// This is the minimum version, when the blob changed.
public readonly TargetFrameworkMoniker Platform;
public TypeSerializableValue(string base64Blob, TargetFrameworkMoniker platform)
{
Base64Blob = base64Blob;
Platform = platform;
}
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Runtime.Serialization.Formatters.Tests
{
public readonly struct TypeSerializableValue
{
public readonly string Base64Blob;
// This is the minimum version, when the blob changed.
public readonly TargetFrameworkMoniker Platform;
public TypeSerializableValue(string base64Blob, TargetFrameworkMoniker platform)
{
Base64Blob = base64Blob;
Platform = platform;
}
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCompiler.Tests.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- This doesn't run on V8 shell because https://bugs.chromium.org/p/v8/issues/detail?id=12541 -->
<Scenario>WasmTestOnBrowser</Scenario>
<TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="CommonScenarios\XsltcTestBasicFunctionality.cs" />
<Compile Include="CommonScenarios\XsltcTestCaseBase.cs" />
<Compile Include="CommonScenarios\XsltcTestFile.cs" />
<Compile Include="CommonScenarios\XsltcTestPlatform.cs" />
<Compile Include="CommonScenarios\XsltcTestSettings.cs" />
<Compile Include="XsltcModule.cs" />
<Compile Include="XsltCommon.cs" />
<Compile Include="ApiTests\XsltcApiTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\TestFiles\**\*"
Link="TestFiles\%(RecursiveDir)%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Visible="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)System\Xml\ModuleCore\ModuleCore.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlDiff\XmlDiff.csproj" />
</ItemGroup>
</Project> | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- This doesn't run on V8 shell because https://bugs.chromium.org/p/v8/issues/detail?id=12541 -->
<Scenario>WasmTestOnBrowser</Scenario>
<TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="CommonScenarios\XsltcTestBasicFunctionality.cs" />
<Compile Include="CommonScenarios\XsltcTestCaseBase.cs" />
<Compile Include="CommonScenarios\XsltcTestFile.cs" />
<Compile Include="CommonScenarios\XsltcTestPlatform.cs" />
<Compile Include="CommonScenarios\XsltcTestSettings.cs" />
<Compile Include="XsltcModule.cs" />
<Compile Include="XsltCommon.cs" />
<Compile Include="ApiTests\XsltcApiTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\TestFiles\**\*"
Link="TestFiles\%(RecursiveDir)%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Visible="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)System\Xml\ModuleCore\ModuleCore.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlDiff\XmlDiff.csproj" />
</ItemGroup>
</Project> | -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/libraries/System.Data.Common/src/System/Data/Common/DbBatchCommand.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace System.Data.Common
{
public abstract class DbBatchCommand
{
public abstract string CommandText { get; set; }
public abstract CommandType CommandType { get; set; }
public abstract int RecordsAffected { get; }
public DbParameterCollection Parameters => DbParameterCollection;
protected abstract DbParameterCollection DbParameterCollection { get; }
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace System.Data.Common
{
public abstract class DbBatchCommand
{
public abstract string CommandText { get; set; }
public abstract CommandType CommandType { get; set; }
public abstract int RecordsAffected { get; }
public DbParameterCollection Parameters => DbParameterCollection;
protected abstract DbParameterCollection DbParameterCollection { get; }
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/JIT/CodeGenBringUpTests/FPSubConst_r.csproj | <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPSubConst.cs" />
</ItemGroup>
</Project>
| <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPSubConst.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CanonicalEETypeNode.cs | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Internal.TypeSystem;
using Internal.Runtime;
namespace ILCompiler.DependencyAnalysis
{
/// <summary>
/// Canonical type instantiations are emitted, not because they are used directly by the user code, but because
/// they are used by the dynamic type loader when dynamically instantiating types at runtime.
/// The data that we emit on canonical type instantiations should just be the minimum that is needed by the template
/// type loader.
/// Similarly, the dependencies that we track for canonical type instantiations are minimal, and are just the ones used
/// by the dynamic type loader
/// </summary>
public sealed class CanonicalEETypeNode : EETypeNode
{
public CanonicalEETypeNode(NodeFactory factory, TypeDesc type) : base(factory, type)
{
Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any));
Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any));
Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific));
Debug.Assert(!type.IsMdArray || factory.Target.Abi == TargetAbi.CppCodegen);
}
public override bool StaticDependenciesAreComputed => true;
public override bool IsShareable => IsTypeNodeShareable(_type);
protected override bool EmitVirtualSlotsAndInterfaces => true;
public override bool ShouldSkipEmittingObjectNode(NodeFactory factory) => false;
protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencyList = base.ComputeNonRelocationBasedDependencies(factory);
// Ensure that we track the necessary type symbol if we are working with a constructed type symbol.
// The emitter will ensure we don't emit both, but this allows us assert that we only generate
// relocs to nodes we emit.
dependencyList.Add(factory.NecessaryTypeSymbol(_type), "Necessary type symbol related to CanonicalEETypeNode");
DefType closestDefType = _type.GetClosestDefType();
if (MightHaveInterfaceDispatchMap(factory))
dependencyList.Add(factory.InterfaceDispatchMap(_type), "Canonical interface dispatch map");
dependencyList.Add(factory.VTable(closestDefType), "VTable");
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
dependencyList.Add(factory.NativeLayout.TemplateTypeLayout(_type), "Universal generic types always have template layout");
// Track generic virtual methods that will get added to the GVM tables
if (TypeGVMEntriesNode.TypeNeedsGVMTableEntries(_type))
{
dependencyList.Add(new DependencyListEntry(factory.TypeGVMEntries(_type.GetTypeDefinition()), "Type with generic virtual methods"));
AddDependenciesForUniversalGVMSupport(factory, _type, ref dependencyList);
}
// Keep track of the default constructor map dependency for this type if it has a default constructor
MethodDesc defaultCtor = closestDefType.GetDefaultConstructor();
if (defaultCtor != null)
{
dependencyList.Add(new DependencyListEntry(
factory.CanonicalEntrypoint(defaultCtor),
"DefaultConstructorNode"));
}
return dependencyList;
}
protected override ISymbolNode GetBaseTypeNode(NodeFactory factory)
{
return _type.BaseType != null ? factory.NecessaryTypeSymbol(_type.BaseType.NormalizeInstantiation()) : null;
}
protected override int GCDescSize
{
get
{
// No GCDescs for universal canonical types
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
return 0;
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Specific));
return GCDescEncoder.GetGCDescSize(_type);
}
}
protected override void OutputGCDesc(ref ObjectDataBuilder builder)
{
// No GCDescs for universal canonical types
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
return;
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Specific));
GCDescEncoder.EncodeGCDesc(ref builder, _type);
}
protected override void OutputInterfaceMap(NodeFactory factory, ref ObjectDataBuilder objData)
{
foreach (var itf in _type.RuntimeInterfaces)
{
// Interface omitted for canonical instantiations (constructed at runtime for dynamic types from the native layout info)
objData.EmitZeroPointer();
}
}
protected override int BaseSize
{
get
{
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal) && _type.IsDefType)
{
LayoutInt instanceByteCount = ((DefType)_type).InstanceByteCount;
if (instanceByteCount.IsIndeterminate)
{
// For USG types, they may be of indeterminate size, and the size of the type may be meaningless.
// In that case emit a fixed constant.
return MinimumObjectSize;
}
}
return base.BaseSize;
}
}
protected override void ComputeValueTypeFieldPadding()
{
DefType defType = _type as DefType;
// Types of indeterminate sizes don't have computed ValueTypeFieldPadding
if (defType != null && defType.InstanceByteCount.IsIndeterminate)
{
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Universal));
return;
}
base.ComputeValueTypeFieldPadding();
}
public override int ClassCode => -1798018602;
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Internal.TypeSystem;
using Internal.Runtime;
namespace ILCompiler.DependencyAnalysis
{
/// <summary>
/// Canonical type instantiations are emitted, not because they are used directly by the user code, but because
/// they are used by the dynamic type loader when dynamically instantiating types at runtime.
/// The data that we emit on canonical type instantiations should just be the minimum that is needed by the template
/// type loader.
/// Similarly, the dependencies that we track for canonical type instantiations are minimal, and are just the ones used
/// by the dynamic type loader
/// </summary>
public sealed class CanonicalEETypeNode : EETypeNode
{
public CanonicalEETypeNode(NodeFactory factory, TypeDesc type) : base(factory, type)
{
Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any));
Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any));
Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific));
Debug.Assert(!type.IsMdArray || factory.Target.Abi == TargetAbi.CppCodegen);
}
public override bool StaticDependenciesAreComputed => true;
public override bool IsShareable => IsTypeNodeShareable(_type);
protected override bool EmitVirtualSlotsAndInterfaces => true;
public override bool ShouldSkipEmittingObjectNode(NodeFactory factory) => false;
protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencyList = base.ComputeNonRelocationBasedDependencies(factory);
// Ensure that we track the necessary type symbol if we are working with a constructed type symbol.
// The emitter will ensure we don't emit both, but this allows us assert that we only generate
// relocs to nodes we emit.
dependencyList.Add(factory.NecessaryTypeSymbol(_type), "Necessary type symbol related to CanonicalEETypeNode");
DefType closestDefType = _type.GetClosestDefType();
if (MightHaveInterfaceDispatchMap(factory))
dependencyList.Add(factory.InterfaceDispatchMap(_type), "Canonical interface dispatch map");
dependencyList.Add(factory.VTable(closestDefType), "VTable");
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
dependencyList.Add(factory.NativeLayout.TemplateTypeLayout(_type), "Universal generic types always have template layout");
// Track generic virtual methods that will get added to the GVM tables
if (TypeGVMEntriesNode.TypeNeedsGVMTableEntries(_type))
{
dependencyList.Add(new DependencyListEntry(factory.TypeGVMEntries(_type.GetTypeDefinition()), "Type with generic virtual methods"));
AddDependenciesForUniversalGVMSupport(factory, _type, ref dependencyList);
}
// Keep track of the default constructor map dependency for this type if it has a default constructor
MethodDesc defaultCtor = closestDefType.GetDefaultConstructor();
if (defaultCtor != null)
{
dependencyList.Add(new DependencyListEntry(
factory.CanonicalEntrypoint(defaultCtor),
"DefaultConstructorNode"));
}
return dependencyList;
}
protected override ISymbolNode GetBaseTypeNode(NodeFactory factory)
{
return _type.BaseType != null ? factory.NecessaryTypeSymbol(_type.BaseType.NormalizeInstantiation()) : null;
}
protected override int GCDescSize
{
get
{
// No GCDescs for universal canonical types
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
return 0;
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Specific));
return GCDescEncoder.GetGCDescSize(_type);
}
}
protected override void OutputGCDesc(ref ObjectDataBuilder builder)
{
// No GCDescs for universal canonical types
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal))
return;
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Specific));
GCDescEncoder.EncodeGCDesc(ref builder, _type);
}
protected override void OutputInterfaceMap(NodeFactory factory, ref ObjectDataBuilder objData)
{
foreach (var itf in _type.RuntimeInterfaces)
{
// Interface omitted for canonical instantiations (constructed at runtime for dynamic types from the native layout info)
objData.EmitZeroPointer();
}
}
protected override int BaseSize
{
get
{
if (_type.IsCanonicalSubtype(CanonicalFormKind.Universal) && _type.IsDefType)
{
LayoutInt instanceByteCount = ((DefType)_type).InstanceByteCount;
if (instanceByteCount.IsIndeterminate)
{
// For USG types, they may be of indeterminate size, and the size of the type may be meaningless.
// In that case emit a fixed constant.
return MinimumObjectSize;
}
}
return base.BaseSize;
}
}
protected override void ComputeValueTypeFieldPadding()
{
DefType defType = _type as DefType;
// Types of indeterminate sizes don't have computed ValueTypeFieldPadding
if (defType != null && defType.InstanceByteCount.IsIndeterminate)
{
Debug.Assert(_type.IsCanonicalSubtype(CanonicalFormKind.Universal));
return;
}
base.ComputeValueTypeFieldPadding();
}
public override int ClassCode => -1798018602;
}
}
| -1 |
dotnet/runtime | 66,179 | Use RegexGenerator in applicable tests | Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | Clockwork-Muse | 2022-03-04T03:46:20Z | 2022-03-07T21:04:10Z | f5ebdf8d128a3b5eb5b9e2fc5a2d81b3cfeb8931 | 8d12bc107bc3a71630861f6a51631a2cfcd1504c | Use RegexGenerator in applicable tests. Use RegexGenerator where possible in tests.
Also added to `System.Private.DataContractSerialization` | ./src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1325/Generated1325.il | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 }
.assembly extern TestFramework { .publickeytoken = ( B0 3F 5F 7F 11 D5 0A 3A ) }
//TYPES IN FORWARDER ASSEMBLIES:
//TEST ASSEMBLY:
.assembly Generated1325 { .hash algorithm 0x00008004 }
.assembly extern xunit.core {}
.class public BaseClass0
{
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void [mscorlib]System.Object::.ctor()
ret
}
}
.class public BaseClass1
extends BaseClass0
{
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void BaseClass0::.ctor()
ret
}
}
.class public G3_C1797`1<T0>
extends class G2_C743`2<class BaseClass0,!T0>
implements class IBase2`2<!T0,class BaseClass0>
{
.method public hidebysig virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G3_C1797::Method7.18061<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod4990() cil managed noinlining {
ldstr "G3_C1797::ClassMethod4990.18062()"
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void class G2_C743`2<class BaseClass0,!T0>::.ctor()
ret
}
}
.class public G2_C743`2<T0, T1>
extends class G1_C14`2<class BaseClass0,class BaseClass1>
implements class IBase2`2<class BaseClass0,class BaseClass0>, IBase0
{
.method public hidebysig newslot virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G2_C743::Method7.11876<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string Method0() cil managed noinlining {
ldstr "G2_C743::Method0.11877()"
ret
}
.method public hidebysig virtual instance string Method1() cil managed noinlining {
ldstr "G2_C743::Method1.11878()"
ret
}
.method public hidebysig virtual instance string Method2<M0>() cil managed noinlining {
ldstr "G2_C743::Method2.11879<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string 'IBase0.Method2'<M0>() cil managed noinlining {
.override method instance string IBase0::Method2<[1]>()
ldstr "G2_C743::Method2.MI.11880<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig virtual instance string Method3<M0>() cil managed noinlining {
ldstr "G2_C743::Method3.11881<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
ret
}
}
.class interface public abstract IBase2`2<+T0, -T1>
{
.method public hidebysig newslot abstract virtual instance string Method7<M0>() cil managed { }
}
.class public G1_C14`2<T0, T1>
implements class IBase2`2<!T1,class BaseClass1>, class IBase1`1<class BaseClass1>
{
.method public hidebysig virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G1_C14::Method7.4878<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string Method4() cil managed noinlining {
ldstr "G1_C14::Method4.4879()"
ret
}
.method public hidebysig newslot virtual instance string Method5() cil managed noinlining {
ldstr "G1_C14::Method5.4880()"
ret
}
.method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method5'() cil managed noinlining {
.override method instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ret
}
.method public hidebysig virtual instance string Method6<M0>() cil managed noinlining {
ldstr "G1_C14::Method6.4882<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod1350<M0>() cil managed noinlining {
ldstr "G1_C14::ClassMethod1350.4883<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod1351<M0>() cil managed noinlining {
ldstr "G1_C14::ClassMethod1351.4884<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void [mscorlib]System.Object::.ctor()
ret
}
}
.class interface public abstract IBase0
{
.method public hidebysig newslot abstract virtual instance string Method0() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method1() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method2<M0>() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method3<M0>() cil managed { }
}
.class interface public abstract IBase1`1<+T0>
{
.method public hidebysig newslot abstract virtual instance string Method4() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method5() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method6<M0>() cil managed { }
}
.class public auto ansi beforefieldinit Generated1325 {
.method static void M.BaseClass0<(BaseClass0)W>(!!W inst, string exp) cil managed {
.maxstack 5
.locals init (string[] actualResults)
ldc.i4.s 0
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.BaseClass0<(BaseClass0)W>(!!W inst, string exp)"
ldc.i4.s 0
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.BaseClass1<(BaseClass1)W>(!!W inst, string exp) cil managed {
.maxstack 5
.locals init (string[] actualResults)
ldc.i4.s 0
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.BaseClass1<(BaseClass1)W>(!!W inst, string exp)"
ldc.i4.s 0
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.T<T0,(class G3_C1797`1<!!T0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.T<T0,(class G3_C1797`1<!!T0>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.A<(class G3_C1797`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.A<(class G3_C1797`1<class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.B<(class G3_C1797`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.B<(class G3_C1797`1<class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.T.T<T0,T1,(class G2_C743`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.T.T<T0,T1,(class G2_C743`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.T<T1,(class G2_C743`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.T<T1,(class G2_C743`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.A<(class G2_C743`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.A<(class G2_C743`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.B<(class G2_C743`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.B<(class G2_C743`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.T<T1,(class G2_C743`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.T<T1,(class G2_C743`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.A<(class G2_C743`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.A<(class G2_C743`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.B<(class G2_C743`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.B<(class G2_C743`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.T.T<T0,T1,(class G1_C14`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.T.T<T0,T1,(class G1_C14`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.T<T1,(class G1_C14`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.T<T1,(class G1_C14`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.A<(class G1_C14`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.A<(class G1_C14`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.B<(class G1_C14`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.B<(class G1_C14`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.T<T1,(class G1_C14`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.T<T1,(class G1_C14`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.A<(class G1_C14`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.A<(class G1_C14`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.B<(class G1_C14`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.B<(class G1_C14`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase0<(IBase0)W>(!!W inst, string exp) cil managed {
.maxstack 9
.locals init (string[] actualResults)
ldc.i4.s 4
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase0<(IBase0)W>(!!W inst, string exp)"
ldc.i4.s 4
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method3<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method public hidebysig static void MethodCallingTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Method Calling Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void ConstrainedCallsTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Constrained Calls Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass1,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.A<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass1,class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.A<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void StructConstrainedInterfaceCallsTest() cil managed
{
.maxstack 10
ldstr "===================== Struct Constrained Interface Calls Test ====================="
call void [mscorlib]System.Console::WriteLine(string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void CalliTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Method Calli Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 10
call void Generated1325::MethodCallingTest()
call void Generated1325::ConstrainedCallsTest()
call void Generated1325::StructConstrainedInterfaceCallsTest()
call void Generated1325::CalliTest()
ldc.i4 100
ret
}
}
| // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 }
.assembly extern TestFramework { .publickeytoken = ( B0 3F 5F 7F 11 D5 0A 3A ) }
//TYPES IN FORWARDER ASSEMBLIES:
//TEST ASSEMBLY:
.assembly Generated1325 { .hash algorithm 0x00008004 }
.assembly extern xunit.core {}
.class public BaseClass0
{
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void [mscorlib]System.Object::.ctor()
ret
}
}
.class public BaseClass1
extends BaseClass0
{
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void BaseClass0::.ctor()
ret
}
}
.class public G3_C1797`1<T0>
extends class G2_C743`2<class BaseClass0,!T0>
implements class IBase2`2<!T0,class BaseClass0>
{
.method public hidebysig virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G3_C1797::Method7.18061<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod4990() cil managed noinlining {
ldstr "G3_C1797::ClassMethod4990.18062()"
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void class G2_C743`2<class BaseClass0,!T0>::.ctor()
ret
}
}
.class public G2_C743`2<T0, T1>
extends class G1_C14`2<class BaseClass0,class BaseClass1>
implements class IBase2`2<class BaseClass0,class BaseClass0>, IBase0
{
.method public hidebysig newslot virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G2_C743::Method7.11876<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string Method0() cil managed noinlining {
ldstr "G2_C743::Method0.11877()"
ret
}
.method public hidebysig virtual instance string Method1() cil managed noinlining {
ldstr "G2_C743::Method1.11878()"
ret
}
.method public hidebysig virtual instance string Method2<M0>() cil managed noinlining {
ldstr "G2_C743::Method2.11879<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string 'IBase0.Method2'<M0>() cil managed noinlining {
.override method instance string IBase0::Method2<[1]>()
ldstr "G2_C743::Method2.MI.11880<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig virtual instance string Method3<M0>() cil managed noinlining {
ldstr "G2_C743::Method3.11881<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
ret
}
}
.class interface public abstract IBase2`2<+T0, -T1>
{
.method public hidebysig newslot abstract virtual instance string Method7<M0>() cil managed { }
}
.class public G1_C14`2<T0, T1>
implements class IBase2`2<!T1,class BaseClass1>, class IBase1`1<class BaseClass1>
{
.method public hidebysig virtual instance string Method7<M0>() cil managed noinlining {
ldstr "G1_C14::Method7.4878<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string Method4() cil managed noinlining {
ldstr "G1_C14::Method4.4879()"
ret
}
.method public hidebysig newslot virtual instance string Method5() cil managed noinlining {
ldstr "G1_C14::Method5.4880()"
ret
}
.method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method5'() cil managed noinlining {
.override method instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ret
}
.method public hidebysig virtual instance string Method6<M0>() cil managed noinlining {
ldstr "G1_C14::Method6.4882<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod1350<M0>() cil managed noinlining {
ldstr "G1_C14::ClassMethod1350.4883<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig newslot virtual instance string ClassMethod1351<M0>() cil managed noinlining {
ldstr "G1_C14::ClassMethod1351.4884<"
ldtoken !!M0
call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
call string [mscorlib]System.String::Concat(object,object)
ldstr ">()"
call string [mscorlib]System.String::Concat(object,object)
ret
}
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {
ldarg.0
call instance void [mscorlib]System.Object::.ctor()
ret
}
}
.class interface public abstract IBase0
{
.method public hidebysig newslot abstract virtual instance string Method0() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method1() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method2<M0>() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method3<M0>() cil managed { }
}
.class interface public abstract IBase1`1<+T0>
{
.method public hidebysig newslot abstract virtual instance string Method4() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method5() cil managed { }
.method public hidebysig newslot abstract virtual instance string Method6<M0>() cil managed { }
}
.class public auto ansi beforefieldinit Generated1325 {
.method static void M.BaseClass0<(BaseClass0)W>(!!W inst, string exp) cil managed {
.maxstack 5
.locals init (string[] actualResults)
ldc.i4.s 0
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.BaseClass0<(BaseClass0)W>(!!W inst, string exp)"
ldc.i4.s 0
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.BaseClass1<(BaseClass1)W>(!!W inst, string exp) cil managed {
.maxstack 5
.locals init (string[] actualResults)
ldc.i4.s 0
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.BaseClass1<(BaseClass1)W>(!!W inst, string exp)"
ldc.i4.s 0
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.T<T0,(class G3_C1797`1<!!T0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.T<T0,(class G3_C1797`1<!!T0>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<!!T0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.A<(class G3_C1797`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.A<(class G3_C1797`1<class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G3_C1797.B<(class G3_C1797`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 16
.locals init (string[] actualResults)
ldc.i4.s 11
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G3_C1797.B<(class G3_C1797`1<class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 11
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 10
ldarga.s 0
constrained. !!W
callvirt instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.T.T<T0,T1,(class G2_C743`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.T.T<T0,T1,(class G2_C743`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.T<T1,(class G2_C743`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.T<T1,(class G2_C743`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.A<(class G2_C743`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.A<(class G2_C743`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.A.B<(class G2_C743`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.A.B<(class G2_C743`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.T<T1,(class G2_C743`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.T<T1,(class G2_C743`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.A<(class G2_C743`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.A<(class G2_C743`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G2_C743.B.B<(class G2_C743`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 15
.locals init (string[] actualResults)
ldc.i4.s 10
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G2_C743.B.B<(class G2_C743`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 10
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 6
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 7
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 8
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 9
ldarga.s 0
constrained. !!W
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 6
.locals init (string[] actualResults)
ldc.i4.s 1
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 1
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.T.T<T0,T1,(class G1_C14`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.T.T<T0,T1,(class G1_C14`2<!!T0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<!!T0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.T<T1,(class G1_C14`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.T<T1,(class G1_C14`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.A<(class G1_C14`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.A<(class G1_C14`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.A.B<(class G1_C14`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.A.B<(class G1_C14`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.T<T1,(class G1_C14`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.T<T1,(class G1_C14`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,!!T1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.A<(class G1_C14`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.A<(class G1_C14`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.G1_C14.B.B<(class G1_C14`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 11
.locals init (string[] actualResults)
ldc.i4.s 6
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.G1_C14.B.B<(class G1_C14`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 6
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 4
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 5
ldarga.s 0
constrained. !!W
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase0<(IBase0)W>(!!W inst, string exp) cil managed {
.maxstack 9
.locals init (string[] actualResults)
ldc.i4.s 4
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase0<(IBase0)W>(!!W inst, string exp)"
ldc.i4.s 4
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method0()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method1()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method2<object>()
stelem.ref
ldloc.s actualResults
ldc.i4.s 3
ldarga.s 0
constrained. !!W
callvirt instance string IBase0::Method3<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<!!T0>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method static void M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed {
.maxstack 8
.locals init (string[] actualResults)
ldc.i4.s 3
newarr string
stloc.s actualResults
ldarg.1
ldstr "M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp)"
ldc.i4.s 3
ldloc.s actualResults
ldc.i4.s 0
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
stelem.ref
ldloc.s actualResults
ldc.i4.s 1
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
stelem.ref
ldloc.s actualResults
ldc.i4.s 2
ldarga.s 0
constrained. !!W
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
stelem.ref
ldloc.s actualResults
call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[])
ret
}
.method public hidebysig static void MethodCallingTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Method Calling Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass0>
callvirt instance string class G3_C1797`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G3_C1797`1<class BaseClass1>
callvirt instance string class G3_C1797`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
callvirt instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string IBase0::Method0()
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method1()
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method2<object>()
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string IBase0::Method3<object>()
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
callvirt instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldloc.0
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method4()
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method5()
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
dup
callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>()
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
pop
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void ConstrainedCallsTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Constrained Calls Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G3_C1797`1<class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.T<class BaseClass0,class G3_C1797`1<class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.A<class G3_C1797`1<class BaseClass0>>(!!0,string)
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G2_C743.A.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.T<class BaseClass1,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G3_C1797::ClassMethod4990.18062()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.G3_C1797.B<class G3_C1797`1<class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass0,class G3_C1797`1<class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G3_C1797::Method7.18061<System.Object>()#"
call void Generated1325::M.IBase2.B.A<class G3_C1797`1<class BaseClass1>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass0,class BaseClass0>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.T<class BaseClass1,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.A.B<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass0,class BaseClass1>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass1,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass1,class BaseClass0>>(!!0,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.T.T<class BaseClass1,class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.T<class BaseClass1,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.11879<System.Object>()#G2_C743::Method3.11881<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.G2_C743.B.B<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass0,class G2_C743`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G2_C743::Method7.11876<System.Object>()#"
call void Generated1325::M.IBase2.A.A<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G2_C743::Method0.11877()#G2_C743::Method1.11878()#G2_C743::Method2.MI.11880<System.Object>()#G2_C743::Method3.11881<System.Object>()#"
call void Generated1325::M.IBase0<class G2_C743`2<class BaseClass1,class BaseClass1>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.A<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass0,class BaseClass0>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.A.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass0,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass0,class BaseClass1>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass1,class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.A<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass0>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass1,class BaseClass0>>(!!0,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()#G1_C14::ClassMethod1351.4884<System.Object>()#G1_C14::Method4.4879()#G1_C14::Method5.4880()#G1_C14::Method6.4882<System.Object>()#G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.G1_C14.B.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.B.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!2,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.T<class BaseClass1,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method7.4878<System.Object>()#"
call void Generated1325::M.IBase2.A.B<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.T<class BaseClass0,class G1_C14`2<class BaseClass1,class BaseClass1>>(!!1,string)
ldloc.0
ldstr "G1_C14::Method4.4879()#G1_C14::Method5.MI.4881()#G1_C14::Method6.4882<System.Object>()#"
call void Generated1325::M.IBase1.A<class G1_C14`2<class BaseClass1,class BaseClass1>>(!!0,string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void StructConstrainedInterfaceCallsTest() cil managed
{
.maxstack 10
ldstr "===================== Struct Constrained Interface Calls Test ====================="
call void [mscorlib]System.Console::WriteLine(string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static void CalliTest() cil managed
{
.maxstack 10
.locals init (object V_0)
ldstr "========================== Method Calli Test =========================="
call void [mscorlib]System.Console::WriteLine(string)
newobj instance void class G3_C1797`1<class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod4990()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method1()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method0()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass0>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass0> on type class G3_C1797`1<class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G3_C1797`1<class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod4990()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::ClassMethod4990.18062()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method3<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method2<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method1()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method0()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod1351<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::ClassMethod1350<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method6<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method5()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G3_C1797`1<class BaseClass1>
ldloc.0
ldvirtftn instance string class G3_C1797`1<class BaseClass1>::Method4()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G3_C1797`1<class BaseClass1> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G3_C1797`1<class BaseClass1>)
ldstr "G3_C1797::Method7.18061<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1797`1<class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass0,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass0>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G2_C743`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method2.11879<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method6<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method5()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G2_C743`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G2_C743`2<class BaseClass1,class BaseClass1>::Method4()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G2_C743`2<class BaseClass1,class BaseClass1> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method7.11876<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method0()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method0.11877()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method1()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method1.11878()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method2<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method2.MI.11880<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string IBase0::Method3<object>()
calli default string(class G2_C743`2<class BaseClass1,class BaseClass1>)
ldstr "G2_C743::Method3.11881<System.Object>()"
ldstr "IBase0 on type class G2_C743`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass0>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass0,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass0,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass0,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass0,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass0>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass0>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass0>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass0>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass0>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
newobj instance void class G1_C14`2<class BaseClass1,class BaseClass1>::.ctor()
stloc.0
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1351<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1351.4884<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::ClassMethod1350<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::ClassMethod1350.4883<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.4880()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
castclass class G1_C14`2<class BaseClass1,class BaseClass1>
ldloc.0
ldvirtftn instance string class G1_C14`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class G1_C14`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method7.4878<System.Object>()"
ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method4.4879()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method5.MI.4881()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldloc.0
ldloc.0
ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>()
calli default string(class G1_C14`2<class BaseClass1,class BaseClass1>)
ldstr "G1_C14::Method6.4882<System.Object>()"
ldstr "class IBase1`1<class BaseClass0> on type class G1_C14`2<class BaseClass1,class BaseClass1>"
call void [TestFramework]TestFramework::MethodCallTest(string,string,string)
ldstr "========================================================================\n\n"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig static int32 Main() cil managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 10
call void Generated1325::MethodCallingTest()
call void Generated1325::ConstrainedCallsTest()
call void Generated1325::StructConstrainedInterfaceCallsTest()
call void Generated1325::CalliTest()
ldc.i4 100
ret
}
}
| -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.