11c468f90Schristos /* This test script is part of GDB, the GNU debugger.
21c468f90Schristos 
3*1424dfb3Schristos    Copyright 1999-2020 Free Software Foundation, Inc.
41c468f90Schristos 
51c468f90Schristos    This program is free software; you can redistribute it and/or modify
61c468f90Schristos    it under the terms of the GNU General Public License as published by
71c468f90Schristos    the Free Software Foundation; either version 3 of the License, or
81c468f90Schristos    (at your option) any later version.
91c468f90Schristos 
101c468f90Schristos    This program is distributed in the hope that it will be useful,
111c468f90Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
121c468f90Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131c468f90Schristos    GNU General Public License for more details.
141c468f90Schristos 
151c468f90Schristos    You should have received a copy of the GNU General Public License
161c468f90Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
171c468f90Schristos 
181c468f90Schristos /* Tests for reference types with short type variables in GDB, based on
191c468f90Schristos    gdb.cp/ref-types.cc.  */
201c468f90Schristos 
211c468f90Schristos #include <utility>
221c468f90Schristos 
231c468f90Schristos int main2 ();
241c468f90Schristos 
251c468f90Schristos void
marker1()261c468f90Schristos marker1 ()
271c468f90Schristos {
281c468f90Schristos }
291c468f90Schristos 
301c468f90Schristos int
main()311c468f90Schristos main ()
321c468f90Schristos {
331c468f90Schristos   short t = -1;
341c468f90Schristos   short *pt;
351c468f90Schristos   short &&rrt = std::move (t);
361c468f90Schristos   pt = &rrt;
371c468f90Schristos 
381c468f90Schristos   short *&&rrpt = std::move (pt);
391c468f90Schristos   short at[4];
401c468f90Schristos   at[0] = 0;
411c468f90Schristos   at[1] = 1;
421c468f90Schristos   at[2] = 2;
431c468f90Schristos   at[3] = 3;
441c468f90Schristos 
451c468f90Schristos   short (&&rrat)[4] = std::move( at);
461c468f90Schristos 
471c468f90Schristos   marker1();
481c468f90Schristos 
491c468f90Schristos   main2();
501c468f90Schristos 
511c468f90Schristos   return 0;
521c468f90Schristos }
531c468f90Schristos 
541c468f90Schristos int
f()551c468f90Schristos f ()
561c468f90Schristos {
571c468f90Schristos   int f1;
581c468f90Schristos   f1 = 1;
591c468f90Schristos   return f1;
601c468f90Schristos }
611c468f90Schristos 
621c468f90Schristos int
main2()631c468f90Schristos main2 ()
641c468f90Schristos {
651c468f90Schristos   char &&rrC = 'A';
661c468f90Schristos   unsigned char &&rrUC = 21;
671c468f90Schristos   short &&rrS = -14;
681c468f90Schristos   unsigned short &&rrUS = 7;
691c468f90Schristos   int &&rrI = 102;
701c468f90Schristos   unsigned int &&rrUI = 1002;
711c468f90Schristos   long &&rrL = -234;
721c468f90Schristos   unsigned long &&rrUL = 234;
731c468f90Schristos   float &&rrF = 1.25E10;
741c468f90Schristos   double &&rrD = -1.375E-123;
751c468f90Schristos 
761c468f90Schristos   f ();
771c468f90Schristos 
781c468f90Schristos   return 0;
791c468f90Schristos }
80