From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 9F8A53858D35; Fri, 14 Jan 2022 14:32:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F8A53858D35 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: enable __INTEL_LLVM_COMPILER preprocessor in get_compiler_info X-Act-Checkin: binutils-gdb X-Git-Author: Nils-Christian Kempke X-Git-Refname: refs/heads/master X-Git-Oldrev: ff66e8c5bee8a57b531515342e6126782ea9a651 X-Git-Newrev: 2026dcfcc0c0e60efa968b889f010a10a93cfe09 Message-Id: <20220114143242.9F8A53858D35@sourceware.org> Date: Fri, 14 Jan 2022 14:32:42 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2022 14:32:42 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2026dcfcc0c0= e60efa968b889f010a10a93cfe09 commit 2026dcfcc0c0e60efa968b889f010a10a93cfe09 Author: Nils-Christian Kempke Date: Tue Jan 11 18:12:40 2022 +0100 gdb/testsuite: enable __INTEL_LLVM_COMPILER preprocessor in get_compile= r_info =20 Intel Next Gen compiler defines preprocessor __INTEL_LLVM_COMPILER and = provides version info in __clang_version__ e.g. value: 12.0.0 (icx 2020.10.0.111= 3). =20 gdb/testsuite/ChangeLog: 2020-12-07 Abdul Basit Ijaz =20 * lib/compiler.c: Add Intel next gen compiler pre-processor che= ck. * lib/compiler.cc: Ditto. * lib/fortran.exp (fortran_main): Check Intel next gen compiler= in test_compiler_info. Diff: --- gdb/testsuite/lib/compiler.c | 9 +++++++++ gdb/testsuite/lib/compiler.cc | 9 +++++++++ gdb/testsuite/lib/fortran.exp | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c index 191bced0411..451cae38312 100644 --- a/gdb/testsuite/lib/compiler.c +++ b/gdb/testsuite/lib/compiler.c @@ -67,4 +67,13 @@ set icc_major [string range __ICL 0 1] set icc_minor [format "%d" [string range __ICL 2 [expr {[string length __I= CL] -1}]]] set icc_update __INTEL_COMPILER_UPDATE set compiler_info [join "icc $icc_major $icc_minor $icc_update" -] +#elif defined(__INTEL_LLVM_COMPILER) && defined(__clang_version__) +/* Intel Next Gen compiler defines preprocessor __INTEL_LLVM_COMPILER and + provides version info in __clang_version__ e.g. value: + "12.0.0 (icx 2020.10.0.1113)". */ +set total_length [string length __clang_version__] +set version_start_index [string last "(" __clang_version__] +set version_string [string range __clang_version__ $version_start_index+5 = $total_length-2] +set version_updated_string [string map {. -} $version_string] +set compiler_info "intel-$version_updated_string" #endif diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc index ab36bea43ae..1dfefee057d 100755 --- a/gdb/testsuite/lib/compiler.cc +++ b/gdb/testsuite/lib/compiler.cc @@ -55,4 +55,13 @@ set icc_major [string range __ICL 0 1] set icc_minor [format "%d" [string range __ICL 2 [expr {[string length __I= CL] -1}]]] set icc_update __INTEL_COMPILER_UPDATE set compiler_info [join "icc $icc_major $icc_minor $icc_update" -] +#elif defined(__INTEL_LLVM_COMPILER) && defined(__clang_version__) +/* Intel Next Gen compiler defines preprocessor __INTEL_LLVM_COMPILER and + provides version info in __clang_version__ e.g. value: + "12.0.0 (icx 2020.10.0.1113)". */ +set total_length [string length __clang_version__] +set version_start_index [string last "(" __clang_version__] +set version_string [string range __clang_version__ $version_start_index+5 = $total_length-2] +set version_updated_string [string map {. -} $version_string] +set compiler_info "intel-$version_updated_string" #endif diff --git a/gdb/testsuite/lib/fortran.exp b/gdb/testsuite/lib/fortran.exp index ee7fe12ad9b..a97c6eeb4e3 100644 --- a/gdb/testsuite/lib/fortran.exp +++ b/gdb/testsuite/lib/fortran.exp @@ -160,7 +160,8 @@ proc fortran_character1 {} { proc fortran_main {} { if {[test_compiler_info {gcc-4-[012]-*}] || [test_compiler_info {gcc-*}] - || [test_compiler_info {icc-*}]} { + || [test_compiler_info {icc-*}] + || [test_compiler_info {intel-*}]} { return "MAIN__" } elseif {[test_compiler_info {clang-*}]} { return "MAIN_"