Added:
trunk/mono/mono/tests/bug-340662_bug.cs
Modified:
trunk/mono/mono/tests/ChangeLog
trunk/mono/mono/tests/Makefile.am
Log:
2008-03-19 Rodrigo Kumpera <rkum...@novell.com>
* bug-340662_bug.cs: Added. Regression test for the bug.
* Makefile.am: Added the new test.
Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog 2008-03-19 10:31:37 UTC (rev 98579)
+++ trunk/mono/mono/tests/ChangeLog 2008-03-19 10:37:02 UTC (rev 98580)
@@ -1,3 +1,9 @@
+2008-03-19 Rodrigo Kumpera <rkum...@novell.com>
+
+ * bug-340662_bug.cs: Added. Regression test for the bug.
+
+ * Makefile.am: Added the new test.
+
2008-03-18 Mark Probst <mark....@gmail.com>
* generics-sharing-other-exc.2.il: Test case for catching
Modified: trunk/mono/mono/tests/Makefile.am
===================================================================
--- trunk/mono/mono/tests/Makefile.am 2008-03-19 10:31:37 UTC (rev 98579)
+++ trunk/mono/mono/tests/Makefile.am 2008-03-19 10:37:02 UTC (rev 98580)
@@ -271,6 +271,7 @@
bug-335131.2.cs \
bug-322722_patch_bx.2.cs \
bug-348522.2.cs \
+ bug-340662_bug.cs \
bug-322722_dyn_method_throw.2.cs
if AMD64
Added: trunk/mono/mono/tests/bug-340662_bug.cs
===================================================================
--- trunk/mono/mono/tests/bug-340662_bug.cs 2008-03-19 10:31:37 UTC (rev 98579)
+++ trunk/mono/mono/tests/bug-340662_bug.cs 2008-03-19 10:37:02 UTC (rev 98580)
@@ -0,0 +1,44 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+
+class Program
+{
+ [DllImport("foo.dll", CallingConvention=CallingConvention.Winapi)]
+ public static extern void pf1(string format, __arglist);
+
+ [DllImport("foo.dll", CallingConvention=CallingConvention.Cdecl)]
+ public static extern void pf2(string format, __arglist);
+
+ [DllImport("foo.dll", CallingConvention=CallingConvention.StdCall)]
+ public static extern void pf3(string format, __arglist);
+
+ [DllImport("foo.dll", CallingConvention=CallingConvention.ThisCall)]
+ public static extern void pf4(string format, __arglist);
+
+ [DllImport("foo.dll", CallingConvention=CallingConvention.FastCall)]
+ public static extern void pf5(string format, __arglist);
+
+ [DllImport("foo.dll", CallingConvention=CallingConvention.StdCall)]
+ public static extern void mixed1(string format);
+
+ static int Main()
+ {
+ for (int i = 1; i < 6; ++i) {
+ if (typeof (Program).GetMethod ("pf"+i).CallingConvention != CallingConventions.VarArgs) {
+ Console.WriteLine ("pf{0} {1} != VarArg", i, typeof (Program).GetMethod ("pf"+i).CallingConvention);
+ return 1;
+ }
+ }
+
+ if (typeof (Program).GetMethod ("mixed1").CallingConvention != CallingConventions.Standard) {
+ Console.WriteLine ("mixed1 {0} != Standard", typeof (Program).GetMethod ("mixed1").CallingConvention);
+ return 1;
+ }
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}