2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / code-gen6.C
blob821038ef6f95ef2b3623ef07f94252e4e29b5e18
1 // { dg-do run  }
2 // GROUPS passed code-generation
3 // Check that type float parameters can be correctly passed to
4 // methods.
6 extern "C" int printf (const char *, ...); 
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 ();
19 float v1 = 1.2345;
20 float v2 = 3.14159;
21 float v3 = 0.707;
23 int main ()
25         tres_floats tf (v1, v2, v3);
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");
32         return 0;
35 tres_floats::tres_floats (float f1, float f2, float f3)
37         ff1 = f1;
38         ff2 = f2;
39         ff3 = f3;
42 float tres_floats::get_f1 ()
44         return ff1;
47 float tres_floats::get_f2 ()
49         return ff2;
52 float tres_floats::get_f3 ()
54         return ff3;