diff options
author | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-06 01:47:28 -0800 |
commit | be8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch) | |
tree | 726e2468c0c07add773c0dbd86ab6386844259ae /gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C |
initial commit
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C new file mode 100755 index 0000000..ea5d730 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C @@ -0,0 +1,54 @@ +// GROUPS passed code-generation +// Check that type float parameters can be correctly passed to +// methods. + +extern "C" void printf (char *, ...); + +class tres_floats { + float ff1; + float ff2; + float ff3; +public: + tres_floats (float f1, float f2, float f3); + float get_f1 (); + float get_f2 (); + float get_f3 (); +}; + +float v1 = 1.2345; +float v2 = 3.14159; +float v3 = 0.707; + +int main () +{ + tres_floats tf (v1, v2, v3); + + if ((tf.get_f1() != v1) || (tf.get_f2() != v2) || (tf.get_f3() != v3)) + printf ("FAIL\n"); + else + printf ("PASS\n"); + + return 0; +} + +tres_floats::tres_floats (float f1, float f2, float f3) +{ + ff1 = f1; + ff2 = f2; + ff3 = f3; +} + +float tres_floats::get_f1 () +{ + return ff1; +} + +float tres_floats::get_f2 () +{ + return ff2; +} + +float tres_floats::get_f3 () +{ + return ff3; +} |