PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / arm / identical-invariants.c
blob089b527b49190281256e0af204051a71290aed1d
1 /* { dg-do compile { target { arm_thumb2_ok } } } */
2 /* { dg-options "-O2 -fdump-rtl-loop2_invariant " } */
4 int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
5 extern void foo2 (int *, int *, int *, int *, int *, int *);
6 extern int foo3 (int, int, int, int, int, int);
7 int foo (int a, int b, int c, int d)
9 int i = a;
11 for (; i > 0; i += b)
13 if (a > 0x1234567)
14 foo2 (&t1, &t2, &t3, &t4, &t5, &t6);
15 foo2 (&t1, &t2, &t3, &t4, &t5, &t6);
16 if (b > 0x1234567)
17 foo2 (&t7, &t2, &t8, &t4, &t5, &t6);
18 foo2 (&t1, &t2, &t3, &t4, &t5, &t6);
19 if (c > 0x1234567)
20 foo2 (&t1, &t9, &t10, &t4, &t5, &t6);
21 t2 = t5 - d;
24 return foo3 (t1, t2, t3, t4, t5, t6);
27 /* { dg-final { scan-rtl-dump "Decided to move invariant 0" "loop2_invariant" } } */