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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [code-gen6.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// GROUPS passed code-generation
3
// Check that type float parameters can be correctly passed to
4
// methods.
5
 
6
extern "C" int printf (const char *, ...);
7
 
8
class tres_floats {
9
        float ff1;
10
        float ff2;
11
        float ff3;
12
public:
13
        tres_floats (float f1, float f2, float f3);
14
        float get_f1 ();
15
        float get_f2 ();
16
        float get_f3 ();
17
};
18
 
19
float v1 = 1.2345;
20
float v2 = 3.14159;
21
float v3 = 0.707;
22
 
23
int main ()
24
{
25
        tres_floats tf (v1, v2, v3);
26
 
27
        if ((tf.get_f1() != v1) || (tf.get_f2() != v2) || (tf.get_f3() != v3))
28
          { printf ("FAIL\n"); return 1; }
29
        else
30
          printf ("PASS\n");
31
 
32
        return 0;
33
}
34
 
35
tres_floats::tres_floats (float f1, float f2, float f3)
36
{
37
        ff1 = f1;
38
        ff2 = f2;
39
        ff3 = f3;
40
}
41
 
42
float tres_floats::get_f1 ()
43
{
44
        return ff1;
45
}
46
 
47
float tres_floats::get_f2 ()
48
{
49
        return ff2;
50
}
51
 
52
float tres_floats::get_f3 ()
53
{
54
        return ff3;
55
}

powered by: WebSVN 2.1.0

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