summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr52445.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr52445.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr52445.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr52445.c b/gcc/testsuite/gcc.dg/pr52445.c
new file mode 100644
index 000000000..0977821a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr52445.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/52445 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-cselim -fdump-tree-cselim" } */
+
+void
+foo (char *buf, unsigned long len)
+{
+ buf[0] = '\n';
+ if (len > 1)
+ buf[1] = '\0'; /* We can't cselim "optimize" this, while
+ buf[0] doesn't trap, buf[1] could. */
+}
+
+/* { dg-final { scan-tree-dump-not "cstore\." "cselim" } } */
+/* { dg-final { cleanup-tree-dump "cselim" } } */