xref: /aosp_15_r20/external/elfutils/tests/funcretval_test++11.cxx (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1 /* Copyright (C) 2023 IBM Corporation
2    This file is part of elfutils.
3 
4    This file is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
8 
9    elfutils is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
16 
17 #include <utility>
18 
19 int &
foo()20 foo ()
21 {
22   static int tmp;
23   return tmp;
24 }
25 
26 int &&
bar()27 bar ()
28 {
29   static int tmp;
30   return std::move(tmp);
31 }
32 
33 int
main()34 main ()
35 {
36   return 0;
37 }
38