aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/good/complex-types.defs12
-rw-r--r--tests/includes/types.h20
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/good/complex-types.defs b/tests/good/complex-types.defs
index 0a5c952..58d417e 100644
--- a/tests/good/complex-types.defs
+++ b/tests/good/complex-types.defs
@@ -32,9 +32,21 @@ type mach_port_array_t = array[] of mach_port_t;
type char_struct_t = struct[4] of char;
type string_t = array[256] of char;
+type simple_struct_t = struct { byte a; };
+
+type complex_struct_x_t = struct { simple_struct_t a; simple_struct_t b; int c; };
+
+type complex_struct_y_t = struct { complex_struct_x_t a; byte b; };
+
+type complex_struct_z_t = struct { complex_struct_y_t a; int d; };
+
routine callcomplex(port : mach_port_t;
p : pointer_t;
q : intptr_t;
str : char_struct_t;
strt : string_t;
+ simple : simple_struct_t;
+ x : complex_struct_x_t;
+ y : complex_struct_y_t;
+ z : complex_struct_z_t;
out vec : mach_port_array_t);
diff --git a/tests/includes/types.h b/tests/includes/types.h
index fe70e69..2a70443 100644
--- a/tests/includes/types.h
+++ b/tests/includes/types.h
@@ -31,6 +31,26 @@ typedef struct char_struct {
typedef char string_t[256];
typedef const char* const_string_t;
+typedef struct simple_struct {
+ char a;
+} simple_struct_t;
+
+typedef struct complex_struct_x {
+ simple_struct_t a;
+ simple_struct_t b;
+ int c;
+} complex_struct_x_t;
+
+typedef struct complex_struct_y {
+ complex_struct_x_t a;
+ char b;
+} complex_struct_y_t;
+
+typedef struct complex_struct_z {
+ complex_struct_y_t a;
+ int d;
+} complex_struct_z_t;
+
static inline int8_t int_to_int8(int n) {
return (int8_t) n;
}