10SN/A/* This testcase is part of GDB, the GNU debugger.
211628Sserb
30SN/A   Copyright 2012-2023 Free Software Foundation, Inc.
40SN/A
50SN/A   This program is free software; you can redistribute it and/or modify
60SN/A   it under the terms of the GNU General Public License as published by
72362SN/A   the Free Software Foundation; either version 3 of the License, or
80SN/A   (at your option) any later version.
92362SN/A
100SN/A   This program is distributed in the hope that it will be useful,
110SN/A   but WITHOUT ANY WARRANTY; without even the implied warranty of
120SN/A   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
130SN/A   GNU General Public License for more details.
140SN/A
150SN/A   You should have received a copy of the GNU General Public License
160SN/A   along with this program.  If not, see  <http://www.gnu.org/licenses/>.  */
170SN/A
180SN/Aclass A {
190SN/A public:
200SN/A  virtual ~A() { }
212362SN/A};
222362SN/A
232362SN/Aclass B : public A {
240SN/A public:
250SN/A  virtual ~B() { }
260SN/A
270SN/A  int i;
280SN/A  char c;
290SN/A};
300SN/A
310SN/Atypedef int *int_ptr;
320SN/A
330SN/Aint
340SN/Afunc (const A &a)
350SN/A{
360SN/A  int val = 10;
370SN/A  int &int_ref = val;
380SN/A  int_ptr ptr = &val;
390SN/A  int_ptr &int_ptr_ref = ptr;
400SN/A  B b;
410SN/A
420SN/A  b.i = 10;
4311628Sserb  b.c = 'a';
440SN/A
450SN/A  return 0; /* Break here.  */
460SN/A}
478155SN/A
480SN/Aint
490SN/Amain ()
500SN/A{
510SN/A  A obj;
520SN/A  return func (obj);
530SN/A}
540SN/A