OSDN Git Service

PR target/6428
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20001102-1.c
1 /* ??? It'd be nice to run this for sparc32 as well, if we could know
2    for sure that we're on an ultrasparc, rather than an older cpu.  */
3 /* { dg-do run { target sparcv9-*-* sparc64-*-* } } */
4 /* { dg-options "-O2 -m32 -mcpu=ultrasparc -mvis" } */
5
6 int foo(double a, int b, int c, double *d, int h)
7 {
8   int f, g;
9   double e;
10
11 l:
12   f = (int) a;
13   a -= (double) f;
14   if (b == 1)
15     {
16       g = c;
17       f += g;
18       c -= g;
19     }
20   if (b == 2)
21     {
22       f++;
23       h = c;
24       goto l;
25     }
26
27   asm volatile ("" : : :
28                 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
29                 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
30                 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
31                 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31");
32
33   return f & 7;
34 }
35
36 int main()
37 {
38   if (foo(0.1, 1, 3, 0, 1) != 3)
39     abort ();
40   exit (0);
41 }