diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-31 11:55:33 -0800 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-31 11:55:33 -0800 |
commit | f4c27343fbf4171e2703bb46cc24ad7aa1cc1c05 (patch) | |
tree | 8493607f2c5811953d065e2c06259c8ecfcfc417 | |
parent | 74edfc3a21051c6334428cbd0feda8b5622ff6aa (diff) | |
parent | e7a7d25ee7606aef57579b19f1fc4727e6443f49 (diff) | |
download | coreclr-f4c27343fbf4171e2703bb46cc24ad7aa1cc1c05.tar.gz coreclr-f4c27343fbf4171e2703bb46cc24ad7aa1cc1c05.tar.bz2 coreclr-f4c27343fbf4171e2703bb46cc24ad7aa1cc1c05.zip |
Merge pull request #2487 from kyulee1/round
Enable ildasm/ilasm round trip testing
-rw-r--r-- | tests/buildtest.cmd | 3 | ||||
-rw-r--r-- | tests/src/CLRTest.Execute.Batch.targets | 80 | ||||
-rw-r--r-- | tests/src/IL.targets | 1 | ||||
-rw-r--r-- | tests/src/JIT/BBT/Scenario4/Not-Int32.ilproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/CodeGenBringUpTests/Add1.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/Directed/array-il/_Arrayscomplex3.ilproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/Generics/Exceptions/general_class_instance01.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/IL_Conformance/Old/directed/heap_ovf.ilproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/Methodical/fp/apps/bouncingball_cs_d.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/SIMD/BitwiseOperations.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/jit64/eh/basics/loopEH.csproj | 1 | ||||
-rw-r--r-- | tests/src/JIT/opt/perf/doublealign/Locals.csproj | 1 |
14 files changed, 67 insertions, 28 deletions
diff --git a/tests/buildtest.cmd b/tests/buildtest.cmd index 0ce20a778b..5e434a81a4 100644 --- a/tests/buildtest.cmd +++ b/tests/buildtest.cmd @@ -33,6 +33,7 @@ if /i "%1" == "vs2013" (set __VSVersion=%1&shift&goto Arg_Loop) if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop) if /i "%1" == "crossgen" (set _crossgen=true&shift&goto Arg_Loop) +if /i "%1" == "ilasmroundtrip" (set _ilasmroundtrip=true&shift&goto Arg_Loop) if /i "%1" == "priority" (set _priorityvalue=%2&shift&shift&goto Arg_Loop) if /i "%1" == "verbose" (set _verbosity=detailed&shift&goto Arg_Loop) @@ -43,6 +44,7 @@ goto Usage :ArgsDone if defined _crossgen echo Building tests with CrossGen enabled.&set _buildParameters=%_buildParameters% /p:CrossGen=true +if defined _ilasmroundtrip echo Building tests with IlasmRoundTrip enabled.&set _buildParameters=%_buildParameters% /p:IlasmRoundTrip=true if defined _priorityvalue echo Building Test Priority %_priorityvalue%&set _buildParameters=%_buildParameters% /p:CLRTestPriorityToBuild=%_priorityvalue% if defined _verbosity echo Enabling verbose file logging if not defined _verbosity set _verbosity=normal @@ -221,5 +223,6 @@ echo Clean - optional argument to force a clean build. echo VSVersion - optional argument to use VS2013 or VS2015 (default VS2015) echo CrossGen - Enables the tests to run crossgen on the test executables before executing them. echo Priority (N) where N is a number greater than zero that signifies the set of tests that will be built and consequently run. +echo IlasmRoundTrip - Enables ilasm round trip build and run of the tests before executing them. echo Verbose - Enables detailed file logging for the msbuild tasks. exit /b 1 diff --git a/tests/src/CLRTest.Execute.Batch.targets b/tests/src/CLRTest.Execute.Batch.targets index f8c27be279..67805cc120 100644 --- a/tests/src/CLRTest.Execute.Batch.targets +++ b/tests/src/CLRTest.Execute.Batch.targets @@ -46,6 +46,38 @@ if not exist "$(MSBuildProjectName).ni.exe" "%CORE_ROOT%\crossgen.exe" /Platform </PropertyGroup> </Target> + <Target + Name="GetIlasmRoundTripBatchScript" + Returns="$(IlasmRoundTripBatchScript)"> + <PropertyGroup> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</InputAssemblyName> + <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName> + <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName> + <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName> + + <!-- If a test is built against mscorlib instead of dotnet Core, permission attributes can be embedded, which CoreCLR does not support. --> + <IlasmRoundTrip Condition="'$(ReferenceLocalMscorlib)'!=''">false</IlasmRoundTrip> + + <!-- https://github.com/dotnet/coreclr/issues/2481. Delete /raweh to ildasm once it is resolved.--> + <IlasmRoundTripBatchScript Condition="'$(IlasmRoundTrip)'=='true'"> + <![CDATA[ +ECHO %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName) +%CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName) +IF NOT "!ERRORLEVEL!"=="0" ( + ECHO EXECUTION OF ILDASM - FAILED !ERRORLEVEL! + Exit /b 1 +) +ECHO %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) +%CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) +IF NOT "!ERRORLEVEL!"=="0" ( + ECHO EXECUTION OF ILASM - FAILED !ERRORLEVEL! + Exit /b 1 +) + ]]> + </IlasmRoundTripBatchScript> + </PropertyGroup> + </Target> + <!-- This is here because of this bug: http://blogs.msdn.com/b/msbuild/archive/2006/01/03/508629.aspx--> <Target Name="FetchExternalProperties"> <!--Call GetExecuteShFullPath to get ToRunProject cmd file Path --> @@ -88,7 +120,7 @@ if not exist "$(MSBuildProjectName).ni.exe" "%CORE_ROOT%\crossgen.exe" /Platform <Target Name="GenerateBatchExecutionScript" Inputs="$(MSBuildProjectFullPath)" Outputs="$(OutputPath)\$(MSBuildProjectName).cmd" - DependsOnTargets="FetchExternalProperties;GetCrossgenBatchScript"> + DependsOnTargets="FetchExternalProperties;GetCrossgenBatchScript;GetIlasmRoundTripBatchScript"> <Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" /> @@ -154,7 +186,7 @@ IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" ( <BatchCLRTestExecutionScriptArgument Include="coreroot"> <HasParam>true</HasParam> - <ParamName>envScriptFullPath</ParamName> + <ParamName>CoreRootFullPath</ParamName> <Command><![CDATA[ set CORE_ROOT=%2 ]]></Command> @@ -168,33 +200,24 @@ IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" ( </ItemGroup> <PropertyGroup> - <_CLRTestExeFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'true'">$(_CLRTestToRunFileFullPath)</_CLRTestExeFile> - <_CLRTestExeFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'false'">$(MSBuildProjectName).exe</_CLRTestExeFile> - <_CLRTestExeFile Condition="'$(CLRTestIsHosted)'=='true' And '$(_CLRTestNeedsProjectToRun)'=='true'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)))</_CLRTestExeFile> - <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"%CORE_ROOT%\corerun.exe" "$(_CLRTestExeFile)"</_CLRTestRunFile> - <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='false'">"$(_CLRTestExeFile)"</_CLRTestRunFile> + <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"%CORE_ROOT%\corerun.exe"</_CLRTestRunFile> + <BatchCLRTestLaunchCmds Condition=" '$(IlasmRoundTrip)'=='true' "><![CDATA[ +ECHO $(_CLRTestRunFile) $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args% +$(_CLRTestRunFile) $(TargetAssemblyName) %CLRTestExecutionArguments% %Host_Args% - <BatchCLRTestLaunchCmds Condition=" '$(BatchCLRTestLaunchCmds)'=='' "><![CDATA[ -IF NOT "%CLRCustomTestLauncher%"=="" ( - goto :CustomLauncher -) ELSE ( - goto :DefaultLauncher +IF NOT "!ERRORLEVEL!"=="%CLRTestExpectedExitCode%" ( + ECHO END EXECUTION OF IL{D}ASM BINARY - FAILED !ERRORLEVEL! vs %CLRTestExpectedExitCode% + ECHO FAILED + Exit /b 1 ) - -:CustomLauncher - call %CLRCustomTestLauncher% %~dp0 $(_CLRTestExeFile) %CLRTestExecutionArguments% %Host_Args% - set CLRTestExitCode=%ERRORLEVEL% - goto :EndLauncher - -:DefaultLauncher - ECHO $(_CLRTestRunFile) %CLRTestExecutionArguments% %Host_Args% - %_DebuggerFullPath% $(_CLRTestRunFile) %CLRTestExecutionArguments% %Host_Args% - set CLRTestExitCode=%ERRORLEVEL% - -:EndLauncher - ]]></BatchCLRTestLaunchCmds> - </PropertyGroup> + <BatchCLRTestLaunchCmds><![CDATA[ +$(BatchCLRTestLaunchCmds) +ECHO %_DebuggerFullPath% $(_CLRTestRunFile) $(InputAssemblyName) %CLRTestExecutionArguments% %Host_Args% +%_DebuggerFullPath% $(_CLRTestRunFile) $(InputAssemblyName) %CLRTestExecutionArguments% %Host_Args% +set CLRTestExitCode=!ERRORLEVEL! + ]]></BatchCLRTestLaunchCmds> + </PropertyGroup> <PropertyGroup> <BatchEnvironmentVariables> @(CLRTestBatchEnvironmentVariable -> '%(Identity)', '%0d%0a') @@ -269,7 +292,7 @@ $(BatchCLRTestArgPrep) <_CLRTestExecutionScriptText> <![CDATA[ @ECHO OFF -setlocal +setlocal ENABLEDELAYEDEXPANSION pushd %~dp0 $(BatchCLRTestArgPrep) $(BatchCLRTestExitCodePrep) @@ -283,6 +306,9 @@ $(BatchEnvironmentVariables) REM CrossGen Script (when /p:CrossGen=true) $(CrossgenBatchScript) +REM IlasmRoundTrip Script +$(IlasmRoundTripBatchScript) + REM Precommands $(CLRTestBatchPreCommands) REM Launch diff --git a/tests/src/IL.targets b/tests/src/IL.targets index 35c52fd744..e85d9695d8 100644 --- a/tests/src/IL.targets +++ b/tests/src/IL.targets @@ -14,7 +14,6 @@ <_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">/DLL</_OutputTypeArgument> <_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">/EXE</_OutputTypeArgument> <_IlasmSwitches>/QUIET /NOLOGO</_IlasmSwitches> - <_IlasmSwitches Condition="'$(KeyOriginatorFile)' != ''">$(_IlasmSwitches) /KEY=$(KeyOriginatorFile)</_IlasmSwitches> <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) /FOLD</_IlasmSwitches> <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) /STACK=$(SizeOfStackReserve)</_IlasmSwitches> <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) /DEBUG</_IlasmSwitches> diff --git a/tests/src/JIT/BBT/Scenario4/Not-Int32.ilproj b/tests/src/JIT/BBT/Scenario4/Not-Int32.ilproj index 4ddb8bc690..eebe8b0222 100644 --- a/tests/src/JIT/BBT/Scenario4/Not-Int32.ilproj +++ b/tests/src/JIT/BBT/Scenario4/Not-Int32.ilproj @@ -14,6 +14,7 @@ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/CodeGenBringUpTests/Add1.csproj b/tests/src/JIT/CodeGenBringUpTests/Add1.csproj index 8427c290ec..88ee59d8bd 100644 --- a/tests/src/JIT/CodeGenBringUpTests/Add1.csproj +++ b/tests/src/JIT/CodeGenBringUpTests/Add1.csproj @@ -13,6 +13,7 @@ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/Directed/array-il/_Arrayscomplex3.ilproj b/tests/src/JIT/Directed/array-il/_Arrayscomplex3.ilproj index a85f4e238c..5d6d3c7019 100644 --- a/tests/src/JIT/Directed/array-il/_Arrayscomplex3.ilproj +++ b/tests/src/JIT/Directed/array-il/_Arrayscomplex3.ilproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <RestorePackages>true</RestorePackages> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/Generics/Exceptions/general_class_instance01.csproj b/tests/src/JIT/Generics/Exceptions/general_class_instance01.csproj index 3888e2d206..eb263f8c11 100644 --- a/tests/src/JIT/Generics/Exceptions/general_class_instance01.csproj +++ b/tests/src/JIT/Generics/Exceptions/general_class_instance01.csproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/IL_Conformance/Old/directed/heap_ovf.ilproj b/tests/src/JIT/IL_Conformance/Old/directed/heap_ovf.ilproj index afef3a71b4..e6af1f7954 100644 --- a/tests/src/JIT/IL_Conformance/Old/directed/heap_ovf.ilproj +++ b/tests/src/JIT/IL_Conformance/Old/directed/heap_ovf.ilproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <RestorePackages>true</RestorePackages> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/Methodical/fp/apps/bouncingball_cs_d.csproj b/tests/src/JIT/Methodical/fp/apps/bouncingball_cs_d.csproj index 380db83829..d707e581c2 100644 --- a/tests/src/JIT/Methodical/fp/apps/bouncingball_cs_d.csproj +++ b/tests/src/JIT/Methodical/fp/apps/bouncingball_cs_d.csproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj index e9f416df72..9263d7ebd5 100644 --- a/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj +++ b/tests/src/JIT/Performance/CodeQuality/BenchF/SqMtx/SqMtx.csproj @@ -13,6 +13,7 @@ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj index 54c1f9dcf1..f17ec7f1c7 100644 --- a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <RestorePackages>true</RestorePackages> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/SIMD/BitwiseOperations.csproj b/tests/src/JIT/SIMD/BitwiseOperations.csproj index 85e8868c6f..d9835c3364 100644 --- a/tests/src/JIT/SIMD/BitwiseOperations.csproj +++ b/tests/src/JIT/SIMD/BitwiseOperations.csproj @@ -13,6 +13,7 @@ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/jit64/eh/basics/loopEH.csproj b/tests/src/JIT/jit64/eh/basics/loopEH.csproj index 6ed553102c..93fd0cb181 100644 --- a/tests/src/JIT/jit64/eh/basics/loopEH.csproj +++ b/tests/src/JIT/jit64/eh/basics/loopEH.csproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <RestorePackages>true</RestorePackages> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> diff --git a/tests/src/JIT/opt/perf/doublealign/Locals.csproj b/tests/src/JIT/opt/perf/doublealign/Locals.csproj index 848d302af8..1141489365 100644 --- a/tests/src/JIT/opt/perf/doublealign/Locals.csproj +++ b/tests/src/JIT/opt/perf/doublealign/Locals.csproj @@ -15,6 +15,7 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <RestorePackages>true</RestorePackages> <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + <IlasmRoundTrip>true</IlasmRoundTrip> </PropertyGroup> <!-- Default configurations to help VS understand the configurations --> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |