mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Added [MangleConst] support
This commit is contained in:
parent
3c131632b4
commit
fa0e712c2b
8 changed files with 78 additions and 22 deletions
|
@ -21,6 +21,11 @@ namespace Tests
|
|||
ret.mA = mA + other.mA + arg0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
const float& MethodA2(const float& val)
|
||||
{
|
||||
return val;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructB
|
||||
|
@ -534,6 +539,8 @@ void UseIt()
|
|||
Interop::StructA sa;
|
||||
sa.MethodA0(0);
|
||||
sa.MethodA1(sa, 1);
|
||||
float f = 123;
|
||||
sa.MethodA2(f);
|
||||
Interop::StructB sb;
|
||||
sb.MethodB0(0);
|
||||
sb.MethodB1(sb, 1);
|
||||
|
|
|
@ -16,6 +16,9 @@ namespace Tests
|
|||
public extern int32 MethodA0(int32 arg0) mut;
|
||||
[LinkName(.CPP)]
|
||||
public extern StructA MethodA1(StructA sa, int32 arg0) mut;
|
||||
[LinkName(.CPP)]
|
||||
[return: MangleConst]
|
||||
public extern ref float MethodA2([MangleConst]ref float val);
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
|
@ -391,6 +394,8 @@ namespace Tests
|
|||
}
|
||||
|
||||
Test.Assert(StructA.sVal == 1234);
|
||||
float f = 123;
|
||||
Test.Assert(sa0.MethodA2(ref f) == 123);
|
||||
|
||||
StartTest("Func0");
|
||||
Test.Assert(Func0(12, 34) == 3412);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue