ignore invalid DOF provider sections
[binutils-gdb.git] / gdb / testsuite / gdb.cp / non-trivial-retval.cc
blob2f45592a829951a4be190fc17eecfaaf810a8167
1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2014-2015 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 class A
20 public:
21 A () {}
22 A (A &obj);
24 int a;
27 A::A(A &obj)
29 a = obj.a;
33 f1 (int i1, int i2)
35 A a;
37 a.a = i1 + i2;
39 return a;
42 class B
44 public:
45 B () {}
46 B (const B &obj);
48 int b;
51 B::B(const B &obj)
53 b = obj.b;
57 f2 (int i1, int i2)
59 B b;
61 b.b = i1 + i2;
63 return b;
66 class B1
68 public:
69 B1 () {}
70 /* This class exists to test that GDB does not trip on other
71 constructors (not copy constructors) which take one
72 argument. Hence, put this decl before the copy-ctor decl.
73 If it is put after copy-ctor decl, then the decision to mark
74 this class as non-trivial will already be made and GDB will
75 not look at this constructor. */
76 B1 (int i);
77 B1 (const B1 &obj);
79 int b1;
82 B1::B1 (const B1 &obj)
84 b1 = obj.b1;
87 B1::B1 (int i) : b1 (i) { }
90 f22 (int i1, int i2)
92 B1 b1;
94 b1.b1 = i1 + i2;
96 return b1;
99 class C
101 public:
102 virtual int method ();
104 int c;
108 C::method ()
110 return c;
114 f3 (int i1, int i2)
116 C c;
118 c.c = i1 + i2;
120 return c;
123 class D
125 public:
126 int d;
129 class E : public virtual D
131 public:
132 int e;
136 f4 (int i1, int i2)
138 E e;
140 e.e = i1 + i2;
142 return e;
146 main (void)
148 int i1 = 23;
149 int i2 = 100;
151 return 0; /* Break here */