1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Mintest changes

This commit is contained in:
Brian Fiete 2019-11-25 06:48:19 -08:00
parent 94b385495a
commit 79ccb33586
10 changed files with 253 additions and 221 deletions

View file

@ -20,7 +20,7 @@ TargetName = "$(ProjectName)_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib Rpcrt4.lib Ole32.lib" OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib Rpcrt4.lib Ole32.lib"
CLibType = "Dynamic" CLibType = "Dynamic"
BeefLibType = "DynamicDebug" BeefLibType = "DynamicDebug"
DebugCommandArguments = "-platform=x86_64-none-linux-android21 -workspace=C:/proj/Android/BeefTest/app/src/main/cpp/../beef/\"" DebugCommandArguments = "-proddir=..\\..\\IDEHelper\\Tests -test"
DebugWorkingDirectory = "c:\\beef\\ide\\mintest" DebugWorkingDirectory = "c:\\beef\\ide\\mintest"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"] EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
PreprocessorMacros = ["DEBUG", "CLI"] PreprocessorMacros = ["DEBUG", "CLI"]

View file

@ -1,4 +1,5 @@
#define _ENABLE_ATOMIC_ALIGNMENT_FIX //2
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
#include <windows.h> #include <windows.h>
#include <stdlib.h> #include <stdlib.h>
@ -82,7 +83,7 @@ StructA GetSA()
return StructA(); return StructA();
} }
// THIS IS VERSION 3. // THIS IS VERSION 6.
extern "C" extern "C"
__declspec(dllexport) void Test2(int aa, int bb, int cc, int dd) __declspec(dllexport) void Test2(int aa, int bb, int cc, int dd)
{ {
@ -107,9 +108,6 @@ __declspec(dllexport) void Test2(int aa, int bb, int cc, int dd)
int a = 123; int a = 123;
int b = 234; int b = 234;
int c = 345; int c = 345;
//GetA();
//GetB();
} }
extern "C" extern "C"

View file

@ -25,7 +25,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist" TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d" TargetName = "BeefIDE_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib" OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
DebugCommandArguments = "-proddir=C:\\Beef\\IDE" DebugCommandArguments = "-proddir=C:\\_Beef\\TestApp"
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest" DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"] EnvironmentVars = ["_NO_DEBUG_HEAP=1"]

View file

@ -12,7 +12,7 @@ Description = "Mintest"
[Configs.Debug.Win64] [Configs.Debug.Win64]
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "DynamicDebug"
StackSize = 4194304 StackSize = 4194304
DebugCommandArguments = "hey=\"yo man\" zag= zoogles boof stoopers \"\"\"abc efg\"\"\"" DebugCommandArguments = "hey=\"yo man\" zag= zoogles boof stoopers \"\"\"abc efg\"\"\""
DebugWorkingDirectory = ".\\" DebugWorkingDirectory = ".\\"
@ -26,6 +26,13 @@ OtherLinkFlags = ""
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "Static"
[Configs.Debug.iOS]
BuildKind = "StaticLib"
[Configs.Debug.aarch64-none-linux-android21]
BuildKind = "StaticLib"
RelocType = "PIC"
[Configs.Release.Win64] [Configs.Release.Win64]
OtherLinkFlags = "$(LinkFlags) C:\\Beef\\BeefTools\\TestDLL\\x64\\Debug\\TestDLL.lib" OtherLinkFlags = "$(LinkFlags) C:\\Beef\\BeefTools\\TestDLL\\x64\\Debug\\TestDLL.lib"
DebugCommandArguments = "hey=\"yo man\" zag= zoogles boof stoopers \"abc efg\"" DebugCommandArguments = "hey=\"yo man\" zag= zoogles boof stoopers \"abc efg\""
@ -33,6 +40,13 @@ DebugCommandArguments = "hey=\"yo man\" zag= zoogles boof stoopers \"abc efg
[Configs.Release.WinFart] [Configs.Release.WinFart]
OtherLinkFlags = "" OtherLinkFlags = ""
[Configs.Release.iOS]
BuildKind = "StaticLib"
[Configs.Release.aarch64-none-linux-android21]
BuildKind = "StaticLib"
RelocType = "PIC"
[Configs.Paranoid.Win32] [Configs.Paranoid.Win32]
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "Static"
@ -47,6 +61,13 @@ OtherLinkFlags = ""
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "Static"
[Configs.Paranoid.iOS]
BuildKind = "StaticLib"
[Configs.Paranoid.aarch64-none-linux-android21]
BuildKind = "StaticLib"
RelocType = "PIC"
[Configs.Test.Win32] [Configs.Test.Win32]
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "Static"
@ -61,6 +82,13 @@ OtherLinkFlags = ""
CLibType = "Static" CLibType = "Static"
BeefLibType = "Static" BeefLibType = "Static"
[Configs.Test.iOS]
BuildKind = "StaticLib"
[Configs.Test.aarch64-none-linux-android21]
BuildKind = "StaticLib"
RelocType = "PIC"
[ProjectFolder] [ProjectFolder]
[[ProjectFolder.Items]] [[ProjectFolder.Items]]

View file

@ -14,8 +14,10 @@ ConfigSelections = {mintest2 = {Enabled = false}}
IntermediateType = "ObjectAndIRCode" IntermediateType = "ObjectAndIRCode"
COptimizationLevel = "Og" COptimizationLevel = "Og"
[[Configs.Debug.Win64.DistinctOptions]]
Filter = "System.String"
[Configs.Debug.WinFart] [Configs.Debug.WinFart]
MachineType = "x86"
Toolset = "GNU" Toolset = "GNU"
EmitDebugInfo = "No" EmitDebugInfo = "No"
EmitDynamicCastCheck = false EmitDynamicCastCheck = false
@ -25,6 +27,23 @@ EnableRealtimeLeakCheck = false
AllowHotSwapping = false AllowHotSwapping = false
AllocStackTraceDepth = 0 AllocStackTraceDepth = 0
[Configs.Debug.Linux64]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
[Configs.Debug.macOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
[Configs.Debug.iOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
IntermediateType = "Bitcode"
[Configs.Debug.aarch64-none-linux-android21]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
[Configs.Release.Win32] [Configs.Release.Win32]
Toolset = "GNU" Toolset = "GNU"
BfOptimizationLevel = "OgPlus" BfOptimizationLevel = "OgPlus"
@ -39,7 +58,6 @@ IntermediateType = "ObjectAndIRCode"
COptimizationLevel = "O3" COptimizationLevel = "O3"
[Configs.Release.WinFart] [Configs.Release.WinFart]
MachineType = "x86"
Toolset = "GNU" Toolset = "GNU"
BfOptimizationLevel = "O0" BfOptimizationLevel = "O0"
EmitDebugInfo = "No" EmitDebugInfo = "No"
@ -47,6 +65,19 @@ AllocStackTraceDepth = 0
IncrementalBuild = true IncrementalBuild = true
COptimizationLevel = "O0" COptimizationLevel = "O0"
[Configs.Release.Linux64]
Toolset = "GNU"
[Configs.Release.macOS]
Toolset = "GNU"
[Configs.Release.iOS]
Toolset = "GNU"
IntermediateType = "Bitcode"
[Configs.Release.aarch64-none-linux-android21]
Toolset = "GNU"
[Configs.Test.Win32] [Configs.Test.Win32]
Toolset = "GNU" Toolset = "GNU"
BfSIMDSetting = "None" BfSIMDSetting = "None"
@ -71,7 +102,6 @@ COptimizationLevel = "O2"
ConfigSelections = {mintest = {Config = "Debug"}} ConfigSelections = {mintest = {Config = "Debug"}}
[Configs.Test.WinFart] [Configs.Test.WinFart]
MachineType = "x86"
Toolset = "GNU" Toolset = "GNU"
BuildKind = "Normal" BuildKind = "Normal"
EmitDebugInfo = "No" EmitDebugInfo = "No"
@ -83,6 +113,27 @@ AllowHotSwapping = false
AllocStackTraceDepth = 0 AllocStackTraceDepth = 0
COptimizationLevel = "O2" COptimizationLevel = "O2"
[Configs.Test.Linux64]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
COptimizationLevel = "O2"
[Configs.Test.macOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
COptimizationLevel = "O2"
[Configs.Test.iOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
IntermediateType = "Bitcode"
COptimizationLevel = "O2"
[Configs.Test.aarch64-none-linux-android21]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
COptimizationLevel = "O2"
[Configs.Paranoid.Win32] [Configs.Paranoid.Win32]
Toolset = "GNU" Toolset = "GNU"
EmitDynamicCastCheck = false EmitDynamicCastCheck = false
@ -103,7 +154,6 @@ COptimizationLevel = "O2"
ConfigSelections = {mintest2 = {Enabled = false}} ConfigSelections = {mintest2 = {Enabled = false}}
[Configs.Paranoid.WinFart] [Configs.Paranoid.WinFart]
MachineType = "x86"
Toolset = "GNU" Toolset = "GNU"
EmitDebugInfo = "No" EmitDebugInfo = "No"
EmitDynamicCastCheck = false EmitDynamicCastCheck = false
@ -114,3 +164,28 @@ EnableSideStack = false
AllowHotSwapping = false AllowHotSwapping = false
AllocStackTraceDepth = 0 AllocStackTraceDepth = 0
COptimizationLevel = "O2" COptimizationLevel = "O2"
[Configs.Paranoid.Linux64]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
EnableSideStack = false
COptimizationLevel = "O2"
[Configs.Paranoid.macOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
EnableSideStack = false
COptimizationLevel = "O2"
[Configs.Paranoid.iOS]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
EnableSideStack = false
IntermediateType = "Bitcode"
COptimizationLevel = "O2"
[Configs.Paranoid.aarch64-none-linux-android21]
Toolset = "GNU"
EnableRealtimeLeakCheck = false
EnableSideStack = false
COptimizationLevel = "O2"

View file

@ -982,6 +982,18 @@ namespace System
} }
ptr ptr
} }
/*public mixin ToNewCStr()
{
char8* ptr = null;
if (mPtr != null)
{
ptr = new:mixin char8[mLength + 1]* (?);
Internal.MemCpy(ptr, mPtr, mLength);
ptr[mLength] = 0;
}
ptr
}*/
} }
static static

View file

@ -1,12 +1,34 @@
using System; using System;
// Zapples // Zapples
struct StructA<T>
{
public T mVal;
static public static bool operator< <TOther>(StructA<T> lhs, TOther rhs) where bool : operator T < TOther
{
return true;
}
/*public static TResult operator+<TOther, TResult>(StructA<T> lhs, TOther rhs)
where TResult = operator T * TOther
{
return lhs.mVal * rhs;
}*/
}
class TestA
{ {
public void Bloop()
{
StructA<float> sa;
sa.mVal = 1.23f;
let res = sa < 100;
int a = 1 * 2;
}
} }
/*class Mintest2 /*class Mintest2

View file

@ -196,6 +196,12 @@ namespace Hey.Dude.Bro
public static int Main(String[] args) public static int Main(String[] args)
{ {
TypeCode tc = .Boolean;
PrintF("Hey\n");
//Test2(1, 2, 3, 4);
/*IHashable ih = (int32)TypeCode.Boolean; /*IHashable ih = (int32)TypeCode.Boolean;
let hashCode = ih.GetHashCode();*/ let hashCode = ih.GetHashCode();*/

View file

@ -9,270 +9,158 @@ using System.Threading;
//#define A //#define A
//#define B //#define B
class ClassA struct StructA
{
public virtual void ClassA0()
{
}
public virtual void ClassA1()
{
}
}
class ClassB
{
}
#if B
class ClassC : ClassB
{
public override void ToString(System.String strBuffer)
{
base.ToString(strBuffer);
}
}
#elif A
class ClassC : ClassA
{
public override void ToString(System.String strBuffer)
{
base.ToString(strBuffer);
}
}
#endif
class ClassD
{
public String mStr;
int mA6;
public virtual void Poo()
{
PrintF("Poo\n");
}
public virtual void Poo2()
{
PrintF("Poo2\n");
}
}
class ClassD2
{
int mA5;
}
class ClassE : ClassD
{
public void Zog2()
{
}
}
class ClassF : ClassE
{
}
[NoDiscard("Use this value!")]
struct TestStruct
{ {
public int mA; public int mA;
public int mB;
}
class Bloozer public static StructA operator+(StructA lhs, float rhs)
{
int mA;
}
enum Zorf : IDisposable
{
case A;
case B;
public void Dispose()
{ {
StructA newVal = .();
newVal.mA = lhs.mA + (int)rhs;
return newVal;
} }
} }
class IFaceA struct StructB
{ {
public static void Fart() public int mA;
public static bool operator==(StructA lhs, StructB rhs)
{ {
return lhs.mA == rhs.mA;
} }
} }
class Zlips : IFaceA, IDisposable
{
static void Fart()
{
}
public void Dispose() struct StructC
{
public int mA;
public static operator StructD(StructC val)
{ {
PrintF("Disposed"); StructD conv;
conv.mA = val.mA;
return conv;
} }
} }
class Testo struct StructD
{ {
public this() public int mA;
public static operator StructD(StructC val)
{ {
PrintF("Testo this %p\n", this); StructC conv;
} public ~this() conv.mA = val.mA;
{ return conv;
PrintF("Testo ~this %p\n", this);
} }
} }
class Norg struct StructE
{ {
public String mVal; public int mA;
public int32 mA;
public int32 mB;
public int32 GetIt(int32 a, int32 b, int32 c) public static operator StructD(StructE val)
{ {
return a + b + c + mA; StructC conv;
} conv.mA = val.mA;
return conv;
public static int32 GetIt(Blurg bl, int32 a, int32 b, int32 c)
{
return a + b + c + bl.mA;
}
public virtual int Zorf
{
set
{
mA = (.)value;
}
get
{
return mA;
}
}
public virtual int GetVal()
{
return 99;
} }
} }
class Norg2 : Norg class ClassA
{ {
public int mVal2; public int mA;
}
public int Zof => 123; struct StructK
{
public int GetIt() => 234; }
/*public override int Zorf struct StructL : StructK
{
public int mA;
}
struct Checker
{
public static int CheckIt(int* iPtr, int len)
{ {
set int acc = 0;
for (int i < len)
{ {
base.Zorf = 123; acc += iPtr[i];
}
return acc;
} }
}*/
} public static int CheckItSpan(int* iPtr, int len)
enum TestEnumA
{
A,
B,
C
}
[AttributeUsage(.Field, .ReflectAttribute, ReflectUser=.All)]
struct FoofAttribute : Attribute
{
int32 mA;
int32 mB;
int32 mC;
public this(int32 a, int32 b, int32 c)
{ {
mA = a; Span<int> span = .(iPtr, len);
mB = b;
mC = c; int acc = 0;
for (int i < len)
{
acc += span[i];
}
return acc;
}
public static int CheckItSpanOpt(int* iPtr, int len)
{
OptSpan<int> span = .(iPtr, len);
int acc = 0;
for (int i < len)
{
acc += span[i];
}
return acc;
} }
} }
struct Blurg struct Blurg
{ {
[Foof(1, 2, 3)] static int GetHash<T>(T val) where T : IHashable
public String mVal;
public int32 mA;
public int32 mB;
public this()
{ {
mVal = "z"; return val.GetHashCode();
mA = 111;
mB = 222;
} }
void TestIt(String a, String b) public static int32 LongCall(
int abcdefghijklmnopqrstuvwxyz0,
int abcdefghijklmnopqrstuvwxyz1,
int abcdefghijklmnopqrstuvwxyz2,
int abcdefghijklmnopqrstuvwxyz3,
int abcdefghijklmnopqrstuvwxyz4,
int abcdefghijklmnopqrstuvwxyz5,
int abcdefghijklmnopqrstuvwxyz6,
int abcdefghijklmnopqrstuvwxyz7,
int abcdefghijklmnopqrstuvwxyz8,
int abcdefghijklmnopqrstuvwxyz9
)
{ {
} return 0;
TestStruct GetTS()
{
return .();
}
static void Test(int a, int b)
{
PrintF("a0");
}
[Error("This property can only be accessed directly from a typeof() expression")]
static void Test(int a, int b, int c)
{
}
public static Result<int> GetMe()
{
return 123;
} }
public static int32 Hey() public static int32 Hey()
{ {
let t = typeof(Self); TypeCode tc = .Boolean;
let field = t.GetField("mVal").Value; //int h = GetHash(tc);
var foofAttrib = field.GetCustomAttribute<FoofAttribute>();
//for (TypeCode tc < .Boolean) var val = tc.Underlying;
var valRef = ref tc.UnderlyingRef;
//Test(1, 2, 3); let maxVal = typeof(TypeCode).MaxValue;
int a = 100;
String str = new:gCRTAlloc String(a);
delete:gCRTAlloc str;
/*TestEnumA ta = .A;
IHashable ih = ta;*/
return 123; return 123;
} }
} }
struct Florg
{
int mA = 123;
public void Dispose() mut
{
}
}
class CustomAlloc
{
public void* Alloc(int size, int align)
{
//return Internal.Malloc(size);
return null;
}
}

View file

@ -6,6 +6,7 @@ StartupProject = "Tests"
[Configs.Debug.Win64] [Configs.Debug.Win64]
BfOptimizationLevel = "O0" BfOptimizationLevel = "O0"
IntermediateType = "ObjectAndIRCode"
[Configs.Test.Win64] [Configs.Test.Win64]
IntermediateType = "ObjectAndIRCode" IntermediateType = "ObjectAndIRCode"
@ -14,9 +15,11 @@ ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.Test.Linux64] [Configs.Test.Linux64]
IntermediateType = "ObjectAndIRCode" IntermediateType = "ObjectAndIRCode"
COptimizationLevel = "O2"
ConfigSelections = {TestsB = {Config = "Test"}} ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.Test.macOS] [Configs.Test.macOS]
COptimizationLevel = "O2"
ConfigSelections = {TestsB = {Config = "Test"}} ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.TestFail.Win64] [Configs.TestFail.Win64]