Module Name: src
Committed By: christos
Date: Sun Oct 4 15:12:42 UTC 2009
Added Files:
src/regress/usr.bin/xlint/lint1: test26.c
Log Message:
add packed tests.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/regress/usr.bin/xlint/lint1/test26.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: src/regress/usr.bin/xlint/lint1/test26.c
diff -u /dev/null src/regress/usr.bin/xlint/lint1/test26.c:1.1
--- /dev/null Sun Oct 4 11:12:42 2009
+++ src/regress/usr.bin/xlint/lint1/test26.c Sun Oct 4 11:12:41 2009
@@ -0,0 +1,35 @@
+/* packed tests */
+
+struct in_addr {
+ int x;
+};
+struct ip_timestamp {
+ char ipt_code;
+ char ipt_len;
+ char ipt_ptr;
+ unsigned int ipt_flg:4,
+ ipt_oflw:4;
+ union ipt_timestamp {
+ int ipt_time[1];
+ struct ipt_ta {
+ struct in_addr ipt_addr;
+ int ipt_time;
+ } ipt_ta[1] __packed;
+ } ipt_timestamp __packed;
+} __packed;
+
+typedef struct __packed {
+ int x;
+} t;
+
+struct x {
+ char c;
+ long l;
+} __packed;
+
+struct y {
+ char c;
+ long l;
+};
+
+int a[sizeof(struct y) - sizeof(struct x) - 1];