From 9787797d15d281ce1dd792d247fac043c72dc769 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 20 Nov 2018 03:01:04 -0600 Subject: Initial version --- tests/include/test.c | 33 +++++++++++++++++++++++++++++++++ tests/include/test.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 tests/include/test.c create mode 100644 tests/include/test.h (limited to 'tests/include') diff --git a/tests/include/test.c b/tests/include/test.c new file mode 100644 index 0000000..8d801b7 --- /dev/null +++ b/tests/include/test.c @@ -0,0 +1,33 @@ +#include "test.h" + +int test_call_int() { + return 5; +} + +struct STRUCT1 test_call_int_param(int param1) { + struct STRUCT1 s; + + s.field1 = param1; + + return s; +} + +STRUCT2 test_call_int_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 s; + + s.field1 = param1 + param2.field1; + + return s; +} + +ENUM2 test_call_int_param4(enum ENUM param1) { + return enum4; +} \ No newline at end of file diff --git a/tests/include/test.h b/tests/include/test.h new file mode 100644 index 0000000..60d1660 --- /dev/null +++ b/tests/include/test.h @@ -0,0 +1,36 @@ +#include + +#define TEST_INT 512 +#define TEST_FLOAT 5.12 +#define TEST_HEX 0x512 + +typedef uint8_t PRIMTYPE; +typedef PRIMTYPE CUSTTYPE; + +struct STRUCT1 { + int field1; +}; + +typedef struct STRUCT1 STRUCT2; + +typedef struct { + int field1; +} STRUCT3; + +enum ENUM { + enum1, + enum2, + enum3 +}; + +typedef enum { + enum4 = 3, + enum5, + enum6 +} ENUM2; + +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); \ No newline at end of file -- cgit v1.2.3