Test cases
- Added `simple_pointer_cast.t` to test casting (currently broken parsing-wise) DGen - Added a todo for semantic tests for the `simple_pointer_cast.t` test case
This commit is contained in:
parent
d58e5aad4d
commit
6611cb4593
|
@ -818,6 +818,7 @@ int main()
|
|||
return 0;
|
||||
}`);
|
||||
}
|
||||
// TODO: Add semantic test for simple_pointer_cast.t
|
||||
else if(cmp(typeChecker.getModule().getName(), "simple_extern") == 0)
|
||||
{
|
||||
file.writeln(`
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
module simple_pointer_cast;
|
||||
|
||||
int j;
|
||||
|
||||
int ret()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int function(int* ptr)
|
||||
{
|
||||
*(cast(int*)ret())=2;
|
||||
*(ptr+ret()) = 2+2;
|
||||
return (*ptr)+1*2;
|
||||
}
|
||||
|
||||
int thing()
|
||||
{
|
||||
int discardExpr = function(&j);
|
||||
int** l;
|
||||
|
||||
return discardExpr;
|
||||
}
|
Loading…
Reference in New Issue