1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +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"
CLibType = "Dynamic"
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"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
PreprocessorMacros = ["DEBUG", "CLI"]

View file

@ -1,4 +1,5 @@
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
//2
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
#include <windows.h>
#include <stdlib.h>
@ -82,7 +83,7 @@ StructA GetSA()
return StructA();
}
// THIS IS VERSION 3.
// THIS IS VERSION 6.
extern "C"
__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 b = 234;
int c = 345;
//GetA();
//GetB();
}
extern "C"

View file

@ -25,7 +25,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d"
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"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]

View file

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

View file

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

View file

@ -1,12 +1,34 @@
using System;
// 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

View file

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

View file

@ -9,270 +9,158 @@ using System.Threading;
//#define A
//#define B
class ClassA
{
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
struct StructA
{
public int mA;
public int mB;
}
class Bloozer
{
int mA;
}
enum Zorf : IDisposable
{
case A;
case B;
public void Dispose()
public static StructA operator+(StructA lhs, float rhs)
{
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
{
PrintF("Disposed");
public int mA;
public static operator StructD(StructC val)
{
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);
} public ~this()
{
PrintF("Testo ~this %p\n", this);
StructC conv;
conv.mA = val.mA;
return conv;
}
}
class Norg
struct StructE
{
public String mVal;
public int32 mA;
public int32 mB;
public int mA;
public int32 GetIt(int32 a, int32 b, int32 c)
public static operator StructD(StructE val)
{
return a + b + c + mA;
}
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;
StructC conv;
conv.mA = val.mA;
return conv;
}
}
public virtual int GetVal()
class ClassA
{
return 99;
}
public int mA;
}
class Norg2 : Norg
struct StructK
{
public int mVal2;
public int Zof => 123;
public int GetIt() => 234;
/*public override int Zorf
{
set
{
base.Zorf = 123;
}
}*/
}
enum TestEnumA
struct StructL : StructK
{
A,
B,
C
public int mA;
}
[AttributeUsage(.Field, .ReflectAttribute, ReflectUser=.All)]
struct FoofAttribute : Attribute
struct Checker
{
int32 mA;
int32 mB;
int32 mC;
public static int CheckIt(int* iPtr, int len)
{
int acc = 0;
for (int i < len)
{
acc += iPtr[i];
}
return acc;
}
public this(int32 a, int32 b, int32 c)
public static int CheckItSpan(int* iPtr, int len)
{
mA = a;
mB = b;
mC = c;
Span<int> span = .(iPtr, len);
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
{
[Foof(1, 2, 3)]
public String mVal;
public int32 mA;
public int32 mB;
public this()
static int GetHash<T>(T val) where T : IHashable
{
mVal = "z";
mA = 111;
mB = 222;
return val.GetHashCode();
}
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
)
{
}
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;
return 0;
}
public static int32 Hey()
{
let t = typeof(Self);
let field = t.GetField("mVal").Value;
var foofAttrib = field.GetCustomAttribute<FoofAttribute>();
TypeCode tc = .Boolean;
//int h = GetHash(tc);
//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;
}
}
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]
BfOptimizationLevel = "O0"
IntermediateType = "ObjectAndIRCode"
[Configs.Test.Win64]
IntermediateType = "ObjectAndIRCode"
@ -14,9 +15,11 @@ ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.Test.Linux64]
IntermediateType = "ObjectAndIRCode"
COptimizationLevel = "O2"
ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.Test.macOS]
COptimizationLevel = "O2"
ConfigSelections = {TestsB = {Config = "Test"}}
[Configs.TestFail.Win64]