[test] Fix dependency on compiler behavior for a couple of tests
commit328e048e15fc27500b549e6b5fbfb3b4bc06e72d
authorMarek Habersack <grendel@twistedcode.net>
Wed, 23 Sep 2015 14:24:53 +0000 (23 16:24 +0200)
committerJonathan Pryor <jonpryor@vt.edu>
Mon, 28 Sep 2015 15:49:13 +0000 (28 11:49 -0400)
tree2463b596fd941251ccdafc8882c67f21b77e8bc2
parente325236fa31f60890a1ba701ccfdae7bf74509b6
[test] Fix dependency on compiler behavior for a couple of tests

A couple of tests for System.Reflection.MethodBody assumed the code generated
by the compiler will be the same as the one generated by Mono's MCS. However,
when the code is built by CSC in release mode (version that comes with VS2015
was tested) the optimizations remove locals required by the old version of the
tests. Also, CSC orders the locals differently to MCS and that breaks one of
the tests which relied on the declaration order.
Another difference is that CSC and MCS type a certain local variable differently.
The variable being a byte* in source code is output in IL as such by MCS, but CSC
outputs an int8& - a by-ref type.
The tests are built by VS but they are executed by Mono on Android and so the
differences come up as errors.
This commit fixes both issues by working around the differences.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=33370 when it is included in XA
mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs