aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_flexarray_struct.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/test_flexarray_struct.in')
-rw-r--r--tests/core/test_flexarray_struct.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/core/test_flexarray_struct.in b/tests/core/test_flexarray_struct.in
new file mode 100644
index 00000000..40ee1ddd
--- /dev/null
+++ b/tests/core/test_flexarray_struct.in
@@ -0,0 +1,24 @@
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+typedef struct
+{
+ uint16_t length;
+ struct
+ {
+ int32_t int32;
+ } value[];
+} Tuple;
+
+int main() {
+ Tuple T[10];
+ Tuple *t = &T[0];
+
+ t->length = 4;
+ t->value->int32 = 100;
+
+ printf("(%d, %d)\n", t->length, t->value->int32);
+ return 0;
+}