]> git.ozlabs.org Git - ccan/blobdiff - ccan/structeq/test/compile_fail-different.c
structeq: new module.
[ccan] / ccan / structeq / test / compile_fail-different.c
diff --git a/ccan/structeq/test/compile_fail-different.c b/ccan/structeq/test/compile_fail-different.c
new file mode 100644 (file)
index 0000000..9a08503
--- /dev/null
@@ -0,0 +1,22 @@
+#include <ccan/structeq/structeq.h>
+
+struct mydata1 {
+       int start, end;
+};
+
+struct mydata2 {
+       int start, end;
+};
+
+int main(void)
+{
+       struct mydata1 a = { 0, 100 };
+#ifdef FAIL
+       struct mydata2
+#else
+       struct mydata1
+#endif
+               b = { 0, 100 };
+
+       return structeq(&a, &b);
+}