Test cases

- Update `simple_pointer_cast_le.t` to do some pointer airthmetic at the byte-level of the 32-bit integer

DGen

- Updated the semantic test code generation for `simple_pointer_cast_le.t` to check for new values
This commit is contained in:
Tristan B. Velloza Kildaire 2023-04-14 15:03:23 +02:00
parent 98a0246ad2
commit 39f3980526
2 changed files with 3 additions and 2 deletions

View File

@ -826,8 +826,8 @@ int main()
int main()
{
int retValue = thing();
assert(t_e159019f766be1a175186a13f16bcfb7 == 4);
assert(retValue == 6);
assert(t_e159019f766be1a175186a13f16bcfb7 == 256+4);
assert(retValue == 256+4+2);
return 0;
}`);

View File

@ -11,6 +11,7 @@ int function(int* ptr)
{
byte* bytePtr = cast(byte*)ptr;
*bytePtr = 2+2;
*(bytePtr+1) = 1;
return (*ptr)+1*2;
}