summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-01-03 16:10:41 -0800
committerJan Kotas <jkotas@microsoft.com>2016-01-03 16:10:41 -0800
commit8c7e7db8ca4f231b4b82c2c06990520efd2e7ee1 (patch)
treede82e1e142cc4d93bc4bc9d095ee2c1ca4fc29ea /tests
parenta9dc13887582351bcb2796b1be0c6a23ced07642 (diff)
parente380f2c2751ec539a1acd4cf0c027ab62d845328 (diff)
downloadcoreclr-8c7e7db8ca4f231b4b82c2c06990520efd2e7ee1.tar.gz
coreclr-8c7e7db8ca4f231b4b82c2c06990520efd2e7ee1.tar.bz2
coreclr-8c7e7db8ca4f231b4b82c2c06990520efd2e7ee1.zip
Merge pull request #2496 from kyulee1/round2
Enable ilasm round trip test for xPlatforms
Diffstat (limited to 'tests')
-rw-r--r--tests/src/CLRTest.Execute.Bash.targets64
-rw-r--r--tests/src/IL.targets14
2 files changed, 61 insertions, 17 deletions
diff --git a/tests/src/CLRTest.Execute.Bash.targets b/tests/src/CLRTest.Execute.Bash.targets
index f0543f714a..042aa8b7da 100644
--- a/tests/src/CLRTest.Execute.Bash.targets
+++ b/tests/src/CLRTest.Execute.Bash.targets
@@ -52,6 +52,41 @@ fi
</PropertyGroup>
</Target>
+ <Target
+ Name="GetIlasmRoundTripBashScript"
+ Returns="$(IlasmRoundTripBashScript)">
+ <PropertyGroup>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'RunOnly'">$([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</InputAssemblyName>
+ <InputAssemblyName Condition="'$(CLRTestKind)' == 'BuildAndRun'">$(MSBuildProjectName).exe</InputAssemblyName>
+ <DisassemblyName>$(MSBuildProjectName).dasm.il</DisassemblyName>
+ <TargetAssemblyName>$(MSBuildProjectName).asm.exe</TargetAssemblyName>
+
+ <IlasmRoundTrip Condition="'$(ReferenceLocalMscorlib)'!=''">false</IlasmRoundTrip>
+
+ <IlasmRoundTripBashScript Condition="'$(IlasmRoundTrip)'=='true'">
+ <![CDATA[
+echo "$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+"$CORE_ROOT/ildasm" -raweh -out=$(DisassemblyName) $(InputAssemblyName)
+_ERRORLEVEL=$?
+if [ ! $ERRORLEVEL == 0 ]
+then
+ echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL
+ exit 1
+fi
+
+echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+"$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName)
+_ERRORLEVEL=$?
+if [ ! $ERRORLEVEL == 0 ]
+then
+ echo EXECUTION OF ILASM - FAILED $ERRORLEVEL
+ exit 1
+fi
+ ]]>
+ </IlasmRoundTripBashScript>
+ </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 -->
@@ -95,7 +130,7 @@ fi
<Target Name="GenerateBashExecutionScript"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(OutputPath)\$(MSBuildProjectName).sh"
- DependsOnTargets="FetchExternalProperties;GetCrossgenBashScript">
+ DependsOnTargets="FetchExternalProperties;GetCrossgenBashScript;GetIlasmRoundTripBashScript">
<Message Text="Project depends on $(_CLRTestToRunFileFullPath)." Condition="'$(_CLRTestNeedsProjectToRun)' == 'True'" />
@@ -148,15 +183,22 @@ fi
</ItemGroup>
<PropertyGroup>
- <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'true'">$(_CLRTestToRunFileFullPath)</_CLRTestRunFile>
- <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND $(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/"))</_CLRTestRunFile>
-
- <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'false'">"$(MSBuildProjectName).exe"</_CLRTestRunFile>
- <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND !$(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $(_CLRTestRunFile)</_CLRTestRunFile>
+ <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun"</_CLRTestRunFile>
+ <BashCLRTestLaunchCmds Condition="'$(IlasmRoundTrip)'=='true'"><![CDATA[
+echo $(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments $Host_Args
+$(_CLRTestRunFile) $(TargetAssemblyName) $CLRTestExecutionArguments $Host_Args
+if [ ! $? == $CLRTestExpectedExitCode ]
+then
+ echo END EXECUTION OF IL{D}ASM BINARY - FAILED $? vs $CLRTestExpectedExitCode
+ echo FAILED
+ exit 1
+fi
+ ]]></BashCLRTestLaunchCmds>
- <BashCLRTestLaunchCmds Condition=" '$(BashCLRTestLaunchCmds)'=='' "><![CDATA[
-echo $(_CLRTestRunFile) $CLRTestExecutionArguments $Host_Args
-$_DebuggerFullPath $(_CLRTestRunFile) $CLRTestExecutionArguments $Host_Args
+ <BashCLRTestLaunchCmds><![CDATA[
+$(BashCLRTestLaunchCmds)
+echo $_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments $Host_Args
+$_DebuggerFullPath $(_CLRTestRunFile) $(InputAssemblyName) $CLRTestExecutionArguments $Host_Args
CLRTestExitCode=$?
]]></BashCLRTestLaunchCmds>
</PropertyGroup>
@@ -232,6 +274,8 @@ $(BashCLRTestArgPrep)
$(BashCLRTestExitCodePrep)
# CrossGen Script (when /p:CrossGen=true)
$(CrossgenBashScript)
+# IlasmRoundTrip Script
+$(IlasmRoundTripBashScript)
# PreCommands
$(_BashCLRTestPreCommands)
# Launch
@@ -255,4 +299,4 @@ $(BashCLRTestExitCodeCheck)
Overwrite="true" />
</Target>
-</Project> \ No newline at end of file
+</Project>
diff --git a/tests/src/IL.targets b/tests/src/IL.targets
index e85d9695d8..e2be21742d 100644
--- a/tests/src/IL.targets
+++ b/tests/src/IL.targets
@@ -13,13 +13,13 @@
<PropertyGroup>
<_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">/DLL</_OutputTypeArgument>
<_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">/EXE</_OutputTypeArgument>
- <_IlasmSwitches>/QUIET /NOLOGO</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) /FOLD</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) /STACK=$(SizeOfStackReserve)</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) /DEBUG</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) /DEBUG=IMPL</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) /DEBUG=OPT</_IlasmSwitches>
- <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) /OPTIMIZE</_IlasmSwitches>
+ <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve)</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT</_IlasmSwitches>
+ <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE</_IlasmSwitches>
</PropertyGroup>
<Exec Command="$(__BinDir)\ilasm $(_OutputTypeArgument) /OUTPUT=@(IntermediateAssembly) $(_IlasmSwitches) @(Compile)">