testsuite, cp: increase the coverage of testing pass-by-ref arguments
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Fri, 20 Dec 2019 16:43:07 +0000 (17:43 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Fri, 20 Dec 2019 16:43:07 +0000 (17:43 +0100)
commitc855a9125ade61c046091373bafdae0c719118e0
tree334b33314162c04803fe504a508c52e0724222e7
parent099a6354dab7e74c990501929f383394fc8efd02
testsuite, cp: increase the coverage of testing pass-by-ref arguments

Extend testcases for GDB's infcall of call-by-value functions that
take aggregate values as parameters.  In particular, existing test has
been substantially extended with class definitions whose definitions
of copy constructor, destructor, and move constructor functions are a
combination of

(1) explicitly defined by the user,
(2) defaulted inside the class declaration,
(3) defaulted outside the class declaration,
(4) deleted
(5) not defined in the source.

For each combination, a small and a large class is generated as well
as a derived class and a container class.  Additionally, the following
manually-written cases are provided:

- a dynamic class (i.e. class with a virtual method)
- classes that contain an array field
- a class whose copy ctor is inlined
- a class whose destructor is deleted
- classes with multiple copy and/or move ctors

Test cases check whether GDB makes the right decision to pass an
object by value or implicitly by reference, whether really a copy of
the argument is passed, and whether the copy constructor and
destructor of the clone of the argument are invoked properly.

The input program pass-by-ref.cc is generated in the test's output
directory.  The input program pass-by-ref-2.cc is manually-written.

Tests have been verified on the X86_64 architecture with
GCC 7.4.0, 8.2.0, and 9.2.1.

gdb/testsuite/ChangeLog:
2019-12-20  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

* gdb.cp/pass-by-ref.cc: Delete.  Generated in the output
directory instead.
* gdb.cp/pass-by-ref.exp: Extend with more cases.
* gdb.cp/pass-by-ref-2.cc: New file.
* gdb.cp/pass-by-ref-2.exp: New file.

Change-Id: Ie8ab1f260c6ad5ee4eb34b2c1597ce24af04abb6
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/pass-by-ref-2.cc [new file with mode: 0644]
gdb/testsuite/gdb.cp/pass-by-ref-2.exp [new file with mode: 0644]
gdb/testsuite/gdb.cp/pass-by-ref.cc [deleted file]
gdb/testsuite/gdb.cp/pass-by-ref.exp
This page took 0.02724 seconds and 4 git commands to generate.