mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
[qfcc] Finish struct-init-param test
When the bug is fixed, it will pass now (does without optimization).
This commit is contained in:
parent
e4c87091a3
commit
c2ed6d41bd
1 changed files with 20 additions and 6 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
void printf (string fmt, ...) = #0;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
@ -13,18 +14,31 @@ typedef struct Rect_s {
|
||||||
Extent extent;
|
Extent extent;
|
||||||
} Rect;
|
} Rect;
|
||||||
|
|
||||||
void *foo (void *obj, void *cmd, void *o, Point pos, Rect r)
|
void *foo (Rect *obj, void *cmd, Rect *o, Point pos, Rect r);
|
||||||
{
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *bar (Rect *obj, void *cmd, void *o, Point pos)
|
void *bar (Rect *obj, void *cmd, Rect *o, Point pos)
|
||||||
{
|
{
|
||||||
Rect rect = { {}, obj.extent };
|
Rect rect = { {}, obj.extent };
|
||||||
return foo (obj, cmd, o, pos, rect);
|
return foo (obj, cmd, o, pos, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *foo (Rect *obj, void *cmd, Rect *o, Point pos, Rect r)
|
||||||
|
{
|
||||||
|
*o = r;
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rect obj = { { 1, 2}, { 3, 4} };
|
||||||
|
Rect o = { { 5, 6}, {7, 8} };
|
||||||
|
|
||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
return 1;// don't want this to pass until I've checked the generated code
|
int ret = 1;
|
||||||
|
bar(&obj, nil, &o, obj.offset);
|
||||||
|
printf ("%d %d %d %d\n", o.offset.x, o.offset.y,
|
||||||
|
o.extent.width, o.extent.height);
|
||||||
|
if (o.offset.x == 0 && o.offset.y == 0
|
||||||
|
&& o.extent.width == 3 && o.extent.height == 4)
|
||||||
|
ret = 0;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue