OSDN Git Service

cp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.brendan / code-gen6.C
1 // { 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 }