aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.perf/gmonster1.exp
blob: 2132e3d300141c82f857d7b97adf093bc8983fd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (C) 2015-2019 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Perftest description file for building the "gmonster1" benchmark.
# Where does the name come from?  The benchmark is derived from one of the
# monster programs at Google.
#
# Perftest descriptions are loaded thrice:
# 1) To generate the build .exp files
#    GDB_PERFTEST_MODE=gen-build-exps
#    This step allows for parallel builds of the majority of pieces of the
#    test binary and shlibs.
# 2) To compile the "pieces" of the binary and shlibs.
#    "Pieces" are the bulk of the machine-generated sources of the test.
#    This step is driven by lib/build-piece.exp.
#    GDB_PERFTEST_MODE=build-pieces
# 3) To perform the final link of the binary and shlibs.
#    GDB_PERFTEST_MODE=compile
#
# Example usage:
# bash$ make -j5 build-perf RUNTESTFLAGS="gmonster1.exp gmonster2.exp"
# bash$ make check-perf RUNTESTFLAGS="gdb.perf/gm*-*.exp GDB=/path/to/gdb"

load_lib perftest.exp
load_lib gen-perf-test.exp

if [skip_perf_tests] {
    return 0
}

if ![info exists MONSTER] {
    set MONSTER "n"
}

proc make_testcase_config { } {
    global MONSTER

    set program_name "gmonster1"
    array set testcase [GenPerfTest::init_testcase $program_name]

    set testcase(language) c++

    # *_{sources,headers} need to be embedded in an outer list
    # because remember each element of the outer list is for each run, and
    # here we want to use the same value for all runs.
    set testcase(binary_extra_sources) { { gmonster1.cc gm-hello.cc gm-use-cerr.cc gm-pervasive-typedef.cc } }
    set testcase(binary_extra_headers) { { <stdint.h> gm-utils.h gm-std.h gm-pervasive-typedef.h } }
    set testcase(tail_shlib_sources) { { gm-std.cc } }
    set testcase(tail_shlib_headers) { { gm-std.h } }

    if { $MONSTER == "y" } {
	set testcase(run_names) { 10-cus 100-cus 1000-cus 10000-cus }
	set testcase(nr_compunits) { 10 100 1000 10000 }
    } else {
	set testcase(run_names) { 1-cu 10-cus 100-cus }
	set testcase(nr_compunits) { 1 10 100 }
    }
    set testcase(nr_gen_shlibs) { 0 }

    set testcase(nr_extern_globals) 10
    set testcase(nr_static_globals) 10
    set testcase(nr_extern_functions) 10
    set testcase(nr_static_functions) 10

    # class_specs needs to be embedded in an outer list because remember
    # each element of the outer list is for each run, and here we want to use
    # the same value for all runs.
    set testcase(class_specs) { {
	{
	    count 1 name { class }
	    nr_members 10 nr_static_members 10
	    nr_methods 10 nr_static_methods 10
	    nr_inline_methods 10 nr_static_inline_methods 10
	}
	{
	    count 1 name { ns0 class }
	    nr_members 10 nr_static_members 10
	    nr_methods 10 nr_static_methods 10
	    nr_inline_methods 10 nr_static_inline_methods 10
	}
	{
	    count 1 name { ns0 anonymous aclass }
	    nr_members 10 nr_static_members 10
	    nr_methods 10 nr_static_methods 10
	    nr_inline_methods 10 nr_static_inline_methods 10
	}
	{
	    count 1 name { ns0 ns1 class }
	    nr_members 10 nr_static_members 10
	    nr_methods 10 nr_static_methods 10
	    nr_inline_methods 10 nr_static_inline_methods 10
	}
	{
	    count 1 name { ns0 anonymous ns1 aclass }
	    nr_members 10 nr_static_members 10
	    nr_methods 10 nr_static_methods 10
	    nr_inline_methods 10 nr_static_inline_methods 10
	}
    } }

    return [array get testcase]
}

GenPerfTest::standard_compile_driver gmonster1.exp make_testcase_config