aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_flexarray_struct.in
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-12 10:51:45 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-12 10:51:45 -0800
commitae3605d437ffe2d764d924458e46da5b6592740c (patch)
tree2a05d3921da6c36fb5f6da573b4402b53e44606c /tests/core/test_flexarray_struct.in
parentafd5b08108f13349379f2dd58f2304edd6bbf0a8 (diff)
parent04a42801d532c40c2c8f75c778bc6bc599601e32 (diff)
Merge pull request #1903 from ehostunreach/incoming
Read the source and the expected output of simple core tests from seperate files
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;
+}