Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/Simple/SharedLibrary/SharedLibrary.cs')
-rw-r--r--tests/src/Simple/SharedLibrary/SharedLibrary.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/Simple/SharedLibrary/SharedLibrary.cs b/tests/src/Simple/SharedLibrary/SharedLibrary.cs
new file mode 100644
index 000000000..78fd2c9a1
--- /dev/null
+++ b/tests/src/Simple/SharedLibrary/SharedLibrary.cs
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace SharedLibrary
+{
+ public class ClassLibrary
+ {
+ [NativeCallable(EntryPoint = "ReturnsPrimitiveInt", CallingConvention = CallingConvention.StdCall)]
+ public static int ReturnsPrimitiveInt()
+ {
+ return 10;
+ }
+
+ [NativeCallable(EntryPoint = "ReturnsPrimitiveBool", CallingConvention = CallingConvention.StdCall)]
+ public static bool ReturnsPrimitiveBool()
+ {
+ return true;
+ }
+
+ [NativeCallable(EntryPoint = "ReturnsPrimitiveChar", CallingConvention = CallingConvention.StdCall)]
+ public static char ReturnsPrimitiveChar()
+ {
+ return 'a';
+ }
+
+ [NativeCallable(EntryPoint = "EnsureManagedClassLoaders", CallingConvention = CallingConvention.StdCall)]
+ public static void EnsureManagedClassLoaders()
+ {
+ Random random = new Random();
+ random.Next();
+ }
+ }
+}