Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 6 additions & 45 deletions src/mono/sample/HelloWorld/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,15 @@

namespace HelloWorld
{
struct S1 {
internal double d1, d2;
}

ref struct R1 {
internal ref double d1; // 8
internal ref object o1; // += sizeof(MonoObject*)
internal object o2; // skip
internal ref S1 s1; //+= instance_size(S1)
internal S1 s2; // skip
public R1(ref double d1, ref object o1, ref S1 s1) {
this.d1 = ref d1;
this.o1 = ref o1;
this.s1 = ref s1;
}
internal void Run()
{
Console.WriteLine("oi");
}
}

internal class Program
{
private static void Main(string[] args)
{
Run();
}
static void Run()
{
Invoke(new string[] { "TEST" });
}
static void Invoke(object[] parameters)
{
CheckArguments(parameters, "abcd"u8);
}
static void CheckArguments(ReadOnlySpan<object> parameters, ReadOnlySpan<byte> parameters2)
{
double d1thays = 123.0;
object o1thays = new String("thays");
var s1thays = new S1();
s1thays.d1 = 10;
s1thays.d2 = 20;
R1 myR1 = new R1(ref d1thays, ref o1thays, ref s1thays);
myR1.o2 = new String("thays2");
myR1.s2 = new S1();
myR1.s2.d1 = 30;
myR1.s2.d2 = 40;
System.Diagnostics.Debugger.Break();
bool isMono = typeof(object).Assembly.GetType("Mono.RuntimeStructs") != null;
Console.WriteLine($"Hello World {(isMono ? "from Mono!" : "from CoreCLR!")}");
Console.WriteLine(typeof(object).Assembly.FullName);
Console.WriteLine(System.Reflection.Assembly.GetEntryAssembly ());
Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
}
}
}
}