// FIXME: arch
// FIXME: -O2
// FIXME: llc/opt flags
- command = g_strdup_printf ("clang -march=x86-64 -fpic -msse -msse2 -msse3 -msse4 -O2 -fno-optimize-sibling-calls -c -o \"%s\" \"%s.opt.bc\"", acfg->llvm_ofile, acfg->tmpbasename);
+ command = g_strdup_printf ("clang -march=x86-64 -fpic -msse -msse2 -msse3 -msse4 -O0 -fno-optimize-sibling-calls -c -o \"%s\" \"%s.opt.bc\"", acfg->llvm_ofile, acfg->tmpbasename);
//command = g_strdup_printf ("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -Qunused-arguments -miphoneos-version-min=8.2 -arch arm64 -fpic -O0 -c -o \"%s\" \"%s.bc\"", acfg->llvm_ofile, acfg->tmpbasename);
aot_printf (acfg, "Executing clang: %s\n", command);
*/
if (G_UNLIKELY (!ftndesc)) {
gpointer addr = mono_compile_method (del->method);
+
+ if (del->method->klass->valuetype && mono_method_signature (del->method)->hasthis)
+ addr = mono_aot_get_unbox_trampoline (del->method);
+
gpointer arg = mini_get_delegate_arg (del->method, addr);
ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
del->method = method;
del->method_ptr = mono_compile_method (method);
+ if (method->klass->valuetype)
+ del->method_ptr = mono_aot_get_unbox_trampoline (method);
del->extra_arg = mini_get_delegate_arg (del->method, del->method_ptr);
}
return 2;
}
+ interface IFaceVirtualDel {
+ int return_field ();
+ }
+
+ struct VtypeVirtualDelStruct : IFaceVirtualDel {
+ public int f;
+ public int return_field_nonvirt () {
+ return f;
+ }
+ public int return_field () {
+ return f;
+ }
+ }
+
+ public static int test_42_vtype_delegate () {
+ var s = new VtypeVirtualDelStruct () { f = 42 };
+ Func<int> f = s.return_field_nonvirt;
+ return f ();
+ }
+
+ public static int test_42_vtype_virtual_delegate () {
+ IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 };
+ Func<int> f = s.return_field;
+ return f ();
+ }
+
public static int test_1_store_decimal () {
decimal[,] a = {{1}};