summaryrefslogtreecommitdiffstats
path: root/lib/ccan/str/test/compile_fail-strrchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ccan/str/test/compile_fail-strrchr.c')
-rw-r--r--lib/ccan/str/test/compile_fail-strrchr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/ccan/str/test/compile_fail-strrchr.c b/lib/ccan/str/test/compile_fail-strrchr.c
new file mode 100644
index 00000000000..ba7d17e0319
--- /dev/null
+++ b/lib/ccan/str/test/compile_fail-strrchr.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 = strrchr(str, 'l');
+ return ret ? 0 : 1;
+}