PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr54985.c
blob678c9f47ae735c86678113cef6bc51f67c295e52
2 typedef struct st {
3 int a;
4 } ST;
6 int __attribute__((noinline,noclone))
7 foo(ST *s, int c)
9 int first = 1;
10 int count = c;
11 ST *item = s;
12 int a = s->a;
13 int x;
15 while (count--)
17 x = item->a;
18 if (first)
19 first = 0;
20 else if (x >= a)
21 return 1;
22 a = x;
23 item++;
25 return 0;
28 extern void abort (void);
30 int main ()
32 ST _1[2] = {{2}, {1}};
33 if (foo(_1, 2) != 0)
34 abort ();
35 return 0;