aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/loop-unswitch-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/loop-unswitch-1.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-1.c b/gcc/testsuite/gcc.dg/loop-unswitch-1.c
new file mode 100644
index 0000000..930364c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-unswitch-1.c
@@ -0,0 +1,34 @@
+/* For PR rtl-optimization/27735 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops" } */
+
+void set_color(void);
+void xml_colorize_line(unsigned int *p, int state)
+{
+ int c;
+ switch(state)
+ {
+ case 1:
+ goto parse_tag;
+ case 2:
+ goto parse_comment;
+ }
+
+ for(;;)
+ {
+ c = *p;
+ if (c == '<' && state == 0)
+ {
+parse_comment: ;
+ while (*p != '\n')
+ state = 3;
+parse_tag: ;
+ while (*p != '\n')
+ state = 0;
+ set_color();
+ }
+ else
+ p++;
+ }
+}
+