]> Git Repo - binutils.git/blob - gdb/testsuite/lib/compiler.F90
Automatic date update in version.in
[binutils.git] / gdb / testsuite / lib / compiler.F90
1 /* Copyright 2022 Free Software Foundation, Inc.
2
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2 of the License, or
6    (at your option) any later version.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
15
16 set compiler_info "unknown"
17
18 #if defined (__GFORTRAN__)
19 set compiler_info [join {gfortran __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__} -]
20 #endif
21
22 /* ARM seems to not define a patch version.  */
23 #if defined (__ARM_LINUX_COMPILER__)
24 set compiler_info [join {armflang __armclang_major__ __armclang_minor__ 0} -]
25 #endif
26
27 /* Classic flang and LLVM flang emit their respective macros differently.  */
28
29 /* LLVM flang complains about non Fortran tokens so we do not use "{" here.  */
30 #if defined (__flang__)
31 set major __flang_major__
32 set minor __flang_minor__
33 set patch __flang_patchlevel__
34 set compiler_info [join "flang-llvm $major $minor $patch" -]
35 #endif
36
37 /* Classic Flang.  */
38 #if defined (__FLANG)
39 set compiler_info [join {flang-classic __FLANG_MAJOR__ __FLANG_MINOR__ __FLANG_PATCHLEVEL__} -]
40 #endif
41
42 /* Intel LLVM emits a string like 20220100 with version 2021.2.0 and higher.  */
43 #if defined (__INTEL_LLVM_COMPILER)
44 set major [string range __INTEL_LLVM_COMPILER 0 3]
45 set minor [string range __INTEL_LLVM_COMPILER 4 5]
46 set patch [string range __INTEL_LLVM_COMPILER 6 7]
47 set compiler_info [join "ifx $major $minor $patch" -]
48 #elif defined (__INTEL_COMPILER)
49 /* Starting with 2021 the ifort versioning scheme changed.  Before, Intel ifort
50    would define its version as e.g. 19.0.0 or rather __INTEL_COMPILER would be
51    emitted as 1900.  With 2021 the versioning became e.g. 2021.1 defined in
52    __INTEL_COMPILER.__INTEL_COMPILER_UPDATE.  No patch is emitted since the
53    change.  This compiler identification might not work with ifort versions
54    smaller than 10.  */
55 #if (__INTEL_COMPILER < 2021)
56 set major [string range __INTEL_COMPILER 0 1]
57 set minor [string range __INTEL_COMPILER 2 2]
58 #if defined (__INTEL_COMPILER_UPDATE)
59 set patch __INTEL_COMPILER_UPDATE
60 #else
61 set patch [string range __INTEL_COMPILER 3 3]
62 #endif
63 #else
64 set major __INTEL_COMPILER
65 set minor __INTEL_COMPILER_UPDATE
66 set patch 0
67 #endif
68 set compiler_info [join "ifort $major $minor $patch" -]
69 #endif
This page took 0.02705 seconds and 4 git commands to generate.