From 2fbaf061efea7acedf1abb35df2719536748028c Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 10 Apr 2020 08:58:12 -0700 Subject: [PATCH] Mintest updates --- IDE/mintest/BeefProj.toml | 8 ++++ IDE/mintest/BeefSpace.toml | 5 +- IDE/mintest/minlib/BeefProj.toml | 53 ++++++++++++++++----- IDE/mintest/minlib/src/System/Object.bf | 2 +- IDE/mintest/src/main.bf | 27 ++++++----- IDE/mintest/src/main2.bf | 27 ++++------- IDE/mintest/src/main3.bf | 63 ++++++++++--------------- 7 files changed, 104 insertions(+), 81 deletions(-) diff --git a/IDE/mintest/BeefProj.toml b/IDE/mintest/BeefProj.toml index 18efa131..660eb293 100644 --- a/IDE/mintest/BeefProj.toml +++ b/IDE/mintest/BeefProj.toml @@ -88,6 +88,14 @@ BuildKind = "StaticLib" BuildKind = "StaticLib" RelocType = "PIC" +[[ProjectFolder.Items]] +Type = "Folder" +Name = "snorg" + +[[ProjectFolder.Items.Items]] +Type = "IgnoreSource" +Name = "Zap.bf" + [[ProjectFolder.Items]] Type = "Source" Path = "../../../temp/test.txt" diff --git a/IDE/mintest/BeefSpace.toml b/IDE/mintest/BeefSpace.toml index 069a668c..cf1b07fd 100644 --- a/IDE/mintest/BeefSpace.toml +++ b/IDE/mintest/BeefSpace.toml @@ -5,7 +5,6 @@ Projects = {mintest = {Path = "."}, minlib = {Path = "minlib"}, LibA = {Path = " StartupProject = "mintest" [Configs.Debug.Win32] -BfOptimizationLevel = "OgPlus" InitLocalVariables = true IntermediateType = "ObjectAndIRCode" ConfigSelections = {mintest2 = {Enabled = false}} @@ -55,7 +54,9 @@ AllocStackTraceDepth = 0 IntermediateType = "ObjectAndIRCode" [Configs.Release.Win64] +Toolset = "LLVM" BfSIMDSetting = "SSE3" +LTOType = "Thin" AllocStackTraceDepth = 0 IntermediateType = "ObjectAndIRCode" COptimizationLevel = "O3" @@ -94,8 +95,6 @@ CSIMDSetting = "None" COptimizationLevel = "O2" ConfigSelections = {mintest = {Config = "Debug"}} -[Configs.Test.Win64] - [Configs.Test.WinFart] Toolset = "GNU" BuildKind = "Normal" diff --git a/IDE/mintest/minlib/BeefProj.toml b/IDE/mintest/minlib/BeefProj.toml index 1965d049..37e1ef35 100644 --- a/IDE/mintest/minlib/BeefProj.toml +++ b/IDE/mintest/minlib/BeefProj.toml @@ -3,39 +3,56 @@ Dependencies = {} [Project] Name = "minlib" -TargetType = "BeefLib" DefaultNamespace = "" Aliases = ["corlib"] [Configs.Debug.Win32] OtherLinkFlags = "" -OptimizationLevel = "O0" [[Configs.Debug.Win32.DistinctOptions]] Filter = "[System.Optimize]" -BfOptimizationLevel = "O2" -RuntimeChecks = false -EmitDynamicCastCheck = false -EmitObjectAccessCheck = false + +[[Configs.Debug.Win32.DistinctOptions]] +Filter = "[System.UseLLVM]" [Configs.Debug.Win64] CLibType = "Static" [[Configs.Debug.Win64.DistinctOptions]] Filter = "[System.Optimize]" -BfOptimizationLevel = "O2" -RuntimeChecks = false -EmitDynamicCastCheck = false -EmitObjectAccessCheck = false + +[[Configs.Debug.Win64.DistinctOptions]] +Filter = "[System.UseLLVM]" [Configs.Debug.WinFart] OtherLinkFlags = "" CLibType = "Static" BeefLibType = "Static" +[[Configs.Debug.WinFart.DistinctOptions]] +Filter = "[System.UseLLVM]" + +[[Configs.Debug.Linux64.DistinctOptions]] +Filter = "[System.UseLLVM]" + +[[Configs.Debug.macOS.DistinctOptions]] +Filter = "[System.UseLLVM]" + +[Configs.Debug.iOS] +BuildKind = "StaticLib" + +[[Configs.Debug.iOS.DistinctOptions]] +Filter = "[System.UseLLVM]" + +[Configs.Debug.aarch64-none-linux-android21] +BuildKind = "StaticLib" +RelocType = "PIC" + +[[Configs.Debug.aarch64-none-linux-android21.DistinctOptions]] +Filter = "[System.UseLLVM]" + [Configs.Release.Win32] OtherLinkFlags = "" -OptimizationLevel = "O2" [Configs.Release.Win64] OtherLinkFlags = "" @@ -43,6 +60,13 @@ OtherLinkFlags = "" [Configs.Release.WinFart] OtherLinkFlags = "" +[Configs.Release.iOS] +BuildKind = "StaticLib" + +[Configs.Release.aarch64-none-linux-android21] +BuildKind = "StaticLib" +RelocType = "PIC" + [Configs.Test.WinFart] BuildKind = "Normal" OtherLinkFlags = "" @@ -59,3 +83,10 @@ CLibType = "Static" OtherLinkFlags = "" CLibType = "Static" BeefLibType = "Static" + +[Configs.Paranoid.iOS] +BuildKind = "StaticLib" + +[Configs.Paranoid.aarch64-none-linux-android21] +BuildKind = "StaticLib" +RelocType = "PIC" diff --git a/IDE/mintest/minlib/src/System/Object.bf b/IDE/mintest/minlib/src/System/Object.bf index d4d0c880..97c6d241 100644 --- a/IDE/mintest/minlib/src/System/Object.bf +++ b/IDE/mintest/minlib/src/System/Object.bf @@ -234,7 +234,7 @@ namespace System { switch (this) { - case ' ', '\t', '\n', '\r', '\xa0', '\x85': return true; + case ' ', '\t', '\n', '\r', (.)'\xa0', (.)'\x85': return true; default: return false; } } diff --git a/IDE/mintest/src/main.bf b/IDE/mintest/src/main.bf index 3adfebbf..022f47dd 100644 --- a/IDE/mintest/src/main.bf +++ b/IDE/mintest/src/main.bf @@ -30,6 +30,12 @@ public enum QIntDisplayType COUNT } +[CRepr] +public struct ALLEGRO_COLOR +{ + public float r, g, b, a; +} + namespace Hey.Dude.Bro { class TestClass @@ -66,13 +72,21 @@ namespace Hey.Dude.Bro #if BF_64_BIT [Import(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), LinkName("Test2")] public static extern void Test2(int32 a, int32 b, int32 c, int32 d); + + [Import(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), LinkName("Test3")] + public static extern void Test3(void* ptr, ALLEGRO_COLOR color); #else [Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test2")] public static extern void Test2(int32 a, int32 b, int32 c, int32 d); + + [Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test3")] + public static extern void Test3(void* ptr, ALLEGRO_COLOR color); + + [Import(@"C:\Beef\BeefTools\TestDLL\Debug\TestDLL.dll"), LinkName("Test4")] + public static extern void Test4(void* ptr, ALLEGRO_COLOR* color); #endif - [Import(@"C:\Beef\BeefTools\TestDLL\x64\Debug\TestDLL.dll"), CLink] - public static extern void Test4(int32 a, int32 b); + static uint32 sStaticVar = 234; @@ -223,15 +237,6 @@ namespace Hey.Dude.Bro public static int Main(String[] args) { - function void() func = => Florgs; - int32 val = (int32)(int)(void*)func; - - //void* ptr = "Hey"; - //val = (int32)ptr; - - - //Test2(1, 2, val, 4); - Blurg.Hey(); return 1; } diff --git a/IDE/mintest/src/main2.bf b/IDE/mintest/src/main2.bf index 4a784182..df87d4d5 100644 --- a/IDE/mintest/src/main2.bf +++ b/IDE/mintest/src/main2.bf @@ -1,24 +1,17 @@ +// more text at the end of the first line. This is more text. + using System; -#define SMz - -#if SM -typealias int_test = int32; -#else -typealias int_test = int64; -#endif - -struct Floof +class Pooble { - public static int32 Hey() + public void Test(int abcdefgh, int abcdefgh2, int abcdefgh3, int abcdefgh4, int abcdefgh5, int abcdefgh6, int abcdefgh7, int abcdefgh8) { - Result res = 123; - switch (res) - { - case .Ok(let val): - default: - } + } - return 123; + public static float sVal = 9; + + public static mixin Zorp(var z) + { + z * sVal } } diff --git a/IDE/mintest/src/main3.bf b/IDE/mintest/src/main3.bf index 1a53973e..4fe86906 100644 --- a/IDE/mintest/src/main3.bf +++ b/IDE/mintest/src/main3.bf @@ -1,56 +1,43 @@ -//using Squarf; - -//GORB #pragma warning disable 168 using System; -using System.Collections.Generic; using System.Diagnostics; using System.Threading; +using System.Collections.Generic; -#region EnumA Crapsos -[AllowDuplicates] -enum EnumA +struct Smibbs { - Abo = 1, - Boop = _*2, - Croop = _*2, - - Zoop = 1 + public int16 mX = 11; + public int16 mY = 22; + public int16 mZ = 33; } -struct StructA +namespace PropertyStructCrash { - public int mA; - public int mB; + struct B + { + public int c; + } + + struct A + { + public B Prop { get; set; } + } + + class Program + { + public static void Main() + { + var c = '¥'; + } + } } -#region Blurg struct Blurg { - static mixin MixA(var sa2) + public static void Hey() { - sa2.mA++; - } - - static mixin MixB(mut StructA sa2) - { - sa2.mA++; - } - - static void MethodA(mut StructA sa) - { - MixA!(sa); - //MixB!(mut sa); - } - - public static int32 Hey() - { - StructA sa = .(); - sa.mA = 123 - - - return (int32)123; + PropertyStructCrash.Program.Main(); } }