]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.perf/template-breakpoints.cc
1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright (C) 2018-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/>. */
20 template <int I
, int J
, int K
, int VAL
>
26 ThirdDimension
<I
, J
, K
- 1, VAL
> d3
;
31 template <int I
, int J
, int VAL
>
32 struct ThirdDimension
<I
, J
, 0, VAL
>
37 // Please note - this testcase sets a breakpoint on the following line.
38 // It is therefore sensitive to line numbers. If any changes are made to
39 // this file, please ensure that the testcase is updated to reflect this.
40 std::cout
<< "Value: " << VAL
<< std::endl
;
45 template <int I
, int J
, int K
, int VAL
>
46 struct SecondDimension
51 SecondDimension
<I
, J
- 1, K
, VAL
> d1
;
52 ThirdDimension
<I
, J
, K
, VAL
> d2
;
53 return d1
.value() + d2
.value();
57 template <int I
, int K
, int VAL
>
58 struct SecondDimension
<I
, 0, K
, VAL
>
63 ThirdDimension
<I
, 0, K
, VAL
> d2
;
68 template <int I
, int J
, int K
, int VAL
>
74 FirstDimension
<I
- 1, J
, K
, VAL
> d1
;
75 SecondDimension
<I
, J
, K
, VAL
> d2
;
76 return d1
.value() + d2
.value();
80 template <int J
, int K
, int VAL
>
81 struct FirstDimension
<0, J
, K
, VAL
>
86 SecondDimension
<0, J
, K
, VAL
> d2
;
92 main (int argc
, char *argv
[])
94 FirstDimension
<EXPANSION_DEPTH
, EXPANSION_DEPTH
, EXPANSION_DEPTH
, 1> product
;
95 std::cout
<< product
.value() << std::endl
;