diff options
Diffstat (limited to 'test/regression/struct5.c')
-rw-r--r-- | test/regression/struct5.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/regression/struct5.c b/test/regression/struct5.c new file mode 100644 index 00000000..13a1aa5c --- /dev/null +++ b/test/regression/struct5.c @@ -0,0 +1,43 @@ +typedef struct HPointStruct +{ + double x; + double y; + double z; + double w; +}HPoint; + +typedef struct ObjPointStruct +{ + double x; + double y; + double z; + double tx; + double ty; + double tz; +}ObjPoint; + +HPoint PointToHPoint(ObjPoint P); + +HPoint PointToHPoint(ObjPoint P) +{ + HPoint res; + res.x = P.x; + res.y = P.y; + res.z = P.z; + res.w = 1; + return res; +} + +double test1(HPoint (*f)(ObjPoint), double x) +{ + ObjPoint P; + HPoint HP; + P.x = x; + HP = f(P); + return HP.x; +} + +double test2(double x) +{ + return test1(PointToHPoint, x); +} |