PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr40087.c
blob98d24378400430140a65d1af928ea518bf3cacb0
1 /* { dg-do run } */
2 /* { dg-options "-O1 -Wno-attributes" } */
4 extern void abort (void);
6 static void __attribute__((always_inline))
7 reverse(int *first, int *last)
9 if (first == last--)
10 return;
11 while (first != last)
13 int t = *first;
14 *first = *last;
15 *last = t;
16 if (++first == last--)
17 break;
21 int main()
23 int seq[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
25 reverse(seq, seq + 8);
26 if (seq[3] != 5 || seq[4] != 4)
27 abort ();
29 return 0;