summaryrefslogtreecommitdiffstats
path: root/lib/ccan/str/test/compile_fail-strchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ccan/str/test/compile_fail-strchr.c')
-rw-r--r--lib/ccan/str/test/compile_fail-strchr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/ccan/str/test/compile_fail-strchr.c b/lib/ccan/str/test/compile_fail-strchr.c
new file mode 100644
index 00000000000..74a7314d06b
--- /dev/null
+++ b/lib/ccan/str/test/compile_fail-strchr.c
@@ -0,0 +1,18 @@
+#define CCAN_STR_DEBUG 1
+#include <ccan/str/str.h>
+
+int main(int argc, char *argv[])
+{
+#ifdef FAIL
+#if !HAVE_TYPEOF
+ #error We need typeof to check strstr.
+#endif
+#else
+ const
+#endif
+ char *ret;
+ const char *str = "hello";
+
+ ret = strchr(str, 'l');
+ return ret ? 0 : 1;
+}