aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c b/gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c
new file mode 100644
index 000000000..b4bcf3b10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/pr54486.c
@@ -0,0 +1,33 @@
+/* PR middle-end/54486 */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+/* { dg-skip-if "no POSIX printf" { *-*-mingw* } { "*" } { "" } } */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef __SIZE_TYPE__ size_t;
+extern int printf (const char *, ...);
+extern size_t strspn (const char *, const char *);
+extern size_t strcspn (const char *, const char *);
+extern size_t strlen (const char *);
+#ifdef __cplusplus
+}
+#endif
+
+void
+foo (void)
+{
+ printf ("%zu\n", strspn ("abc", "abcdefg"));
+ printf ("%zu\n", (size_t) strspn ("abc", "abcdefg"));
+ printf ("%zu\n", __builtin_strspn ("abc", "abcdefg"));
+ printf ("%zu\n", (size_t) __builtin_strspn ("abc", "abcdefg"));
+ printf ("%zu\n", strcspn ("abc", "abcdefg"));
+ printf ("%zu\n", (size_t) strcspn ("abc", "abcdefg"));
+ printf ("%zu\n", __builtin_strcspn ("abc", "abcdefg"));
+ printf ("%zu\n", (size_t) __builtin_strcspn ("abc", "abcdefg"));
+ printf ("%zu\n", strlen ("abc"));
+ printf ("%zu\n", (size_t) strlen ("abc"));
+ printf ("%zu\n", __builtin_strlen ("abc"));
+ printf ("%zu\n", (size_t) __builtin_strlen ("abc"));
+}