--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+typealias integer { size = 64; align = 8; signed = false; } := uint64_t;
+
+typedef uint32_t array_type[10];
+
+/* FAIL: type 'array_type' is already defined */
+typedef uint64_t array_type[10];
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: structure 'dummy2' is not yet defined */
+struct dummy1 {
+ uint32_t field1;
+ struct dummy2 field2;
+};
+
+struct dummy2 {
+ uint32_t field3;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: structure containing itself */
+struct dummy {
+ uint32_t field1;
+ struct dummy field2;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: reserved keywords used as fields */
+struct dummy {
+ uint32_t valid;
+ uint32_t callsite;
+ uint32_t env;
+ uint32_t stream;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+typealias integer { size = 64; align = 8; signed = false; } := uint64_t;
+
+/* Fail: duplicate typedef */
+typedef uint32_t myint;
+typedef uint64_t myint;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* Fail: cannot typedef a reserved keyword */
+typedef uint32_t int;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* PASS: struct should be aligned to 16 bits (follows the specified value). */
+struct dummy {
+ uint32_t field1;
+ uint32_t field2;
+ uint32_t field3;
+} align(16);
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/*
+ * PASS: struct should be aligned to 8 bits (fields' value is larger than the
+ * one specified by the struct).
+ */
+struct dummy {
+ uint32_t field1;
+ uint32_t field2;
+ uint32_t field3;
+} align(4);
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+struct dummy1 {
+ uint32_t field1;
+}
+
+/* PASS: Inner structure is defined earlier */
+struct dummy2 {
+ uint32_t field2;
+ struct dummy1 field3;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := int;
+
+/* PASS: unnamed struct type used as field */
+struct dummy {
+ int normal_field;
+ struct {
+ int sub_field1;
+ int sub_field2;
+ } x;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ int magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* PASS: 'field' and '_field' should be different fields */
+struct dummy {
+ uint32_t field;
+ uint32_t _field;
+ uint32_t __field;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* PASS: It's possible to typedef reserved keywords */
+typealias uint32_t := int;
+
+struct mystruct {
+ uint32_t field1;
+ int field2;
+};
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* PASS: straight typealias */
+typealias uint32_t := myint;
+
+struct mystruct {
+ uint32_t field1;
+ myint field2;
+};
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* PASS: straight typedef */
+typedef uint32_t myint;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};