summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C55
1 files changed, 55 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 100644
index 000000000..821038ef6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/code-gen6.C
@@ -0,0 +1,55 @@
+// { dg-do run }
+// GROUPS passed code-generation
+// Check that type float parameters can be correctly passed to
+// methods.
+
+extern "C" int printf (const 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"); return 1; }
+ 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;
+}