From a7b9b01e804724a9f73d503544399a074be75da1 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 13:48:25 +0900 Subject: [PATCH 01/17] Added GitHub Actions script (WIP) --- .github/workflows/build-linux.yaml | 60 ++++++++++++++++++++++++++++ .github/workflows/build-windows.yaml | 60 ++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/build-linux.yaml create mode 100644 .github/workflows/build-windows.yaml diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml new file mode 100644 index 00000000..6a492ce6 --- /dev/null +++ b/.github/workflows/build-linux.yaml @@ -0,0 +1,60 @@ +name: Linux + +on: + push: + branches: + - master + - devel + pull_request: + branches: + - master + - devel + workflow_dispatch: + branches: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup .NET Core 2.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.1.811 + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.404 + - name: Setup .NET 5 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100 + - name: Initialize tools + run: init-tools.sh + shell: bash + - name: Install dependencies + run: dotnet restore il2c.sln +# run: dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln +# run: dotnet restore samples/Calculator/Calculator.sln + - name: Build runtime library + run: build-runtime.sh $(buildConfiguration) + shell: bash + - name: Build il2c + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform="Any CPU" il2c.sln +# - name: Build GettingStartedIL2C-x86 +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# - name: Build GettingStartedIL2C-x64 +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# - name: Build Calculator-x86 +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/Calculator/Calculator.sln +# - name: Build Calculator-x64 +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/Calculator/Calculator.sln + - name: Build Calculator-CMake-mingw32 + run: build.sh $(buildConfiguration) + shell: bash + working-directory: "samples/Calculator/Calculator.CMake" + - name: Test il2c + run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + timeout-minutes: 10 diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml new file mode 100644 index 00000000..b2cc748a --- /dev/null +++ b/.github/workflows/build-windows.yaml @@ -0,0 +1,60 @@ +name: Windows + +on: + push: + branches: + - master + - devel + pull_request: + branches: + - master + - devel + workflow_dispatch: + branches: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup .NET Core 2.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.1.811 + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.404 + - name: Setup .NET 5 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100 + - name: Initialize tools + run: init-tools.bat + shell: cmd + - name: Install dependencies + run: dotnet restore il2c.sln + run: dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln + run: dotnet restore samples/Calculator/Calculator.sln + - name: Build runtime library + run: build-runtime.bat $(buildConfiguration) + shell: cmd + - name: Build il2c + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform="Any CPU" il2c.sln + - name: Build GettingStartedIL2C-x86 + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln + - name: Build GettingStartedIL2C-x64 + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln + - name: Build Calculator-x86 + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/Calculator/Calculator.sln + - name: Build Calculator-x64 + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/Calculator/Calculator.sln + - name: Build Calculator-CMake-mingw32 + run: build.bat $(buildConfiguration) + shell: cmd + working-directory: "samples/Calculator/Calculator.CMake" + - name: Test il2c + run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + timeout-minutes: 10 From 47a88a8f4cbd9b4a294c09f1ee1ccdef6bf74f7e Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 13:59:12 +0900 Subject: [PATCH 02/17] Fixed script syntax. --- .github/workflows/build-linux.yaml | 16 +++++++--------- .github/workflows/build-windows.yaml | 7 ++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index 6a492ce6..ae814017 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -32,15 +32,14 @@ jobs: with: dotnet-version: 5.0.100 - name: Initialize tools - run: init-tools.sh - shell: bash + run: bash init-tools.sh - name: Install dependencies - run: dotnet restore il2c.sln -# run: dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln -# run: dotnet restore samples/Calculator/Calculator.sln + run: | + dotnet restore il2c.sln +# dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln +# dotnet restore samples/Calculator/Calculator.sln - name: Build runtime library - run: build-runtime.sh $(buildConfiguration) - shell: bash + run: bash build-runtime.sh $(buildConfiguration) - name: Build il2c run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform="Any CPU" il2c.sln # - name: Build GettingStartedIL2C-x86 @@ -52,8 +51,7 @@ jobs: # - name: Build Calculator-x64 # run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/Calculator/Calculator.sln - name: Build Calculator-CMake-mingw32 - run: build.sh $(buildConfiguration) - shell: bash + run: bash build.sh $(buildConfiguration) working-directory: "samples/Calculator/Calculator.CMake" - name: Test il2c run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index b2cc748a..b9b9dd2e 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -35,9 +35,10 @@ jobs: run: init-tools.bat shell: cmd - name: Install dependencies - run: dotnet restore il2c.sln - run: dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln - run: dotnet restore samples/Calculator/Calculator.sln + run: | + dotnet restore il2c.sln + dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln + dotnet restore samples/Calculator/Calculator.sln - name: Build runtime library run: build-runtime.bat $(buildConfiguration) shell: cmd From f4b9222018f75bb79db06d3b62974a200c1b10ee Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 14:10:00 +0900 Subject: [PATCH 03/17] Fixed producing build number. --- .github/workflows/build-linux.yaml | 12 ++++++------ .github/workflows/build-windows.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index ae814017..4520e84b 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -41,18 +41,18 @@ jobs: - name: Build runtime library run: bash build-runtime.sh $(buildConfiguration) - name: Build il2c - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform="Any CPU" il2c.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform="Any CPU" il2c.sln # - name: Build GettingStartedIL2C-x86 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln # - name: Build GettingStartedIL2C-x64 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln # - name: Build Calculator-x86 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/Calculator/Calculator.sln +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/Calculator/Calculator.sln # - name: Build Calculator-x64 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/Calculator/Calculator.sln +# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/Calculator/Calculator.sln - name: Build Calculator-CMake-mingw32 run: bash build.sh $(buildConfiguration) working-directory: "samples/Calculator/Calculator.CMake" - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" timeout-minutes: 10 diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index b9b9dd2e..3614627f 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -43,19 +43,19 @@ jobs: run: build-runtime.bat $(buildConfiguration) shell: cmd - name: Build il2c - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform="Any CPU" il2c.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform="Any CPU" il2c.sln - name: Build GettingStartedIL2C-x86 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln - name: Build GettingStartedIL2C-x64 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln - name: Build Calculator-x86 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x86 samples/Calculator/Calculator.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/Calculator/Calculator.sln - name: Build Calculator-x64 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 samples/Calculator/Calculator.sln + run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/Calculator/Calculator.sln - name: Build Calculator-CMake-mingw32 run: build.bat $(buildConfiguration) shell: cmd working-directory: "samples/Calculator/Calculator.CMake" - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(Build.BuildId)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" timeout-minutes: 10 From 9971b539551df1987426001121cc196b79e625bb Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 14:13:59 +0900 Subject: [PATCH 04/17] Fixed elevation installing toolset on linux. --- .github/workflows/build-linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index 4520e84b..a400e496 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -32,7 +32,7 @@ jobs: with: dotnet-version: 5.0.100 - name: Initialize tools - run: bash init-tools.sh + run: sudo bash ./init-tools.sh - name: Install dependencies run: | dotnet restore il2c.sln From 8bfeef1927dceec1198fb037a59896c6cf717e6b Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 14:22:53 +0900 Subject: [PATCH 05/17] Testing configuration variables. --- .github/workflows/build-linux.yaml | 24 +++++++++++++++--------- .github/workflows/build-windows.yaml | 25 ++++++++++++++----------- il2c.sln | 2 ++ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index a400e496..042c4d52 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -15,6 +15,9 @@ on: jobs: build: runs-on: ubuntu-latest + #TODO: + env: + buildConfiguration: Release steps: - uses: actions/checkout@v2 with: @@ -36,23 +39,26 @@ jobs: - name: Install dependencies run: | dotnet restore il2c.sln + dotnet restore samples/Calculator/Calculator.Core/Calculator.Core.csproj # dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln # dotnet restore samples/Calculator/Calculator.sln - name: Build runtime library - run: bash build-runtime.sh $(buildConfiguration) + run: bash build-runtime.sh ${{env.buildConfiguration}} - name: Build il2c - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform="Any CPU" il2c.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="Any CPU" il2c.sln # - name: Build GettingStartedIL2C-x86 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln # - name: Build GettingStartedIL2C-x64 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln +# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln + - name: Build Calculator.Core + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="AnyCPU" samples/Calculator/Calculator.Core/Calculator.Core.csproj # - name: Build Calculator-x86 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/Calculator/Calculator.sln +# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples/Calculator/Calculator.sln # - name: Build Calculator-x64 -# run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/Calculator/Calculator.sln +# run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples/Calculator/Calculator.sln - name: Build Calculator-CMake-mingw32 - run: bash build.sh $(buildConfiguration) - working-directory: "samples/Calculator/Calculator.CMake" + run: bash build.sh ${{env.buildConfiguration}} + working-directory: samples/Calculator/Calculator.CMake - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + run: dotnet test --no-restore --verbosity normal --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -p:CITest=True tests/IL2C.Core.Test.Fixture/bin/${{env.buildConfiguration}}/**/IL2C.Core.Test.Fixture.dll timeout-minutes: 10 diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 3614627f..9d5721c3 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -15,6 +15,9 @@ on: jobs: build: runs-on: windows-latest + #TODO: + env: + buildConfiguration: Release steps: - uses: actions/checkout@v2 with: @@ -37,25 +40,25 @@ jobs: - name: Install dependencies run: | dotnet restore il2c.sln - dotnet restore samples/GettingStartedIL2C/GettingStartedIL2C.sln - dotnet restore samples/Calculator/Calculator.sln + dotnet restore samples\GettingStartedIL2C\GettingStartedIL2C.sln + dotnet restore samples\Calculator\Calculator.sln - name: Build runtime library - run: build-runtime.bat $(buildConfiguration) + run: build-runtime.bat ${{env.buildConfiguration}} shell: cmd - name: Build il2c - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform="Any CPU" il2c.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform="Any CPU" il2c.sln - name: Build GettingStartedIL2C-x86 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/GettingStartedIL2C/GettingStartedIL2C.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples\GettingStartedIL2C\GettingStartedIL2C.sln - name: Build GettingStartedIL2C-x64 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/GettingStartedIL2C/GettingStartedIL2C.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples\GettingStartedIL2C\GettingStartedIL2C.sln - name: Build Calculator-x86 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x86 samples/Calculator/Calculator.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x86 samples\Calculator\Calculator.sln - name: Build Calculator-x64 - run: dotnet build --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 samples/Calculator/Calculator.sln + run: dotnet build --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 samples\Calculator\Calculator.sln - name: Build Calculator-CMake-mingw32 - run: build.bat $(buildConfiguration) + run: build.bat ${{env.buildConfiguration}} shell: cmd - working-directory: "samples/Calculator/Calculator.CMake" + working-directory: samples\Calculator\Calculator.CMake - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration $(buildConfiguration) --no-restore -p:BuildIdentifier="$(GITHUB_RUN_NUMBER)" -p:Platform=x64 -p:CITest=True "tests/IL2C.Core.Test.Fixture/bin/$(buildConfiguration)/**/IL2C.Core.Test.Fixture.dll" + run: dotnet test --no-restore --verbosity normal --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -p:CITest=True tests\IL2C.Core.Test.Fixture\bin\${{env.buildConfiguration}}\**\IL2C.Core.Test.Fixture.dll timeout-minutes: 10 diff --git a/il2c.sln b/il2c.sln index 79aea7fe..4d400cac 100644 --- a/il2c.sln +++ b/il2c.sln @@ -7,8 +7,10 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D105E6CD-626A-4C04-8AF6-0AA34A4E9CF4}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + .github\workflows\build-linux.yaml = .github\workflows\build-linux.yaml build-runtime.bat = build-runtime.bat build-runtime.sh = build-runtime.sh + .github\workflows\build-windows.yaml = .github\workflows\build-windows.yaml il2c.sln.licenseheader = il2c.sln.licenseheader init-tools.bat = init-tools.bat init-tools.sh = init-tools.sh From b36fcc908999cefba95f08ac04aa7142ae4351b7 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 15:18:21 +0900 Subject: [PATCH 06/17] Fixing regression test. --- .github/workflows/build-linux.yaml | 2 +- .github/workflows/build-windows.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index 042c4d52..5d799108 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -60,5 +60,5 @@ jobs: run: bash build.sh ${{env.buildConfiguration}} working-directory: samples/Calculator/Calculator.CMake - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -p:CITest=True tests/IL2C.Core.Test.Fixture/bin/${{env.buildConfiguration}}/**/IL2C.Core.Test.Fixture.dll + run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True timeout-minutes: 10 diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 9d5721c3..ea297acf 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -60,5 +60,5 @@ jobs: shell: cmd working-directory: samples\Calculator\Calculator.CMake - name: Test il2c - run: dotnet test --no-restore --verbosity normal --configuration ${{env.buildConfiguration}} --no-restore -p:BuildIdentifier=$GITHUB_RUN_NUMBER -p:Platform=x64 -p:CITest=True tests\IL2C.Core.Test.Fixture\bin\${{env.buildConfiguration}}\**\IL2C.Core.Test.Fixture.dll + run: dotnet test --no-build --verbosity normal --configuration ${{env.buildConfiguration}} tests\IL2C.Core.Test.Fixture\IL2C.Core.Test.Fixture.csproj -- BuildIdentifier=$GITHUB_RUN_NUMBER Platform=x64 CITest=True timeout-minutes: 10 From 343fa03575ad46739de77b870e0242edd04585ee Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 16:16:37 +0900 Subject: [PATCH 07/17] Fixing test fixture targetting to linux environment. --- tests/IL2C.Core.Test.Fixture/CMakeDriver.cs | 20 +++++++++++++------ tests/IL2C.Core.Test.Fixture/TestFramework.cs | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs index 442ac9b9..c71efdb3 100644 --- a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs +++ b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs @@ -26,6 +26,7 @@ namespace IL2C { internal static class CMakeDriver { +#if false public static async Task BuildAsync( string binPath, string configuration, string sourcePath, string il2cRuntimePath) { @@ -95,22 +96,28 @@ public static async Task BuildAsync( return testLog; } - +#else // FASTER than cmake: It's direct gcc driver with self-parsing cmake configuration. - public static async Task BuildDirectlyAsync( + public static async Task BuildAsync( string binPath, string configuration, string sourcePath, string il2cRuntimePath) { + var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT; + var basePath = Path.GetDirectoryName(sourcePath); var outPath = Path.Combine(basePath, "build"); - var executablePath = Path.Combine(outPath, Path.GetFileNameWithoutExtension(sourcePath) + ".exe"); + var executablePath = Path.Combine( + outPath, + Path.GetFileNameWithoutExtension(sourcePath) + (isWindows ? ".exe" : string.Empty)); var currentListDir = Path.GetFullPath( Path.Combine(il2cRuntimePath, "cmake")); var dict = await CMakeListsSimpleParser.ExtractDefinitionsAsync( - Path.Combine(currentListDir, "gcc4-win-mingw32.cmake"), + isWindows ? // DIRTY: ugly choice only win-mingw32 or linux... + Path.Combine(currentListDir, "gcc4-win-mingw32.cmake") : + Path.Combine(currentListDir, "gcc-linux.cmake"), new Dictionary(StringComparer.InvariantCultureIgnoreCase) { { "Configuration", configuration }, - { "Platform", "mingw32" }, + { "Platform", isWindows ? "mingw32" : "x86_64" }, // DIRTY: `uname -m` on Ubuntu 20.04 { "CMAKE_CURRENT_LIST_DIR", currentListDir } }); @@ -131,7 +138,7 @@ public static async Task BuildDirectlyAsync( // Step1: Execute gcc var (gccExitCode, gccLog) = await TestUtilities.ExecuteAsync( outPath, new[] { binPath }, - Path.Combine(binPath, "gcc.exe"), + Path.Combine(binPath, isWindows ? "gcc.exe" : "gcc"), $"-I{basePath}", incDir, libDir, @@ -156,5 +163,6 @@ public static async Task BuildDirectlyAsync( return testLog; } +#endif } } diff --git a/tests/IL2C.Core.Test.Fixture/TestFramework.cs b/tests/IL2C.Core.Test.Fixture/TestFramework.cs index c9ab3451..de56bbcb 100644 --- a/tests/IL2C.Core.Test.Fixture/TestFramework.cs +++ b/tests/IL2C.Core.Test.Fixture/TestFramework.cs @@ -413,7 +413,7 @@ await TestUtilities.CopyResourceToStreamAsync( string sanitized = null; try { - var executedResult = await CMakeDriver.BuildDirectlyAsync( + var executedResult = await CMakeDriver.BuildAsync( binPath, configuration, sourcePath, From a665cf803f2007c5f21db94839e994a6a42d47df Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 16:25:55 +0900 Subject: [PATCH 08/17] Fixed undefined cmake variable at root variable tree. --- tests/IL2C.Core.Test.Fixture/CMakeDriver.cs | 4 ++-- tests/IL2C.Core.Test.Fixture/CMakeListsSimpleParser.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs index c71efdb3..b1faa6dd 100644 --- a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs +++ b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs @@ -137,8 +137,8 @@ public static async Task BuildAsync( // Step1: Execute gcc var (gccExitCode, gccLog) = await TestUtilities.ExecuteAsync( - outPath, new[] { binPath }, - Path.Combine(binPath, isWindows ? "gcc.exe" : "gcc"), + outPath, isWindows ? new[] { binPath } : Array.Empty(), + isWindows ? Path.Combine(binPath, "gcc.exe") : "gcc", // NOT windows: uses system default gcc. $"-I{basePath}", incDir, libDir, diff --git a/tests/IL2C.Core.Test.Fixture/CMakeListsSimpleParser.cs b/tests/IL2C.Core.Test.Fixture/CMakeListsSimpleParser.cs index 6fc1e1cd..322008dd 100644 --- a/tests/IL2C.Core.Test.Fixture/CMakeListsSimpleParser.cs +++ b/tests/IL2C.Core.Test.Fixture/CMakeListsSimpleParser.cs @@ -132,7 +132,7 @@ private static IEnumerable> SplitArguments(string args, Dictionary< } else { - exprs.Add(() => definitions[fxd]()); + exprs.Add(() => definitions.TryGetValue(fxd, out var value) ? value() : string.Empty); } state = 0; index++; From 7b644cc75024da16eb185d4f1b22dfce111feaae Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 17:28:39 +0900 Subject: [PATCH 09/17] Fixing test fixture targetting to linux environment. --- tests/IL2C.Core.Test.Fixture/CMakeDriver.cs | 36 ++++++++++++++----- .../Templates/CMakeLists.txt | 2 +- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs index b1faa6dd..19f150cb 100644 --- a/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs +++ b/tests/IL2C.Core.Test.Fixture/CMakeDriver.cs @@ -30,9 +30,16 @@ internal static class CMakeDriver public static async Task BuildAsync( string binPath, string configuration, string sourcePath, string il2cRuntimePath) { + var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT; + var basePath = Path.GetDirectoryName(sourcePath); var outPath = Path.Combine(basePath, "build"); - var executablePath = Path.Combine(outPath, Path.GetFileNameWithoutExtension(sourcePath) + ".exe"); + var executablePath = Path.Combine( + outPath, + Path.GetFileNameWithoutExtension(sourcePath) + (isWindows ? ".exe" : string.Empty)); + + var targetCMakeScriptName = isWindows ? // DIRTY: ugly choice only win-mingw32 or linux... + "gcc4-win-mingw32.cmake" : "gcc-linux.cmake"; // Step1: Generate ninja script by cmake. if (!Directory.Exists(outPath)) @@ -47,8 +54,15 @@ public static async Task BuildAsync( var cmakeLog = await TestUtilities.RetryIfStrangeProblemAsync(async () => { var (exitCode, log) = await TestUtilities.ExecuteAsync( - outPath, new[] { binPath }, - Path.Combine(binPath, "cmake.exe"), "-G", "Ninja", "-DCMAKE_MAKE_PROGRAM=ninja.exe", "-DPLATFORM=mingw32", $"-DCONFIGURATION={configuration}", ".."); + outPath, isWindows ? new[] { binPath } : Array.Empty(), + isWindows ? Path.Combine(binPath, "cmake.exe") : "cmake", + "-G", + "Ninja", + isWindows ? "-DCMAKE_MAKE_PROGRAM=ninja.exe" : "-DCMAKE_MAKE_PROGRAM=ninja", + isWindows ? "-DPLATFORM=mingw32" : "-DPLATFORM=x86_64", + $"-DCONFIGURATION={configuration}", + $"-DCMAKE_TARGET_SCRIPT_NAME={targetCMakeScriptName}", + ".."); if (exitCode != 0) { throw new Exception("cmake [ExitCode=" + exitCode + "]: " + log); @@ -73,8 +87,11 @@ public static async Task BuildAsync( var cmakeNinjaLog = await TestUtilities.RetryIfStrangeProblemAsync(async () => { var (exitCode, log) = await TestUtilities.ExecuteAsync( - outPath, new[] { binPath }, - Path.Combine(binPath, "cmake.exe"), "--build", ".", "-j"); + outPath, isWindows ? new[] { binPath } : Array.Empty(), + isWindows ? Path.Combine(binPath, "cmake.exe") : "cmake", + "--build", + ".", + "-j"); if (exitCode != 0) { throw new Exception("cmake [ninja] [ExitCode=" + exitCode + "]: " + log); @@ -111,14 +128,15 @@ public static async Task BuildAsync( var currentListDir = Path.GetFullPath( Path.Combine(il2cRuntimePath, "cmake")); + var targetCMakeScriptName = isWindows ? // DIRTY: ugly choice only win-mingw32 or linux... + "gcc4-win-mingw32.cmake" : "gcc-linux.cmake"; var dict = await CMakeListsSimpleParser.ExtractDefinitionsAsync( - isWindows ? // DIRTY: ugly choice only win-mingw32 or linux... - Path.Combine(currentListDir, "gcc4-win-mingw32.cmake") : - Path.Combine(currentListDir, "gcc-linux.cmake"), + Path.Combine(currentListDir, targetCMakeScriptName), new Dictionary(StringComparer.InvariantCultureIgnoreCase) { { "Configuration", configuration }, { "Platform", isWindows ? "mingw32" : "x86_64" }, // DIRTY: `uname -m` on Ubuntu 20.04 - { "CMAKE_CURRENT_LIST_DIR", currentListDir } + { "CMAKE_CURRENT_LIST_DIR", currentListDir }, + { "CMAKE_TARGET_SCRIPT_NAME", targetCMakeScriptName }, }); var incDir = dict.TryGetValue("INCDIR", out var id) ? id : string.Empty; diff --git a/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt b/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt index b1579da8..0cad5486 100644 --- a/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt +++ b/tests/IL2C.Core.Test.Fixture/Templates/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.8) -include(${CMAKE_CURRENT_LIST_DIR}/../../../../../IL2C.Runtime/cmake/gcc4-win-mingw32.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../../../../../IL2C.Runtime/cmake/${CMAKE_TARGET_SCRIPT_NAME}) project(test C) From 6a529baafbd59485abe6e0a4e6578a9d6607c584 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 18:53:10 +0900 Subject: [PATCH 10/17] Switched regression test target from net45 to netstandard2.0. --- .../IL2C.Core.Test.BasicTypes.csproj | 2 +- .../System_Boolean/System_Boolean.il | 6 +-- .../System_Byte/System_Byte.il | 6 +-- .../System_Char/System_Char.il | 6 +-- .../System_Double/System_Double.il | 6 +-- .../System_Int16/System_Int16.il | 6 +-- .../System_Int32/System_Int32.il | 6 +-- .../System_Int64/System_Int64.il | 6 +-- .../System_IntPtr/System_IntPtr.il | 6 +-- .../System_Object/System_Object.il | 18 ++++----- .../System_SByte/System_SByte.il | 6 +-- .../System_Single/System_Single.il | 6 +-- .../System_String/System_String.il | 6 +-- .../System_UInt16/System_UInt16.il | 6 +-- .../System_UInt32/System_UInt32.il | 6 +-- .../System_UInt64/System_UInt64.il | 6 +-- .../System_UIntPtr/System_UIntPtr.il | 6 +-- .../IL2C.Core.Test.Common.csproj | 2 +- .../IL2C.Core.Test.Fixture.csproj | 2 +- tests/IL2C.Core.Test.ILConverters/Box/Box.il | 38 +++++++++---------- .../Box/Box_Narrowing.il | 10 ++--- .../Box/Box_Widing.il | 12 +++--- .../Call/Call_Newslot.il | 2 +- .../Call/Call_Newslot_Virtual.il | 2 +- .../Call/Call_Overload.il | 2 +- .../Call/Call_Overload_Newslot_Virtual.il | 2 +- .../Call/Call_Overload_Virtual.il | 2 +- .../Call/Call_Virtual.il | 2 +- .../Callvirt/Callvirt_Derived1.il | 2 +- .../Callvirt/Callvirt_Derived1_Newslot.il | 2 +- .../Callvirt_Derived1_Newslot_Virtual.il | 2 +- .../Callvirt/Callvirt_Derived2.il | 2 +- .../Callvirt/Callvirt_Derived2_Newslot.il | 2 +- .../Callvirt_Derived2_Newslot_Virtual.il | 2 +- .../Callvirt/Callvirt_Derived3_Newslot.il | 2 +- .../Callvirt_Derived3_Newslot_Virtual.il | 2 +- .../IL2C.Core.Test.ILConverters.csproj | 2 +- .../Isinst/Isinst.il | 8 ++-- .../Ldarga_s/Ldarga_s.il | 28 +++++++------- .../Ldloca_s/Ldloca_s.il | 30 +++++++-------- .../Unbox_any/Unbox_any.il | 2 +- .../GarbageCollection/GarbageCollection.il | 34 ++++++++--------- .../IL2C.Core.Test.RuntimeSystems.csproj | 2 +- 43 files changed, 154 insertions(+), 154 deletions(-) diff --git a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj index e8a2ac50..7ea408ca 100644 --- a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj +++ b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj @@ -1,7 +1,7 @@  - net45 + netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.il b/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.il index 982ab3ec..144809cc 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Boolean/System_Boolean.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4.s 123 - box [mscorlib]System.Boolean - isinst [mscorlib]System.ValueType + box [netstandard]System.Boolean + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Boolean + sizeof [netstandard]System.Boolean ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.il b/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.il index 79a9e15a..b567fe06 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Byte/System_Byte.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4.s 123 - box [mscorlib]System.Byte - isinst [mscorlib]System.ValueType + box [netstandard]System.Byte + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Byte + sizeof [netstandard]System.Byte ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.il b/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.il index 1e7fd061..f44014d1 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Char/System_Char.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4 12345 - box [mscorlib]System.Char - isinst [mscorlib]System.ValueType + box [netstandard]System.Char + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Char + sizeof [netstandard]System.Char ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.il b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.il index e765a015..4e5b6a6e 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.r8 1234567.890123 - box [mscorlib]System.Double - isinst [mscorlib]System.ValueType + box [netstandard]System.Double + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Double + sizeof [netstandard]System.Double ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.il b/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.il index 707bbc1a..21efb7b6 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int16/System_Int16.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4 12345 - box [mscorlib]System.Int16 - isinst [mscorlib]System.ValueType + box [netstandard]System.Int16 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Int16 + sizeof [netstandard]System.Int16 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.il b/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.il index 5eadf4ef..5e0983b6 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int32/System_Int32.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4 1234567 - box [mscorlib]System.Int32 - isinst [mscorlib]System.ValueType + box [netstandard]System.Int32 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Int32 + sizeof [netstandard]System.Int32 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.il b/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.il index 9dc87c93..81771895 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Int64/System_Int64.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i8 1234567890123 - box [mscorlib]System.Int64 - isinst [mscorlib]System.ValueType + box [netstandard]System.Int64 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Int64 + sizeof [netstandard]System.Int64 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.il b/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.il index f9aee6f7..2c25ee6e 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_IntPtr/System_IntPtr.il @@ -5,8 +5,8 @@ .maxstack 2 ldc.i4 1234567 conv.i - box [mscorlib]System.IntPtr - isinst [mscorlib]System.ValueType + box [netstandard]System.IntPtr + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -18,7 +18,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.IntPtr + sizeof [netstandard]System.IntPtr ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.il b/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.il index 18f16bc4..d82294ca 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Object/System_Object.il @@ -4,7 +4,7 @@ { .maxstack 2 ldarg.0 - isinst [mscorlib]System.ValueType + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ { .maxstack 1 ldarg.0 - call instance string [mscorlib]System.Object::ToString() // non virtual call + call instance string [netstandard]System.Object::ToString() // non virtual call ret } @@ -25,26 +25,26 @@ { .maxstack 1 ldarg.0 - call instance class [mscorlib]System.Type [mscorlib]System.Object::GetType() - callvirt instance string [mscorlib]System.Type::get_FullName() + call instance class [netstandard]System.Type [netstandard]System.Object::GetType() + callvirt instance string [netstandard]System.Type::get_FullName() ret } .method public static bool RefEquals_Same() cil managed { .maxstack 2 - newobj instance void class [mscorlib]System.Object::.ctor() + newobj instance void class [netstandard]System.Object::.ctor() dup - call bool [mscorlib]System.Object::ReferenceEquals(object, object) + call bool [netstandard]System.Object::ReferenceEquals(object, object) ret } .method public static bool RefEquals_NotSame() cil managed { .maxstack 2 - newobj instance void class [mscorlib]System.Object::.ctor() - newobj instance void class [mscorlib]System.Object::.ctor() - call bool [mscorlib]System.Object::ReferenceEquals(object, object) + newobj instance void class [netstandard]System.Object::.ctor() + newobj instance void class [netstandard]System.Object::.ctor() + call bool [netstandard]System.Object::ReferenceEquals(object, object) ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.il b/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.il index 1bb78481..13c94195 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_SByte/System_SByte.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4.s 123 - box [mscorlib]System.SByte - isinst [mscorlib]System.ValueType + box [netstandard]System.SByte + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.SByte + sizeof [netstandard]System.SByte ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.il b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.il index f5418e04..c1558fac 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.r4 12345.67 - box [mscorlib]System.Single - isinst [mscorlib]System.ValueType + box [netstandard]System.Single + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.Single + sizeof [netstandard]System.Single ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.il b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.il index 23b4422c..42d00405 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_String/System_String.il @@ -4,7 +4,7 @@ { .maxstack 2 ldstr "ABC" - isinst [mscorlib]System.ValueType + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ { .maxstack 1 ldarg.0 - call instance string [mscorlib]System.String::ToString() + call instance string [netstandard]System.String::ToString() ret } @@ -26,7 +26,7 @@ .maxstack 2 ldarg.0 ldarg.1 - call instance bool [mscorlib]System.String::Equals(string) + call instance bool [netstandard]System.String::Equals(string) ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.il b/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.il index c935a07d..b0fa60d7 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt16/System_UInt16.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4 42345 - box [mscorlib]System.UInt16 - isinst [mscorlib]System.ValueType + box [netstandard]System.UInt16 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.UInt16 + sizeof [netstandard]System.UInt16 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.il b/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.il index cb375e83..ca90467c 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt32/System_UInt32.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i4 1234567 - box [mscorlib]System.UInt32 - isinst [mscorlib]System.ValueType + box [netstandard]System.UInt32 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.UInt32 + sizeof [netstandard]System.UInt32 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.il b/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.il index 9f264e04..7621b4c1 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_UInt64/System_UInt64.il @@ -4,8 +4,8 @@ { .maxstack 2 ldc.i8 1234567890123 - box [mscorlib]System.UInt64 - isinst [mscorlib]System.ValueType + box [netstandard]System.UInt64 + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -17,7 +17,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.UInt64 + sizeof [netstandard]System.UInt64 ret } } diff --git a/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.il b/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.il index fc25dbb8..d0126afa 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.il +++ b/tests/IL2C.Core.Test.BasicTypes/System_UIntPtr/System_UIntPtr.il @@ -5,8 +5,8 @@ .maxstack 2 ldc.i4 1234567 conv.u - box [mscorlib]System.UIntPtr - isinst [mscorlib]System.ValueType + box [netstandard]System.UIntPtr + isinst [netstandard]System.ValueType brnull.s F1 ldc.i4.1 ret @@ -18,7 +18,7 @@ .method public static int32 SizeOf() cil managed { .maxstack 1 - sizeof [mscorlib]System.UIntPtr + sizeof [netstandard]System.UIntPtr ret } } diff --git a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj index 2871efeb..05b3490a 100644 --- a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj +++ b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj @@ -1,7 +1,7 @@  - net45 + netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj index ebb63266..8ffaae02 100644 --- a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj +++ b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj @@ -1,7 +1,7 @@  - net462 + net5.0 false Library diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box.il b/tests/IL2C.Core.Test.ILConverters/Box/Box.il index c55dba84..c3db9289 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box.il +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box.il @@ -4,7 +4,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Byte + box [netstandard]System.Byte ret } @@ -12,7 +12,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int16 + box [netstandard]System.Int16 ret } @@ -20,7 +20,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -28,7 +28,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int64 + box [netstandard]System.Int64 ret } @@ -36,7 +36,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.SByte + box [netstandard]System.SByte ret } @@ -44,7 +44,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.UInt16 + box [netstandard]System.UInt16 ret } @@ -52,7 +52,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.UInt32 + box [netstandard]System.UInt32 ret } @@ -60,7 +60,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.UInt64 + box [netstandard]System.UInt64 ret } @@ -68,7 +68,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.IntPtr + box [netstandard]System.IntPtr ret } @@ -76,7 +76,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.UIntPtr + box [netstandard]System.UIntPtr ret } @@ -84,7 +84,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Single + box [netstandard]System.Single ret } @@ -92,7 +92,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Double + box [netstandard]System.Double ret } @@ -100,7 +100,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Boolean + box [netstandard]System.Boolean ret } @@ -108,7 +108,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Char + box [netstandard]System.Char ret } @@ -116,7 +116,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -124,7 +124,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -132,7 +132,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -140,7 +140,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -148,7 +148,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int64 + box [netstandard]System.Int64 ret } } diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.il b/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.il index 9bee6239..7ab686ca 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.il +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Narrowing.il @@ -4,7 +4,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Byte + box [netstandard]System.Byte ret } @@ -12,7 +12,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int16 + box [netstandard]System.Int16 ret } @@ -20,7 +20,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Boolean + box [netstandard]System.Boolean ret } @@ -28,7 +28,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Char + box [netstandard]System.Char ret } @@ -36,7 +36,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.UInt32 + box [netstandard]System.UInt32 ret } } diff --git a/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.il b/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.il index 1f7c61cc..97ce71ce 100644 --- a/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.il +++ b/tests/IL2C.Core.Test.ILConverters/Box/Box_Widing.il @@ -4,7 +4,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -12,7 +12,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -20,7 +20,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -28,7 +28,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -36,7 +36,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } @@ -44,7 +44,7 @@ { .maxstack 1 ldarg.0 - box [mscorlib]System.Int32 + box [netstandard]System.Int32 ret } } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.il index 58cc1360..9af2cc0d 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Newslot::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.il index 78359f16..2aba3e20 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Newslot_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Newslot_Virtual::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.il index 05e72ee7..2e3913ea 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Overload::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.il index 62695ab6..de3a375b 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Newslot_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Overload_Newslot_Virtual::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.il index 8c2f9483..db295484 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Overload_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Overload_Virtual::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.il index 501d9aff..a7b5893b 100644 --- a/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Call/Call_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Call_Virtual::.ctor() - call instance string [mscorlib]System.Object::ToString() + call instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.il index 1c61a3e7..4ff274e8 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived1::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.il index fff9fb9c..594b3299 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived1_Newslot::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.il index 631cab40..dcc16ab2 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived1_Newslot_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived1_Newslot_Virtual::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.il index 0983a7f0..14bec481 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived2::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.il index 35a209d0..4a0bfbd3 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived2_Newslot::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.il index 69587edc..a5241b6a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.il index 68648d54..cd3fd22a 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived3_Newslot::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.il b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.il index 76c7a77d..45cc6783 100644 --- a/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.il +++ b/tests/IL2C.Core.Test.ILConverters/Callvirt/Callvirt_Derived3_Newslot_Virtual.il @@ -4,7 +4,7 @@ { .maxstack 1 newobj instance void class IL2C.ILConverters.Callvirt_Derived3_Newslot_Virtual::.ctor() - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj index 82aec806..c06bc049 100644 --- a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj +++ b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj @@ -1,7 +1,7 @@  - net45 + netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.il b/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.il index f6f3459f..f2cd374e 100644 --- a/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.il +++ b/tests/IL2C.Core.Test.ILConverters/Isinst/Isinst.il @@ -4,11 +4,11 @@ { .maxstack 2 ldarg.0 - isinst [mscorlib]System.String + isinst [netstandard]System.String dup brnull.s N1 ldstr "DEF" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) N1: ret } @@ -17,10 +17,10 @@ { .maxstack 2 ldarg.0 - isinst [mscorlib]System.Int32 + isinst [netstandard]System.Int32 dup brnull.s N1 - callvirt instance string [mscorlib]System.Object::ToString() + callvirt instance string [netstandard]System.Object::ToString() N1: ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.il b/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.il index 4e2401da..c426a9fa 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.il +++ b/tests/IL2C.Core.Test.ILConverters/Ldarga_s/Ldarga_s.il @@ -5,7 +5,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Boolean::ToString() + call instance string [netstandard]System.Boolean::ToString() ret } @@ -14,7 +14,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Byte::ToString() + call instance string [netstandard]System.Byte::ToString() ret } @@ -23,7 +23,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Int16::ToString() + call instance string [netstandard]System.Int16::ToString() ret } @@ -32,7 +32,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Int32::ToString() + call instance string [netstandard]System.Int32::ToString() ret } @@ -41,7 +41,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Int64::ToString() + call instance string [netstandard]System.Int64::ToString() ret } @@ -50,7 +50,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.SByte::ToString() + call instance string [netstandard]System.SByte::ToString() ret } @@ -59,7 +59,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.UInt16::ToString() + call instance string [netstandard]System.UInt16::ToString() ret } @@ -68,7 +68,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.UInt32::ToString() + call instance string [netstandard]System.UInt32::ToString() ret } @@ -77,7 +77,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.UInt64::ToString() + call instance string [netstandard]System.UInt64::ToString() ret } @@ -86,7 +86,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.IntPtr::ToString() + call instance string [netstandard]System.IntPtr::ToString() ret } @@ -95,7 +95,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.UIntPtr::ToString() + call instance string [netstandard]System.UIntPtr::ToString() ret } @@ -104,7 +104,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Single::ToString() + call instance string [netstandard]System.Single::ToString() ret } @@ -113,7 +113,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Double::ToString() + call instance string [netstandard]System.Double::ToString() ret } @@ -122,7 +122,7 @@ { .maxstack 1 ldarga.s 4 - call instance string [mscorlib]System.Char::ToString() + call instance string [netstandard]System.Char::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.il b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.il index 0d5343c0..975ac466 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.il +++ b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.il @@ -9,7 +9,7 @@ ldc.i4.1 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Boolean::ToString() + call instance string [netstandard]System.Boolean::ToString() ret } @@ -22,7 +22,7 @@ ldc.i4.0 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Boolean::ToString() + call instance string [netstandard]System.Boolean::ToString() ret } @@ -35,7 +35,7 @@ ldc.i4 255 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Byte::ToString() + call instance string [netstandard]System.Byte::ToString() ret } @@ -48,7 +48,7 @@ ldc.i4 32767 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Int16::ToString() + call instance string [netstandard]System.Int16::ToString() ret } @@ -61,7 +61,7 @@ ldc.i4 2147483647 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Int32::ToString() + call instance string [netstandard]System.Int32::ToString() ret } @@ -74,7 +74,7 @@ ldc.i8 9223372036854775807 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Int64::ToString() + call instance string [netstandard]System.Int64::ToString() ret } @@ -87,7 +87,7 @@ ldc.i4 127 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.SByte::ToString() + call instance string [netstandard]System.SByte::ToString() ret } @@ -100,7 +100,7 @@ ldc.i4 65535 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.UInt16::ToString() + call instance string [netstandard]System.UInt16::ToString() ret } @@ -114,7 +114,7 @@ conv.u4 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.UInt32::ToString() + call instance string [netstandard]System.UInt32::ToString() ret } @@ -128,7 +128,7 @@ conv.u8 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.UInt64::ToString() + call instance string [netstandard]System.UInt64::ToString() ret } @@ -142,7 +142,7 @@ conv.i stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.IntPtr::ToString() + call instance string [netstandard]System.IntPtr::ToString() ret } @@ -156,7 +156,7 @@ conv.u stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.UIntPtr::ToString() + call instance string [netstandard]System.UIntPtr::ToString() ret } @@ -169,7 +169,7 @@ ldc.r4 3.14159274 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Single::ToString() + call instance string [netstandard]System.Single::ToString() ret } @@ -182,7 +182,7 @@ ldc.r8 3.1415926535897931 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Double::ToString() + call instance string [netstandard]System.Double::ToString() ret } @@ -195,7 +195,7 @@ ldc.i4.s 0x41 stloc.s 0 ldloca.s 0 - call instance string [mscorlib]System.Char::ToString() + call instance string [netstandard]System.Char::ToString() ret } diff --git a/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.il b/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.il index a90545fc..0346a25f 100644 --- a/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.il +++ b/tests/IL2C.Core.Test.ILConverters/Unbox_any/Unbox_any.il @@ -4,7 +4,7 @@ { .maxstack 1 ldarg.0 - unbox.any [mscorlib]System.Int32 + unbox.any [netstandard]System.Int32 ret } } diff --git a/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.il b/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.il index 9540f7ea..1bc01b53 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.il +++ b/tests/IL2C.Core.Test.RuntimeSystems/GarbageCollection/GarbageCollection.il @@ -9,7 +9,7 @@ ldstr "ABC" ldstr "DEF" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) newobj instance void IL2C.RuntimeSystems.ObjRefInsideObjRefType::.ctor(string) stloc.0 @@ -19,8 +19,8 @@ pop pop - call void [mscorlib]System.GC::Collect() - call void [mscorlib]System.GC::WaitForPendingFinalizers() + call void [netstandard]System.GC::Collect() + call void [netstandard]System.GC::WaitForPendingFinalizers() ldloc.0 ldfld string IL2C.RuntimeSystems.ObjRefInsideObjRefType::Value @@ -37,7 +37,7 @@ ldloca.s 0 ldstr "ABC" ldstr "DEF" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) call instance void IL2C.RuntimeSystems.ObjRefInsideValueTypeType::.ctor(string) // Release concat string from the evaluation stack @@ -46,8 +46,8 @@ pop pop - call void [mscorlib]System.GC::Collect() - call void [mscorlib]System.GC::WaitForPendingFinalizers() + call void [netstandard]System.GC::Collect() + call void [netstandard]System.GC::WaitForPendingFinalizers() ldloc.0 ldfld string IL2C.RuntimeSystems.ObjRefInsideValueTypeType::Value @@ -63,7 +63,7 @@ ldstr "ABC" ldstr "DEF" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) newobj instance void IL2C.RuntimeSystems.ObjRefInsideValueTypeInsideObjRefType::.ctor(string) stloc.0 @@ -73,8 +73,8 @@ pop pop - call void [mscorlib]System.GC::Collect() - call void [mscorlib]System.GC::WaitForPendingFinalizers() + call void [netstandard]System.GC::Collect() + call void [netstandard]System.GC::WaitForPendingFinalizers() ldloc.0 ldflda valuetype IL2C.RuntimeSystems.ObjRefInsideValueTypeType IL2C.RuntimeSystems.ObjRefInsideValueTypeInsideObjRefType::Value @@ -92,7 +92,7 @@ ldloca.s 0 ldstr "ABC" ldstr "DEF" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) call instance void IL2C.RuntimeSystems.ObjRefInsideObjRefInsideValueTypeType::.ctor(string) // Release concat string from the evaluation stack @@ -101,8 +101,8 @@ pop pop - call void [mscorlib]System.GC::Collect() - call void [mscorlib]System.GC::WaitForPendingFinalizers() + call void [netstandard]System.GC::Collect() + call void [netstandard]System.GC::WaitForPendingFinalizers() ldloca.s 0 ldfld class IL2C.RuntimeSystems.ObjRefInsideObjRefType IL2C.RuntimeSystems.ObjRefInsideObjRefInsideValueTypeType::Value @@ -120,13 +120,13 @@ ldloca.s 0 ldstr "ABC" ldstr "DEF1" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) ldstr "ABC" ldstr "DEF2" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) ldstr "ABC" ldstr "DEF3" - call string [mscorlib]System.String::Concat(string, string) + call string [netstandard]System.String::Concat(string, string) call instance void IL2C.RuntimeSystems.MultipleInsideValueTypeType::.ctor(string, string, string) // Release concat string from the evaluation stack @@ -139,8 +139,8 @@ pop pop - call void [mscorlib]System.GC::Collect() - call void [mscorlib]System.GC::WaitForPendingFinalizers() + call void [netstandard]System.GC::Collect() + call void [netstandard]System.GC::WaitForPendingFinalizers() ldarg.0 ldc.i4.0 diff --git a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj index 94e91f7e..e111daf5 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj +++ b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj @@ -1,7 +1,7 @@  - net45 + netstandard2.0 false Library From 20468228b05898a262f578307f407f20c5088cfe Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 19:37:45 +0900 Subject: [PATCH 11/17] Added ability for dual tfm regression test. Detected some different test result between net45 and netstandard2.0, so improves test. --- .../IL2C.Core.Test.BasicTypes.csproj | 2 +- tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj | 2 +- tests/IL2C.Core.Test.Common/ILSupport.Standard.targets | 9 ++++++++- .../IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj | 2 +- .../IL2C.Core.Test.ILConverters.csproj | 2 +- .../IL2C.Core.Test.RuntimeSystems.csproj | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj index 7ea408ca..eb72134c 100644 --- a/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj +++ b/tests/IL2C.Core.Test.BasicTypes/IL2C.Core.Test.BasicTypes.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net462;netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj index 05b3490a..1b2b7f1a 100644 --- a/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj +++ b/tests/IL2C.Core.Test.Common/IL2C.Core.Test.Common.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net462;netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.Common/ILSupport.Standard.targets b/tests/IL2C.Core.Test.Common/ILSupport.Standard.targets index c561b321..d4cc2330 100644 --- a/tests/IL2C.Core.Test.Common/ILSupport.Standard.targets +++ b/tests/IL2C.Core.Test.Common/ILSupport.Standard.targets @@ -87,6 +87,7 @@ $([System.IO.File]::ReadAllText($(ILFile))) + // method ${method} forwardref removed for IL import \.method [^{}]+ cil managed forwardref[^}]+} // end of method (?<method>[^ \r\t\n]+) $([System.Text.RegularExpressions.Regex]::Replace($(ILSource), $(Pattern), $(Replacement))) @@ -151,7 +152,13 @@ - + + + + + diff --git a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj index 8ffaae02..4d12ade6 100644 --- a/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj +++ b/tests/IL2C.Core.Test.Fixture/IL2C.Core.Test.Fixture.csproj @@ -1,7 +1,7 @@  - net5.0 + net462;net5.0 false Library diff --git a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj index c06bc049..b895fdb2 100644 --- a/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj +++ b/tests/IL2C.Core.Test.ILConverters/IL2C.Core.Test.ILConverters.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net462;netstandard2.0 false Library diff --git a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj index e111daf5..a9bcb938 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj +++ b/tests/IL2C.Core.Test.RuntimeSystems/IL2C.Core.Test.RuntimeSystems.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net462;netstandard2.0 false Library From b06f07569878ea8010a9f1670e65b590efb6c310 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 19:52:05 +0900 Subject: [PATCH 12/17] Inserted test artifact base directory named tfm. --- tests/IL2C.Core.Test.Fixture/TestFramework.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/IL2C.Core.Test.Fixture/TestFramework.cs b/tests/IL2C.Core.Test.Fixture/TestFramework.cs index de56bbcb..4f060220 100644 --- a/tests/IL2C.Core.Test.Fixture/TestFramework.cs +++ b/tests/IL2C.Core.Test.Fixture/TestFramework.cs @@ -29,6 +29,8 @@ using IL2C.Metadata; using IL2C.Internal; +#pragma warning disable CS0436 + namespace IL2C { public static class TestFramework @@ -212,7 +214,9 @@ public static async Task ExecuteTestAsync(TestCaseInformation caseInfo) Path.Combine( Path.GetDirectoryName(caseInfo.Method.DeclaringType.Assembly.Location), "..", "..", "..", "..", "..", - "test-artifacts", configuration)); + "test-artifacts", + configuration, + ThisAssembly.AssemblyMetadata.TargetFramework)); while (true) { try From ee4ea4f19bf73c94d3398c7c1f5651379488996d Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 20:26:33 +0900 Subject: [PATCH 13/17] Ignored exception message format test. Because .NET 5.0 CLR totally replaced .NET Framework 4 or like message. --- tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs b/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs index cbd87ba9..4b0cfc95 100644 --- a/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs +++ b/tests/IL2C.Core.Test.ILConverters/Conv_u8/Conv_u8.cs @@ -30,7 +30,7 @@ namespace IL2C.ILConverters [TestCase((ulong)12345, "Int64", 12345L)] [TestCase(unchecked((ulong)-45678L), "Int64", -45678L)] [TestCase((ulong)12345, "IntPtr", 12345)] - [TestCase(unchecked((ulong)(uint)-45678), "IntPtr", -45678)] + //[TestCase(unchecked((ulong)(uint)-45678), "IntPtr", -45678)] // Different result on both 32/64bit test environment [TestCase((ulong)123, "SByte", (sbyte)123)] [TestCase(unchecked((ulong)(uint)-123), "SByte", (sbyte)-123)] [TestCase((ulong)12345, "UInt16", (ushort)12345)] From b00a59ab47c1f5c008ceba7531e3401da134b014 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 20:27:40 +0900 Subject: [PATCH 14/17] Ignored conv.u8 value from signed integer value. --- IL2C.Runtime/src/Core/il2c_exception.c | 3 +- .../InvalidCastExceptions.cs | 36 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/IL2C.Runtime/src/Core/il2c_exception.c b/IL2C.Runtime/src/Core/il2c_exception.c index 465bc0ef..7cf81e3f 100644 --- a/IL2C.Runtime/src/Core/il2c_exception.c +++ b/IL2C.Runtime/src/Core/il2c_exception.c @@ -236,7 +236,8 @@ il2c_noreturn__ void il2c_throw_nullreferenceexception__(void) // NOTE: Hmm, the unbox failed message different to the castclass opcode... // IL2C choices short sentence by unbox operator message because better footprint. -// .NET 4 castclass message format: "Unable to cast object of type 'Foo.Bar' to type 'System.String'." +// .NET Framework 4 or upper castclass message format: +// "Unable to cast object of type 'Foo.Bar' to type 'System.String'." IL2C_CONST_STRING(il2c_invalid_cast_message, L"Specified cast is not valid."); il2c_noreturn__ void il2c_throw_invalidcastexception__(void) diff --git a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs index 6446e339..ddd5e981 100644 --- a/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs +++ b/tests/IL2C.Core.Test.RuntimeSystems/ExceptionThrownByCLI/InvalidCastExceptions.cs @@ -28,29 +28,29 @@ namespace IL2C.RuntimeSystems // The cast failure message different between .NET CLR 4 and IL2C. // Because IL2C choices short sentence by unbox operator message because better footprint. - // (See also "il2c_cast_failed" symbol at il2c.c) + // (See also "il2c_invalid_cast_message" symbol) [Description("These tests are verified the IL2C throw some exceptions from the internal runtimes by ECMA-335 I.12.4.2.1.")] [TestId("ExceptionThrownByCLI")] - [TestCase(true, "InvalidCastExceptionFromStringToString")] + [TestCase(true, "InvalidCastExceptionFromStringToString", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] [TestCase(true, "InvalidCastExceptionFromInt32ToString", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] [TestCase(true, new[] { "InvalidCastExceptionFromDelegateToString", "TestTarget" }, IncludeTypes = new[] { typeof(ObjectModelInstructionsTestDelegate) }, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] - [TestCase(true, "InvalidCastExceptionFromByteToByte")] - [TestCase(true, "InvalidCastExceptionFromByteToInt16")] - [TestCase(true, "InvalidCastExceptionFromByteToInt32")] - [TestCase(true, "InvalidCastExceptionFromByteToInt64")] - [TestCase(true, "InvalidCastExceptionFromInt16ToByte")] - [TestCase(true, "InvalidCastExceptionFromInt16ToInt16")] - [TestCase(true, "InvalidCastExceptionFromInt16ToInt32")] - [TestCase(true, "InvalidCastExceptionFromInt16ToInt64")] - [TestCase(true, "InvalidCastExceptionFromInt32ToByte")] - [TestCase(true, "InvalidCastExceptionFromInt32ToInt16")] - [TestCase(true, "InvalidCastExceptionFromInt32ToInt32")] - [TestCase(true, "InvalidCastExceptionFromInt32ToInt64")] - [TestCase(true, "InvalidCastExceptionFromInt64ToByte")] - [TestCase(true, "InvalidCastExceptionFromInt64ToInt16")] - [TestCase(true, "InvalidCastExceptionFromInt64ToInt32")] - [TestCase(true, "InvalidCastExceptionFromInt64ToInt64")] + [TestCase(true, "InvalidCastExceptionFromByteToByte", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromByteToInt16", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromByteToInt32", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromByteToInt64", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt16ToByte", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt16ToInt16", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt16ToInt32", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt16ToInt64", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt32ToByte", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt32ToInt16", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt32ToInt32", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt32ToInt64", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt64ToByte", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt64ToInt16", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt64ToInt32", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] + [TestCase(true, "InvalidCastExceptionFromInt64ToInt64", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] public sealed class InvalidCastExceptions { // These cases become from ECMA-335 I.12.4.2.1 - Exceptions thrown by the CLI - Object Model Instructions From 6028c4184436d202dfaec53db814baf6d2106094 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 21:02:35 +0900 Subject: [PATCH 15/17] Fixed failure regression test by difference compatibility for floating point string format. --- IL2C.Runtime/src/System/Double.c | 5 ++++- IL2C.Runtime/src/System/Single.c | 5 ++++- docs/supported-opcodes.md | 4 ++-- .../System_Double/System_Double.cs | 4 ++-- .../System_Single/System_Single.cs | 4 ++-- tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs | 10 ++++++++-- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/IL2C.Runtime/src/System/Double.c b/IL2C.Runtime/src/System/Double.c index c7a6fbcb..0c361049 100644 --- a/IL2C.Runtime/src/System/Double.c +++ b/IL2C.Runtime/src/System/Double.c @@ -7,7 +7,10 @@ System_String* System_Double_ToString(double* this__) { wchar_t buffer[26]; - il2c_snwprintf(buffer, 26, L"%.15g", *this__); + // In .NET Framework CLR, the double value string precision is 15 digits, + // but .NET 5.0 CLR is 16 digits. + // IL2C runtime adjusted to .NET 5.0. + il2c_snwprintf(buffer, 26, L"%.16g", *this__); return il2c_new_string(buffer); } diff --git a/IL2C.Runtime/src/System/Single.c b/IL2C.Runtime/src/System/Single.c index 3b6ac138..722c8215 100644 --- a/IL2C.Runtime/src/System/Single.c +++ b/IL2C.Runtime/src/System/Single.c @@ -7,7 +7,10 @@ System_String* System_Single_ToString(float* this__) { wchar_t buffer[16]; - il2c_snwprintf(buffer, 16, L"%.7g", *this__); + // In .NET Framework CLR, the single value string precision is 7 digits, + // but .NET 5.0 CLR is 8 digits. + // IL2C runtime adjusted to .NET 5.0. + il2c_snwprintf(buffer, 16, L"%.8g", *this__); return il2c_new_string(buffer); } diff --git a/docs/supported-opcodes.md b/docs/supported-opcodes.md index 8e16f9b5..a425067a 100644 --- a/docs/supported-opcodes.md +++ b/docs/supported-opcodes.md @@ -1,7 +1,7 @@ # Supported IL opcodes * Number of opcode implementations: 140 / 219 -* Number of opcode tests: 930 [81 / 219] +* Number of opcode tests: 929 [81 / 219] OpCode | Binary | Implement | Test | ILConverter |:---|:---|:---|:---|:---| @@ -81,7 +81,7 @@ OpCode | Binary | Implement | Test | ILConverter | [conv.u1](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.conv_u1) | 0xd2 | Implemented | [Test [22]](../tests/IL2C.Core.Test.ILConverters/Conv_u1) | IL2C.ILConverters.Conv_u1Converter | | [conv.u2](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.conv_u2) | 0xd1 | Implemented | [Test [21]](../tests/IL2C.Core.Test.ILConverters/Conv_u2) | IL2C.ILConverters.Conv_u2Converter | | [conv.u4](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.conv_u4) | 0x6d | Implemented | [Test [19]](../tests/IL2C.Core.Test.ILConverters/Conv_u4) | IL2C.ILConverters.Conv_u4Converter | -| [conv.u8](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.conv_u8) | 0x6e | Implemented | [Test [19]](../tests/IL2C.Core.Test.ILConverters/Conv_u8) | IL2C.ILConverters.Conv_u8Converter | +| [conv.u8](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.conv_u8) | 0x6e | Implemented | [Test [18]](../tests/IL2C.Core.Test.ILConverters/Conv_u8) | IL2C.ILConverters.Conv_u8Converter | | [cpblk](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.cpblk) | 0xfe17 | | | | | [cpobj](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.cpobj) | 0x70 | | | | | [div](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.div) | 0x5b | Implemented | [Test [9]](../tests/IL2C.Core.Test.ILConverters/Div) | IL2C.ILConverters.DivConverter | diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs index 79ff1c0d..5c4ea6fb 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Double/System_Double.cs @@ -24,8 +24,8 @@ namespace IL2C.BasicTypes // Some tests are using the IgnoreInvokeResult flag, because float string format is bit different (but no problem.) [TestCase(true, "IsValueType")] [TestCase(8, "SizeOf")] - [TestCase("1.79769313486232e+308", "ToString", double.MaxValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is 1.7976931348623157E+308 - [TestCase("-1.79769313486232e+308", "ToString", double.MinValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is -1.7976931348623157E+308 + [TestCase("1.797693134862316e+308", "ToString", double.MaxValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is 1.7976931348623157E+308 + [TestCase("-1.797693134862316e+308", "ToString", double.MinValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is -1.7976931348623157E+308 [TestCase(double.MaxValue, "TryParse", "1.7976931348623157E+308")] [TestCase(double.MinValue, "TryParse", "-1.7976931348623157E+308")] public sealed class System_Double diff --git a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs index d5ee6826..afaef7a4 100644 --- a/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs +++ b/tests/IL2C.Core.Test.BasicTypes/System_Single/System_Single.cs @@ -24,8 +24,8 @@ namespace IL2C.BasicTypes // Some tests are using the IgnoreInvokeResult flag, because float string format is bit different (but no problem.) [TestCase(true, "IsValueType")] [TestCase(4, "SizeOf")] - [TestCase("3.402823e+038", "ToString", float.MaxValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is 3.40282347E+38 - [TestCase("-3.402823e+038", "ToString", float.MinValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is -3.40282347E+38 + [TestCase("3.4028235e+038", "ToString", float.MaxValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is 3.40282347E+38 + [TestCase("-3.4028235e+038", "ToString", float.MinValue, Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Real value is -3.40282347E+38 [TestCase(float.MaxValue, "TryParse", "3.40282347E+38")] [TestCase(float.MinValue, "TryParse", "-3.40282347E+38")] public sealed class System_Single diff --git a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs index fd8ac864..b82768f6 100644 --- a/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs +++ b/tests/IL2C.Core.Test.ILConverters/Ldloca_s/Ldloca_s.cs @@ -34,8 +34,14 @@ namespace IL2C.ILConverters [TestCase("18446744073709551615", "UInt64")] [TestCase("2147483647", "IntPtr")] [TestCase("4294967295", "UIntPtr")] - [TestCase("3.141593", "Single")] // Lost last 2 digits via ToString conversion. - [TestCase("3.14159265358979", "Double")] // Lost last 2 digits via ToString conversion. +#if NET50 + [TestCase("3.1415927", "Single")] // Lost last 1 digits via ToString conversion. + [TestCase("3.141592653589793", "Double")] // Lost last 1 digits via ToString conversion. +#else + // Ignore validation because .NET Framework CLR precision is poor. + [TestCase("3.1415927", "Single", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Lost last 1 digits via ToString conversion. + [TestCase("3.141592653589793", "Double", Assert = TestCaseAsserts.IgnoreValidateInvokeResult)] // Lost last 1 digits via ToString conversion. +#endif [TestCase("A", "Char")] [TestCase("ABC", new[] { "String", "UpdateString" })] // Translation will include UpdateString method [TestCase("ABC", new[] { "LocalVariable_255", "UpdateString" })] // Translation will include UpdateString method From 8540c32413de42a774f06022bd88594077da35e3 Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 21:25:18 +0900 Subject: [PATCH 16/17] Fixed runtime library suffix on linux environment. --- IL2C.Runtime/cmake/gcc-linux.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IL2C.Runtime/cmake/gcc-linux.cmake b/IL2C.Runtime/cmake/gcc-linux.cmake index 3d397b80..3415fc45 100644 --- a/IL2C.Runtime/cmake/gcc-linux.cmake +++ b/IL2C.Runtime/cmake/gcc-linux.cmake @@ -12,10 +12,10 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -D_DEBUG") endif() -set(IL2C_LIBRARY_NAME_BASE "il2c-gcc-linux-${PLATFORM}") -set(IL2C_LIBRARY_NAME "lib${IL2C_LIBRARY_NAME_BASE}-${CONFIGURATION}.a") +set(IL2C_LIBRARY_NAME_BASE "il2c-gcc-linux-${PLATFORM}-${CONFIGURATION}") +set(IL2C_LIBRARY_NAME "lib${IL2C_LIBRARY_NAME_BASE}.a") -set(TARGET_LIBRARY_NAME "${IL2C_LIBRARY_NAME_BASE}-${CONFIGURATION}") +set(TARGET_LIBRARY_NAME "${IL2C_LIBRARY_NAME_BASE}") include_directories(${CMAKE_CURRENT_LIST_DIR}/../include) link_directories(${CMAKE_CURRENT_LIST_DIR}/../lib) From 0f403d358fb71b171329dc42c26daa02196f519c Mon Sep 17 00:00:00 2001 From: Kouji Matsui Date: Sun, 17 Oct 2021 21:32:59 +0900 Subject: [PATCH 17/17] Fixed unresolved pthread lib. --- IL2C.Runtime/cmake/gcc-linux.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IL2C.Runtime/cmake/gcc-linux.cmake b/IL2C.Runtime/cmake/gcc-linux.cmake index 3415fc45..22605edd 100644 --- a/IL2C.Runtime/cmake/gcc-linux.cmake +++ b/IL2C.Runtime/cmake/gcc-linux.cmake @@ -4,7 +4,7 @@ set(CMAKE_BUILD_TYPE "${CONFIGURATION}") set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -g2 -Wall -Werror -Wstrict-prototypes -Wno-unused -fdata-sections -ffunction-sections -Wl,--gc-sections") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -g2 -Wall -Werror -Wstrict-prototypes -Wno-unused -fdata-sections -ffunction-sections -Wl,--gc-sections -pthread") if("${CONFIGURATION}" STREQUAL "Release") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -flto -fomit-frame-pointer -march=native -DNDEBUG")