gdb/testsuite: use test_compiler_info in gcc_major_version
authorNils-Christian Kempke <nils-christian.kempke@intel.com>
Tue, 7 Jun 2022 10:16:36 +0000 (12:16 +0200)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 9 Jun 2022 13:40:48 +0000 (14:40 +0100)
commit61ee7510b3fa24ca48b6c053c4fad5916a6b01ff
tree0d9730a2f04d7698534804019a09222c1524fdcc
parent8f4141b0aef3ca513969ff2605f93d07301810e3
gdb/testsuite: use test_compiler_info in gcc_major_version

The procedure gcc_major_version was earlier using the global variable
compiler_info to retrieve gcc's major version.  This is discouraged and
(as can be read in a comment in compiler.c) compiler_info should be
local to get_compiler_info and test_compiler_info.

The preferred way of getting the compiler string is via calling
test_compiler_info without arguments.  Gcc_major_version was changed to
do that.
gdb/testsuite/lib/gdb.exp