aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wstringop-overflow-84.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstringop-overflow-84.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-84.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-84.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-84.c
new file mode 100644
index 0000000..2c0f507
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-84.c
@@ -0,0 +1,15 @@
+/* PR middle-end/102960 - ICE: in sign_mask, at wide-int.h:855 in GCC 10.3.0
+ { dg-do compile }
+ { dg-options "-Og -Wall" } */
+
+void f (int i)
+{
+ const char *s;
+ if (i)
+ s = &"abcd"[i];
+
+ __builtin_printf ("%s", s);
+}
+
+/* The use of s in the call to sprintf should result in:
+ { dg-prune-output "-Wmaybe-uninitialized" } */