1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2002-2019 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/>. */
25 void keepalive_float (double *var
) { }
26 void keepalive_int (int *var
) { }
27 void keepalive_aggregate (struct aggregate
*var
) { }
29 #define PREFIXIFY(PREFIX, VAR) \
32 #define DEF_STATICS(PREFIX) \
33 static int PREFIXIFY(PREFIX, s_var_int) = 4; \
34 static double PREFIXIFY(PREFIX, s_var_float) = 3.14f; \
35 static struct aggregate PREFIXIFY(PREFIX, s_var_aggregate) \
38 keepalive_int (&PREFIXIFY(PREFIX, s_var_int)); \
39 keepalive_float (&PREFIXIFY(PREFIX, s_var_float)); \
40 keepalive_aggregate (&PREFIXIFY(PREFIX, s_var_aggregate));
50 static void static_inline_method ()
57 void method () volatile;
58 void method () volatile const;
60 static void static_method ();
66 const volatile S cv_s
= {};
87 S::method () const volatile
102 static void static_method ();
104 void inline_method ()
109 static void static_inline_method ()
111 DEF_STATICS (S2_SIM
);
124 S2
<T
>::static_method ()
140 free_inline_func (void)
148 for (int i
= 0; i
< 1000; i
++)
160 S::static_inline_method ();
164 S2
<int>::static_method ();
165 S2
<int>::static_inline_method ();