OSDN Git Service

PR preprocessor/30805:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / sms-antideps.c
1 /*  This test is a reduced test case for a bug that caused
2     bootstrapping with -fmodulo-sched.  Related to a broken anti-dep
3     that was not fixed by reg-moves.  */
4
5  /* { dg-do run } */
6  /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves" } */
7
8 #include <stdlib.h>
9
10 unsigned long long
11 foo (long long ixi, unsigned ctr)
12 {
13   unsigned long long irslt = 1;
14   long long ix = ixi;
15
16   for (; ctr; ctr--)
17     {
18       irslt *= ix;
19       ix *= ix;
20     }
21
22   if (irslt != 14348907)
23     abort ();
24   return irslt;
25 }
26
27
28 int
29 main ()
30 {
31   unsigned long long res;
32
33   res = foo (3, 4);
34   return 0;
35 }
36
37
38