Imported Upstream version 4.0.0+dfsg1
[abartlet/samba-debian.git] / lib / ccan / str / test / compile_fail-islower.c
diff --git a/lib/ccan/str/test/compile_fail-islower.c b/lib/ccan/str/test/compile_fail-islower.c
new file mode 100644 (file)
index 0000000..ca3f990
--- /dev/null
@@ -0,0 +1,22 @@
+#define CCAN_STR_DEBUG 1
+#include <ccan/str/str.h>
+
+int main(int argc, char *argv[])
+{
+#ifdef FAIL
+#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
+#error We need typeof to check islower.
+#endif
+       char
+#else
+       unsigned char
+#endif
+               c = argv[0][0];
+
+#ifdef FAIL
+       /* Fake fail on unsigned char platforms. */
+       BUILD_ASSERT((char)255 < 0);
+#endif
+
+       return islower(c);
+}