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