OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20040219-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Testing save/restore of floating point caller-save registers, on ia64
2
   this resulted in bad code.  Not all targets will use caller-save regs.  */
3
 
4
/* { dg-do run } */
5
/* { dg-options "-O2" } */
6
/* { dg-options "-O2 -minline-float-divide-max-throughput" { target ia64-*-* } } */
7
 
8
/* Testing save/restore of floating point caller-save registers on ia64.  */
9
 
10
extern void abort (void);
11
 
12
double foo(double a, double b, double c)
13
{
14
        return (a+b+c);
15
}
16
 
17
main ()
18
{
19
        double  f1, f2, f3, f4, f5, f6, f7, f8, f9,f10;
20
        double f11,f12,f13,f14,f15,f16,f17,f18,f19,f20;
21
        double f21,f22,f23,f24,f25,f26,f27,f28,f29,f30;
22
        double x;
23
        int i,j,k;
24
 
25
        f1  = 0.1; f2  = 0.2; f3  = 0.3; f4  = 0.4; f5  = 0.5;
26
        f6  = 0.6; f7  = 0.7; f8  = 0.8; f9  = 0.9; f10 = 1.0;
27
        f11 = 1.1; f12 = 1.2; f13 = 1.3; f14 = 1.4; f15 = 1.5;
28
        f16 = 1.6; f17 = 1.7; f18 = 1.8; f19 = 1.9; f20 = 2.0;
29
        f21 = 2.1; f22 = 2.2; f23 = 2.3; f24 = 2.4; f25 = 2.5;
30
        f26 = 2.6; f27 = 2.7; f28 = 2.8; f29 = 2.9; f30 = 3.0;
31
 
32
        i = (int) foo(1.0,1.0,1.0);
33
        while (i > 0) {
34
                f1  = f2  / f3  * f30;
35
                f2  = f3  / f4  * f30;
36
                f3  = f4  / f5  * f30;
37
                f4  = f5  / f6  * f30;
38
                f5  = f6  / f7  * f30;
39
                f6  = f7  / f8  * f30;
40
                f7  = f8  / f9  * f30;
41
                f8  = f9  / f10 * f30;
42
                f9  = f10 / f11 * f30;
43
                f10 = f11 / f12 * f30;
44
                f11 = f12 / f13 * f30;
45
                f12 = f13 / f14 * f25;
46
                f13 = f14 / f15 * f30;
47
                f14 = f15 / f16 * f30;
48
                f15 = f16 / f17 * f30;
49
                f16 = f17 / f18 * f30;
50
                f17 = f18 / f19 * f30;
51
                f18 = f19 / f20 * f30;
52
                f19 = f20 / f21 * f30;
53
                f20 = f21 / f22 * f20;
54
                f21 = f22 / f23 * f30;
55
                f22 = f23 / f24 * f30;
56
                f23 = f24 / f25 * f30;
57
                f24 = f25 / f26 * f30;
58
                f25 = f26 / f27 * f30;
59
                f26 = f27 / f28 * f30;
60
                f27 = f28 / f29 * f30;
61
                f28 = f29 / f30 * f30;
62
                f29 = f30 / f1  * f30;
63
                f30 = f1  / f2  * f30;
64
                x = foo(f1,f2,f3);
65
                i = i - 1;
66
        }
67
        x = (f1+f2+f3+f4+f5+f6+f7+f8+f9+f10) *
68
            (f11+f12+f13+f14+f15+f16+f17+f18+f19+f20) *
69
            (f21+f22+f23+f24+f25+f26+f27+f28+f29+f30);
70
 
71
        /* Exact value is not needed, on IA64 it is massively off. */
72
        if (x < 19503.0 || x > 19504.0) abort();
73
        return 0;
74
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.