summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr83391.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr83391.C')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr83391.C36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr83391.C b/gcc/testsuite/g++.dg/torture/pr83391.C
new file mode 100644
index 00000000000..902d7fbcb74
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr83391.C
@@ -0,0 +1,36 @@
+// PR debug/83391
+// { dg-do compile }
+// { dg-options "-g" }
+// { dg-additional-options "-mbranch-cost=1" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } }
+
+unsigned char a;
+enum E { F, G, H } b;
+int c, d;
+
+void
+foo ()
+{
+ int e;
+ bool f;
+ E g = b;
+ while (1)
+ {
+ unsigned char h = a ? d : 0;
+ switch (g)
+ {
+ case 0:
+ f = h <= 'Z' || h >= 'a' && h <= 'z';
+ break;
+ case 1:
+ {
+ unsigned char i = h;
+ e = 0;
+ }
+ if (e || h)
+ g = H;
+ /* FALLTHRU */
+ default:
+ c = 0;
+ }
+ }
+}