Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/testcase enhancement #119

Merged
merged 144 commits into from
Jun 12, 2022
Merged

Feature/testcase enhancement #119

merged 144 commits into from
Jun 12, 2022

Conversation

kekyo
Copy link
Owner

@kekyo kekyo commented May 15, 2022

Related #100

@kekyo kekyo self-assigned this May 15, 2022
@kekyo kekyo changed the base branch from master to devel May 15, 2022 11:49
@kekyo kekyo linked an issue May 15, 2022 that may be closed by this pull request
@kekyo
Copy link
Owner Author

kekyo commented May 15, 2022

Causes some testcases are failed.

 System.Exception : gcc [Path="D:\Projects\IL2C\test-artifacts\Debug\net48\RuntimeSystems\ExceptionThrownByCLI\NullReferenceTwoTimes_0", ExitCode=1]: In file included from D:\Projects\IL2C\test-artifacts\Debug\net48\RuntimeSystems\ExceptionThrownByCLI\NullReferenceTwoTimes_0\IL2C.Core.Test.RuntimeSystems_bundle.c:7:0,
                     from D:\Projects\IL2C\test-artifacts\Debug\net48\RuntimeSystems\ExceptionThrownByCLI\NullReferenceTwoTimes_0\test.c:22:
    D:\Projects\IL2C\test-artifacts\Debug\net48\RuntimeSystems\ExceptionThrownByCLI\NullReferenceTwoTimes_0\IL2C.Core.Test.RuntimeSystems/IL2C/RuntimeSystems/NullReferenceExceptions.c:52:20: error: duplicate member 'r'
         System_String* r;
                        ^
    D:\Projects\IL2C\test-artifacts\Debug\net48\RuntimeSystems\ExceptionThrownByCLI\NullReferenceTwoTimes_0\IL2C.Core.Test.RuntimeSystems/IL2C/RuntimeSystems/NullReferenceExceptions.c:53:36: error: duplicate member 'ex'
         System_NullReferenceException* ex;
                                        ^

  Stack Trace: 
    <BuildAsync>d__0.MoveNext() line 171
    TaskAwaiter.ThrowForNonSuccess(Task task)
    TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    TaskAwaiter`1.GetResult()
    <ExecuteTestAsync>d__8.MoveNext() line 452
    TaskAwaiter.ThrowForNonSuccess(Task task)
    TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    TaskAwaiter`1.GetResult()
    TestMethodCommand.RunTestMethod(TestExecutionContext context)
    TestMethodCommand.Execute(TestExecutionContext context)
    <>c__DisplayClass4_0.<PerformWork>b__0()
    <>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
    ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    ContextUtils.DoIsolated(ContextCallback callback, Object state)
    ContextUtils.DoIsolated[T](Func`1 func)
    SimpleWorkItem.PerformWork()

  Standard Output: 
    IL.Verification: IL2C.RuntimeSystems.NullReferenceExceptions.NullReferenceTwoTimes: [StackUnexpected/None]: Unexpected type on the stack.: Offset=3,Found=ref 'object': [0x0003]: Callvirt
    IL.Verification: IL2C.RuntimeSystems.NullReferenceExceptions.NullReferenceTwoTimes: [StackUnexpected/None]: Unexpected type on the stack.: Offset=45,Found=ref 'object': [0x002d]: Callvirt

Following test case:

        public static bool NullReferenceTwoTimes(object v)
        {
            try
            {
                var r = v.ToString();
            }
            catch (NullReferenceException ex)
            {
                if (ex.Message != "Object reference not set to an instance of an object.")
                {
                    return false;
                }
            }

            try
            {
                var r = v.ToString();
            }
            catch (NullReferenceException ex)
            {
                return ex.Message == "Object reference not set to an instance of an object.";
            }

            return false;
        }

Duplicated local variable name r and ex, IL2C has to check and avoid symbol naming duplication from CIL local variable name.

Better way for appending increased suffix number:

  • r : original name (index 0)
  • r1 : duplicate index 1
  • r2 : duplicate index 2
  • ...
@kekyo
Copy link
Owner Author

kekyo commented May 18, 2022

Hmm, CI was failed in referring ILAsm package.

@kekyo kekyo force-pushed the feature/testcase-enhancement branch from 0e4aa38 to 34a6957 Compare May 21, 2022 09:36
@kekyo kekyo force-pushed the feature/testcase-enhancement branch from aba3e24 to 01fa5bf Compare May 22, 2022 12:05
@kekyo kekyo force-pushed the feature/testcase-enhancement branch from 7a5ea48 to b06816d Compare May 25, 2022 11:30
@kekyo kekyo force-pushed the feature/testcase-enhancement branch from 0872b83 to 54c195d Compare June 11, 2022 04:42
@kekyo
Copy link
Owner Author

kekyo commented Jun 11, 2022

I had planned to move on to the next step once everything was green, but the problem with #124 is significant, so I will proceed with it for now.

@kekyo kekyo force-pushed the feature/testcase-enhancement branch from 035c0db to e80c0e7 Compare June 12, 2022 07:06
@kekyo kekyo merged commit 2802237 into devel Jun 12, 2022
@kekyo
Copy link
Owner Author

kekyo commented Jun 12, 2022

There is still the implementation of the process of executing native binary in the test case, but it will be merged and moved to another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants