teak-llvm/lldb/lit/tools/lldb-instr/Inputs/foo.cpp
Jonas Devlieghere 306809f292 [Reproducers] Capture return values of functions returning by ptr/ref
For some reason I had convinced myself that functions returning by
pointer or reference do not require recording their result. However,
after further considering I don't see how that could work, at least not
with the current implementation. Interestingly enough, the reproducer
instrumentation already (mostly) accounts for this, though the
lldb-instr tool did not.

This patch adds the missing macros and updates the lldb-instr tool.

Differential revision: https://reviews.llvm.org/D60178

llvm-svn: 357639
2019-04-03 21:31:22 +00:00

27 lines
620 B
C++

#include "foo.h"
#define MACRO_FOO \
{ void; }
#define MACRO_BAR(B) B
Foo::Foo() {}
void Foo::A() {}
void Foo::B(int i) {}
int Foo::C(int i) { return i; }
int Foo::D(bool b) const { return 1; }
void Foo::E() {}
int Foo::F(int i) { return i; }
void Foo::G(const char *fmt...) {}
Foo Foo::H() { return Foo(); }
void Foo::I() const { MACRO_FOO; }
Bar Foo::J() const { return MACRO_BAR(Bar()); }
Bar Foo::K(void *v) const { return Bar(); }
Bar &Foo::L() const {
Bar *b = new Bar();
return *b;
};
Bar *Foo::M() const {
Bar *b = new Bar();
return b;
};