summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c')
-rw-r--r--contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
new file mode 100644
index 0000000..71b4384
--- /dev/null
+++ b/contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
@@ -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];
OpenPOWER on IntegriCloud