From 22842ff63e28b86e0cd40a87186757b2525578f4 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 13 Apr 2014 00:48:45 -0700 Subject: [PATCH] Return by value to coax Clang into emitting the full definition of a test type. gdb/testsuite/ * gdb.cp/pr10728-x.cc: Return by value instead of pointer to coax Clang into emitting the definition of the type. * gdb.cp/pr10728-x.h: Ditto. * gdb.cp/pr10728-y.cc: Ditto. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.cp/pr10728-x.cc | 2 +- gdb/testsuite/gdb.cp/pr10728-x.h | 2 +- gdb/testsuite/gdb.cp/pr10728-y.cc | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 25bbc6a6849..92a7eee418d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-04-24 David Blaikie + + * gdb.cp/pr10728-x.cc (main::x): Return by value instead of pointer to + coax Clang into emitting the definition of the type. + * gdb.cp/pr10728-x.h (y): Ditto. + * gdb.cp/pr10728-y.cc (y): Ditto. + 2014-04-24 David Blaikie * gdb.base/label.exp: XFAIL label related tests under Clang. diff --git a/gdb/testsuite/gdb.cp/pr10728-x.cc b/gdb/testsuite/gdb.cp/pr10728-x.cc index 7623c0be028..d6b766669ef 100644 --- a/gdb/testsuite/gdb.cp/pr10728-x.cc +++ b/gdb/testsuite/gdb.cp/pr10728-x.cc @@ -2,6 +2,6 @@ int main() { - X* x = y(); + X x = y(); return 0; // marker 1 } diff --git a/gdb/testsuite/gdb.cp/pr10728-x.h b/gdb/testsuite/gdb.cp/pr10728-x.h index 63737d9bf65..0ba58bb3b54 100644 --- a/gdb/testsuite/gdb.cp/pr10728-x.h +++ b/gdb/testsuite/gdb.cp/pr10728-x.h @@ -5,5 +5,5 @@ struct X Y* y2; }; -X* y(); +X y(); diff --git a/gdb/testsuite/gdb.cp/pr10728-y.cc b/gdb/testsuite/gdb.cp/pr10728-y.cc index 84b222d712d..d8a932ab41f 100644 --- a/gdb/testsuite/gdb.cp/pr10728-y.cc +++ b/gdb/testsuite/gdb.cp/pr10728-y.cc @@ -1,11 +1,11 @@ #include "pr10728-x.h" struct Y{}; -X* y() +X y() { - static X xx; + X xx; static Y yy; xx.y1 = &yy; xx.y2 = xx.y1+1; - return &xx; + return xx; } -- 2.30.2