diff options
Diffstat (limited to 'tests/include')
| -rw-r--r-- | tests/include/test.c | 38 | ||||
| -rw-r--r-- | tests/include/test.h | 21 |
2 files changed, 44 insertions, 15 deletions
diff --git a/tests/include/test.c b/tests/include/test.c index 885723e..d63c974 100644 --- a/tests/include/test.c +++ b/tests/include/test.c @@ -1,35 +1,51 @@ #include "test.h" int test_call_int() { - return 5; + return 5; } #ifdef FORCE -struct STRUCT1 _test_call_int_param_(int param1) { +struct STRUCT1 _test_call_param_(int param1) { struct STRUCT1 s; - + s.field1 = param1; - + return s; } #endif -STRUCT2 test_call_int_param2(int param1, STRUCT2 param2) { +STRUCT2 test_call_param2(int param1, STRUCT2 param2) { STRUCT2 s; - + s.field1 = param1 + param2.field1; - + return s; } -STRUCT2 test_call_int_param3(int param1, struct STRUCT1 param2) { +STRUCT2 test_call_param3(int param1, struct STRUCT1 param2) { STRUCT2 s; - + s.field1 = param1 + param2.field1; - + return s; } -ENUM2 test_call_int_param4(enum ENUM param1) { +ENUM2 test_call_param4(enum ENUM param1) { return enum4; +} + +union UNION1 test_call_param5(float param1) { + union UNION1 u; + + u.field2 = param1; + + return u; +} + +unsigned char test_call_param6(UNION2 param1) { + return param1.field2; +} + +int test_call_param7(union UNION1 param1) { + return param1.field1; }
\ No newline at end of file diff --git a/tests/include/test.h b/tests/include/test.h index 6138ca3..af7eeb8 100644 --- a/tests/include/test.h +++ b/tests/include/test.h @@ -36,8 +36,21 @@ typedef struct { int *field; } STRUCT4; +union UNION1 { + int field1; + float field2; +}; + +typedef union { + double field1; + unsigned char field2; +} UNION2; + int test_call_int(); -struct STRUCT1 _test_call_int_param_(int param1); -STRUCT2 test_call_int_param2(int param1, STRUCT2 param2); -STRUCT2 test_call_int_param3(int param1, struct STRUCT1 param2); -ENUM2 test_call_int_param4(enum ENUM param1); +struct STRUCT1 _test_call_param_(int param1); +STRUCT2 test_call_param2(int param1, STRUCT2 param2); +STRUCT2 test_call_param3(int param1, struct STRUCT1 param2); +ENUM2 test_call_param4(enum ENUM param1); +union UNION1 test_call_param5(float param1); +unsigned char test_call_param6(UNION2 param1); +int test_call_param7(union UNION1 param1);
\ No newline at end of file |
