diff options
author | Richard L Ford <richford@microsoft.com> | 2016-02-16 15:13:32 -0800 |
---|---|---|
committer | Richard L Ford <richford@microsoft.com> | 2016-02-17 20:09:37 -0800 |
commit | 30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2 (patch) | |
tree | e3bff4112025ef94efd4ad1e108f863defc7e873 /tests/src/JIT/Generics | |
parent | 89396ee16657a2884babe8ac5d0e688743d4cd83 (diff) | |
download | coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.tar.gz coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.tar.bz2 coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.zip |
Port desktop tests that had references
This change ports desktop tests that had references to dlls.
It also fixes some of the dll project files.
In addition there are some additional tests that were not
previously ported (but that do not reference dlls).
There are 4 tests that are excluded because of issue #3216.
Diffstat (limited to 'tests/src/JIT/Generics')
-rw-r--r-- | tests/src/JIT/Generics/Fields/getclassfrommethodparam.cs | 54 | ||||
-rw-r--r-- | tests/src/JIT/Generics/Fields/getclassfrommethodparam.csproj | 52 |
2 files changed, 106 insertions, 0 deletions
diff --git a/tests/src/JIT/Generics/Fields/getclassfrommethodparam.cs b/tests/src/JIT/Generics/Fields/getclassfrommethodparam.cs new file mode 100644 index 0000000000..8f682b77c6 --- /dev/null +++ b/tests/src/JIT/Generics/Fields/getclassfrommethodparam.cs @@ -0,0 +1,54 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.CompilerServices; + +namespace Sandbox3 +{ + public class Foo<F> + { + public static string Value; + + // [MethodImpl(MethodImplOptions.Synchronized | MethodImplOptions.NoInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void Action<T>(T value) + { + Value = value.ToString(); + } + } + + public class Dummy { } + + internal class Program + { + private static int Main(string[] args) + { + string s = "hello"; + + Foo<object>.Action<string>(s); + if (Foo<object>.Value != s) + throw new Exception(); + + int i = 10; + Foo<Dummy>.Action<int>(i); + if (Foo<object>.Value != s) + throw new Exception(); + if (Foo<Dummy>.Value != i.ToString()) + throw new Exception(); + + object o = new object(); + Foo<int>.Action<object>(o); + if (Foo<int>.Value != o.ToString()) + throw new Exception(); + if (Foo<object>.Value != s) + throw new Exception(); + if (Foo<Dummy>.Value != i.ToString()) + throw new Exception(); + + Console.WriteLine("Test SUCCESS"); + return 100; + } + } +} diff --git a/tests/src/JIT/Generics/Fields/getclassfrommethodparam.csproj b/tests/src/JIT/Generics/Fields/getclassfrommethodparam.csproj new file mode 100644 index 0000000000..2f23553fce --- /dev/null +++ b/tests/src/JIT/Generics/Fields/getclassfrommethodparam.csproj @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <AssemblyName>$(MSBuildProjectName)</AssemblyName> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + <RestorePackages>true</RestorePackages> + <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + </PropertyGroup> + <!-- Default configurations to help VS understand the configurations --> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + </PropertyGroup> + <ItemGroup> + <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> + <Visible>False</Visible> + </CodeAnalysisDependentAssemblyPaths> + </ItemGroup> + <PropertyGroup> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType>PdbOnly</DebugType> + <NoLogo>True</NoLogo> + <DefineConstants>$(DefineConstants);DESKTOP</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="getclassfrommethodparam.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson> + </PropertyGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> |