aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Wduplicated-branches-14.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wduplicated-branches-14.c')
-rw-r--r--gcc/testsuite/c-c++-common/Wduplicated-branches-14.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/Wduplicated-branches-14.c b/gcc/testsuite/c-c++-common/Wduplicated-branches-14.c
new file mode 100644
index 0000000..81be1ac
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wduplicated-branches-14.c
@@ -0,0 +1,16 @@
+/* PR c/85094 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -Wduplicated-branches -g" } */
+
+extern int g;
+
+void
+foo (int r)
+{
+ if (r < 64)
+ g -= 48;
+ else if (r < 80) /* { dg-warning "this condition has identical branches" } */
+ g -= 64 - 45;
+ else
+ g -= 80 - 61;
+}