OSDN Git Service

PR middle-end/29274
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / arm / pr42093.c
1 /* { dg-options "-mthumb -O2" }  */
2 /* { dg-require-effective-target arm_thumb2_ok } */
3 /* { dg-final { scan-assembler-not "tbb" } } */
4 /* { dg-final { scan-assembler-not "tbh" } } */
5
6 #include <stdlib.h>
7
8 int gbl;
9 int foo (int *buf, int n)
10 {
11   int ctr = 0;
12   int c;
13   while (1)
14     {
15       c = buf[ctr++];
16       switch (c)
17         {
18         case '\n':
19           gbl++;
20           break;
21
22         case ' ': case '\t' : case '\f' : case '\r':
23           break;
24
25         case ';':
26           do
27             c = buf [ctr++];
28           while (c != '\n' && c != -1);
29           gbl++;
30           break;
31
32         case '/':
33           {
34             int prevc;
35             c = buf [ctr++];
36             if (c != '*')
37               abort ();
38
39             prevc = 0;
40             while ((c = buf[ctr++]) && c != -1)
41               {
42                 if (c == '\n')
43                   gbl++;
44               }
45             break;
46           }
47         default:
48           return c;
49         }
50     }
51 }