aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Heckel <bernhard.heckel@intel.com>2016-04-15 11:03:42 +0200
committerBernhard Heckel <bernhard.heckel@intel.com>2016-04-18 13:52:43 +0200
commita14d1f4dfc08edc8fe92b17b36a55d89203fb89f (patch)
treeb1911da618d10fa734ae6ece35e29041642c3bf4
parentcdf969539c718acb1f3f031b2c55d5274a538717 (diff)
downloadgdb-a14d1f4dfc08edc8fe92b17b36a55d89203fb89f.zip
gdb-a14d1f4dfc08edc8fe92b17b36a55d89203fb89f.tar.gz
gdb-a14d1f4dfc08edc8fe92b17b36a55d89203fb89f.tar.bz2
testsuite: Support detection of Intel compilers via test_compiler_version.
Add Intel specific preprocessor macros to query the version of the compiler. 2016-04-18 Bernhard Heckel <bernhard.heckel@intel.com> gdb/Testsuite/Changelog: * lib/compiler.c: Add Intel specific preprocessor macros. * lib/compiler.cc: Likewise.
-rw-r--r--gdb/testsuite/ChangeLog5
-rwxr-xr-x[-rw-r--r--]gdb/testsuite/lib/compiler.c12
-rwxr-xr-x[-rw-r--r--]gdb/testsuite/lib/compiler.cc12
3 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index bd75ac7..fd393ef 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-18 Bernhard Heckel <bernhard.heckel@intel.com>
+
+ * lib/compiler.c: Add Intel specific preprocessor macros.
+ * lib/compiler.cc: Likewise.
+
2016-04-13 Luis Machado <lgustavo@codesourcery.com>
* gdb.server/connect-with-no-symbol-file.c: New file.
diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c
index f2e3062..408435d 100644..100755
--- a/gdb/testsuite/lib/compiler.c
+++ b/gdb/testsuite/lib/compiler.c
@@ -56,3 +56,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
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
index 39761ff..dbe2c6f 100644..100755
--- 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