Bernhard Heckel <bernhard.heckel@intel.com> writes:
Add Intel specific preprocessor macros to query the version of the compiler.
Looks you query the version of c/c++ compiler, and use it for fortran.
Can we assume that fortran compiler's version is the same as the c/c++
compiler version? In an extreme case, user can set c compiler to icc,
and set fortran compiler to gfortran.
Looks we've already had such assumption in ada, that is, we determine
ada compiler version by the c compiler, so I am OK to do the same for
fortran.
--- a/gdb/testsuite/lib/compiler.cc
+++ b/gdb/testsuite/lib/compiler.cc
@@ -44,3 +44,15 @@ set compiler_info [join {armcc __ARMCC_VERSION} -]
#if defined (__clang__)
set compiler_info [join {clang __clang_major__ __clang_minor__ __clang_patchlevel__} -]
#endif
+
+#if defined (__ICC)
+set icc_major [string range __ICC 0 1]
+set icc_minor [format "%d" [string range __ICC 2 [expr {[string length __ICC] -1}]]]
+set icc_update __INTEL_COMPILER_UPDATE
+set compiler_info [join "icc $icc_major $icc_minor $icc_update" -]
+#elif defined (__ICL)
+set icc_major [string range __ICL 0 1]
+set icc_minor [format "%d" [string range __ICL 2 [expr {[string length __ICL] -1}]]]
+set icc_update __INTEL_COMPILER_UPDATE
+set compiler_info [join "icc $icc_major $icc_minor $icc_update" -]
+#endif
Do we really need the change to compiler.cc? Since we query the info of
compilers for different languages through c compiler, we don't need the
change compiler.cc unless we need to know the compiler info in some c++
tests.