1 // RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
2 // RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out
3 // RUN: %test_debuginfo %s %t.out
4 // Radar 8775834
5 // DEBUGGER: break 62
6 // DEBUGGER: r
7 // DEBUGGER: p a
8 // CHECK: ${{[0-9]+}} =
9 // LLDB does not print artificial members.
10 // CHECK:  {{(_vptr\$A =)?.*}}m_int = 12
11 
12 class A
13 {
14 public:
15     A (int i=0);
16     A (const A& rhs);
17     const A&
18     operator= (const A& rhs);
~A()19     virtual ~A() {}
20 
21     int get_int();
22 
23 protected:
24     int m_int;
25 };
26 
A(int i)27 A::A (int i) :
28     m_int(i)
29 {
30 }
31 
A(const A & rhs)32 A::A (const A& rhs) :
33     m_int (rhs.m_int)
34 {
35 }
36 
37 const A &
operator =(const A & rhs)38 A::operator =(const A& rhs)
39 {
40     m_int = rhs.m_int;
41     return *this;
42 }
43 
get_int()44 int A::get_int()
45 {
46     return m_int;
47 }
48 
49 class B
50 {
51 public:
B()52     B () {}
53 
54     A AInstance();
55 };
56 
57 A
AInstance()58 B::AInstance()
59 {
60     A a(12);
61     return a;
62 }
63 
main(int argc,char const * argv[])64 int main (int argc, char const *argv[])
65 {
66     B b;
67     int return_val = b.AInstance().get_int();
68 
69     A a(b.AInstance());
70     return return_val;
71 }
72