[2019-12] [threads] Add back mono_threads_attach_tools_thread as a public API (#18074)
[mono-project.git] / mono / tests / bug-340662_bug.cs
blob7ea71d66bebefaca805cac976f09c8b720a9b929
1 using System;
2 using System.Reflection;
3 using System.Runtime.InteropServices;
4 using System.Runtime.CompilerServices;
7 class Program
9 [DllImport("foo.dll", CallingConvention=CallingConvention.Winapi)]
10 public static extern void pf1(string format, __arglist);
12 [DllImport("foo.dll", CallingConvention=CallingConvention.Cdecl)]
13 public static extern void pf2(string format, __arglist);
15 [DllImport("foo.dll", CallingConvention=CallingConvention.StdCall)]
16 public static extern void pf3(string format, __arglist);
18 [DllImport("foo.dll", CallingConvention=CallingConvention.ThisCall)]
19 public static extern void pf4(string format, __arglist);
21 [DllImport("foo.dll", CallingConvention=CallingConvention.FastCall)]
22 public static extern void pf5(string format, __arglist);
24 [DllImport("foo.dll", CallingConvention=CallingConvention.StdCall)]
25 public static extern void mixed1(string format);
27 static int Main()
29 for (int i = 1; i < 6; ++i) {
30 if (typeof (Program).GetMethod ("pf"+i).CallingConvention != CallingConventions.VarArgs) {
31 Console.WriteLine ("pf{0} {1} != VarArg", i, typeof (Program).GetMethod ("pf"+i).CallingConvention);
32 return 1;
36 if (typeof (Program).GetMethod ("mixed1").CallingConvention != CallingConventions.Standard) {
37 Console.WriteLine ("mixed1 {0} != Standard", typeof (Program).GetMethod ("mixed1").CallingConvention);
38 return 1;
41 Console.WriteLine ("OK");
42 return 0;