From fa2bdd711212ba6b7a94a20971e8bfa281e73296 Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Wed, 12 Jul 2023 13:22:29 -0300 Subject: lol --- tinycc/tests/tests2/109_float_struct_calling.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tinycc/tests/tests2/109_float_struct_calling.c (limited to 'tinycc/tests/tests2/109_float_struct_calling.c') diff --git a/tinycc/tests/tests2/109_float_struct_calling.c b/tinycc/tests/tests2/109_float_struct_calling.c new file mode 100644 index 0000000..90fc045 --- /dev/null +++ b/tinycc/tests/tests2/109_float_struct_calling.c @@ -0,0 +1,24 @@ +#include + +/* This test used to fail on x86_64 on linux with sse registers */ + +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; +} -- cgit v1.2.3