Add new non-trial return value tests.
authorSiva Chandra <sivachandra@chromium.org>
Tue, 9 Sep 2014 13:46:14 +0000 (06:46 -0700)
committerSiva Chandra <sivachandra@chromium.org>
Wed, 15 Oct 2014 11:27:13 +0000 (04:27 -0700)
gdb/testsuite/ChangeLog:

* gdb.cp/non-trivial-retval.cc: Add new test cases.
* gdb.cp/non-trivial-retval.exp: Add new tests.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/non-trivial-retval.cc
gdb/testsuite/gdb.cp/non-trivial-retval.exp

index 2602e7f2a0911f4b91aabe5a4735b6b219cae8ea..c76146113f088fd7e4edaf6de36fcebefc77db33 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-15  Siva Chandra Reddy  <sivachandra@google.com>
+
+       * gdb.cp/non-trivial-retval.cc: Add new test cases.
+       * gdb.cp/non-trivial-retval.exp: Add new tests.
+
 2014-10-15  Siva Chandra Reddy  <sivachandra@google.com>
 
        PR c++/13403
index 4c7810b1bd9d4cd25ad4b8c517fd04d917a8142c..8382f40d0a22198fbdd1149c233f0a35c71573f5 100644 (file)
@@ -63,6 +63,52 @@ f2 (int i1, int i2)
   return b;
 }
 
+class C
+{
+public:
+  virtual int method ();
+
+  int c;
+};
+
+int
+C::method ()
+{
+  return c;
+}
+
+C
+f3 (int i1, int i2)
+{
+  C c;
+
+  c.c = i1 + i2;
+
+  return c;
+}
+
+class D
+{
+public:
+  int d;
+};
+
+class E : public virtual D
+{
+public:
+  int e;
+};
+
+E
+f4 (int i1, int i2)
+{
+  E e;
+
+  e.e = i1 + i2;
+
+  return e;
+}
+
 int
 main (void)
 {
index 976b99f8bfb8c3546650bb360596965ba4f4f798..793494685473832883c26a3259862cd0312ce9b5 100644 (file)
@@ -32,3 +32,5 @@ gdb_continue_to_breakpoint "Break here"
 
 gdb_test "p f1 (i1, i2)" ".* = {a = 123}" "p f1 (i1, i2)"
 gdb_test "p f2 (i1, i2)" ".* = {b = 123}" "p f2 (i1, i2)"
+gdb_test "p f3 (i1, i2)" ".* = {.* c = 123}" "p f3 (i1, i2)"
+gdb_test "p f4 (i1, i2)" ".* = {.* e = 123}" "p f4 (i1, i2)"
This page took 0.032347 seconds and 4 git commands to generate.