-
Notifications
You must be signed in to change notification settings - Fork 516
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
[dotnet] Added one more test to ensure that multiple types in a file work. #18073
[dotnet] Added one more test to ensure that multiple types in a file work. #18073
Conversation
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ Generator diffGenerator diff is empty Pipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻✅ All tests on macOS M1 - Mac Ventura (13.0) passed. Pipeline on Agent |
I wanted to make sure that multiple classes work correctly.
In all the previous tests, I was looking at either 1 class or the first class. Great, that works, but keep in mind that the code initializes the class handles looks like this:
I'm not really writing this code, since I'm writing directly in IL. The code that I generate looks like this:
So what does that do?
1 - puts the address of the start of the map on the stack
2 - puts a constant (the index of the item we care about) on the stack
3 - puts the size of the MTClassMap on the stack
4 - multiply 2 & 3, leaving the result on the stack (this is the offset in bytes to the struct we want)
5 - add 1 and 4, leaving the address of the struct we want to access on the stack
Up to now, all the tests were operating with
const
being 0. You can understand that multiplying by zero in all the tests is not properly exercising this code.