From e380f2c2751ec539a1acd4cf0c027ab62d845328 Mon Sep 17 00:00:00 2001 From: Kyungwoo Lee Date: Fri, 1 Jan 2016 06:25:29 -0800 Subject: Enable ilasm round trip test for xPlatforms 1. Enable CLRTest.Execute.Bash.targets similar to CLRTest.Execute.Batch.targets. 2. _IlasmSwitches uses '-' instead of '/' 3. Disable optimization on the prebuilt asmparse.c due to https://github.com/dotnet/coreclr/issues/2305 --- src/ilasm/CMakeLists.txt | 2 ++ tests/src/CLRTest.Execute.Bash.targets | 64 ++++++++++++++++++++++++++++------ tests/src/IL.targets | 14 ++++---- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/ilasm/CMakeLists.txt b/src/ilasm/CMakeLists.txt index eb84533770..bd7934965f 100644 --- a/src/ilasm/CMakeLists.txt +++ b/src/ilasm/CMakeLists.txt @@ -25,11 +25,13 @@ set_source_files_properties( prebuilt/asmparse.c PROPERTIES LANGUAGE CXX ) if(CLR_CMAKE_PLATFORM_UNIX) add_compile_options(-x c++) # Need generate a right form of asmparse.c to avoid the following options. + # Clang also produces a bad-codegen on this prebuilt file with optimization. # https://github.com/dotnet/coreclr/issues/2305 add_compile_options(-Wno-delete-non-virtual-dtor) add_compile_options(-Wno-deprecated-register) add_compile_options(-Wno-array-bounds) add_compile_options(-Wno-unused-label) + set_source_files_properties( prebuilt/asmparse.c PROPERTIES COMPILE_FLAGS -O0 ) endif(CLR_CMAKE_PLATFORM_UNIX) add_executable(ilasm 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 + + + $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/")) + $(MSBuildProjectName).exe + $(MSBuildProjectName).dasm.il + $(MSBuildProjectName).asm.exe + + false + + + + + + + @@ -95,7 +130,7 @@ fi + DependsOnTargets="FetchExternalProperties;GetCrossgenBashScript;GetIlasmRoundTripBashScript"> @@ -148,15 +183,22 @@ fi - <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'true'">$(_CLRTestToRunFileFullPath) - <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND $(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/")) - - <_CLRTestRunFile Condition="'$(_CLRTestNeedsProjectToRun)' == 'false'">"$(MSBuildProjectName).exe" - <_CLRTestRunFile Condition=" '$(CLRTestIsHosted)'=='true' AND !$(_CLRTestNeedsProjectToRun) ">"$CORE_ROOT/corerun" $(_CLRTestRunFile) + <_CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun" + - @@ -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" /> - \ No newline at end of file + 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 @@ <_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">/DLL <_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">/EXE - <_IlasmSwitches>/QUIET /NOLOGO - <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) /FOLD - <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) /STACK=$(SizeOfStackReserve) - <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) /DEBUG - <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) /DEBUG=IMPL - <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) /DEBUG=OPT - <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) /OPTIMIZE + <_IlasmSwitches>-QUIET -NOLOGO + <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD + <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve) + <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG + <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL + <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT + <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE -- cgit v1.2.3