tinycc/tests/tests2/109_float_struct_calling.c

25 lines
407 B
C
Raw Normal View History

2019-10-29 09:19:42 +03:00
#include <stdio.h>
2019-10-29 14:02:58 +03:00
/* This test used to fail on x86_64 on linux with sse registers */
2019-10-29 09:19:42 +03:00
struct Point {
float x;
float y;
};
struct Rect {
struct Point top_left;
struct Point size;
};
float foo(struct Point p, struct Rect r) {
return r.size.x;
}
int main(int argc, char **argv) {
struct Point p = {1, 2};
struct Rect r = {{3, 4}, {5, 6}};
printf("%f\n", foo(p, r));
return 0;
}