]> git.ozlabs.org Git - ccan/blobdiff - ccan/structeq/test/compile_fail-expect-padding.c
ccan/structeq: make it safe when there's padding.
[ccan] / ccan / structeq / test / compile_fail-expect-padding.c
diff --git a/ccan/structeq/test/compile_fail-expect-padding.c b/ccan/structeq/test/compile_fail-expect-padding.c
new file mode 100644 (file)
index 0000000..cec9f84
--- /dev/null
@@ -0,0 +1,19 @@
+#include <ccan/structeq/structeq.h>
+
+struct mydata {
+       int start, end;
+};
+#ifdef FAIL
+#define PADDING 1
+#else
+#define PADDING 0
+#endif
+
+STRUCTEQ_DEF(mydata, PADDING, start, end);
+
+int main(void)
+{
+       struct mydata a = { 0, 100 };
+
+       return mydata_eq(&a, &a);
+}