From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AluBJtihRGoMqyAAWB0awg (envelope-from ) for ; Wed, 01 Jul 2026 01:12:56 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wmgLVgvc; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8DC831E098; Wed, 01 Jul 2026 01:12:56 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C1C101E070 for ; Wed, 01 Jul 2026 01:12:54 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C396A4BA2E35 for ; Wed, 1 Jul 2026 05:12:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C396A4BA2E35 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wmgLVgvc Received: from mail-dl1-x1231.google.com (mail-dl1-x1231.google.com [IPv6:2607:f8b0:4864:20::1231]) by sourceware.org (Postfix) with ESMTPS id 900344BA2E30 for ; Wed, 1 Jul 2026 05:12:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 900344BA2E30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 900344BA2E30 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782882745; cv=none; b=D2FHeqVLJCMslJlR0CXWVYssSlvZXO3PqfJj97BEZwFCNmIDTCM7rV1LZCFQkKfk26X8eUIrLTIbpcBBbaGPE0GLQK48bRJ+z9N2uIgiKQi9BGHfaw79kmZ7JjN4L7YpkfXBEbtUoi5pAQIraP2+0kG1FJvt+mcZWFbsffqqe2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782882745; c=relaxed/simple; bh=8WXonT+GP6Owbi0VcbuTF2wDUnfHKs9kNKCZUnrl1DA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=L7LJSBU+YbcPk2LVvi4r0ZXDyMScvzHUm/fx756ZI31RGpEYGVIlGUaYwzEcH8JN6/bXwItHDJXSswzL7jQ/RnWzfRommuiMH3dT8dABhKQAiHN9X7DHYvI2Ni4eeNaApueT/N8i+Iii1b4f8eLukGymrIEh00DquWJJ9iIOdu0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wmgLVgvc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 900344BA2E30 Received: by mail-dl1-x1231.google.com with SMTP id a92af1059eb24-137dd4cc208so216187c88.1 for ; Tue, 30 Jun 2026 22:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782882744; x=1783487544; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G2tG8EdzM72CeEyYyJf7aQkhfpHD8LQYWEGnlo77Aq8=; b=wmgLVgvcNBB75hl5LFPrHEt9Hnp0D4jbsnpuDFGhSyBfxPKeo9kCqGXcydqXWKaV2l fxM1q2Twyio4A69Eh6+e8PM2rFsTO7aup9J/COwKowxremZT2ki3HK4nuMODR8WgxfUB 90JT9Aa9DjhYvOE0BS8k4lgGeBHZcq0VIDhJ+x33cYpQk7NzrIRGzQbVGafJL4hIqTMW RsXsiVIUwgR7JkfqXRw5bvnRyg3S9qPWaqxl/B1B90Z3Qov5OATnGbdiIzJQmHkU6ABg 9kbLrWkANs0gp8NeM9exBi5sS6Q/unnM15MFk48ei8KzwsYrqADb446lAqSMTkpqXfhQ wsmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782882744; x=1783487544; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G2tG8EdzM72CeEyYyJf7aQkhfpHD8LQYWEGnlo77Aq8=; b=PryONDam6V90QUNhEVljrHTOuk4Tu34ucIAuELuFHCwravJ+l3GfBu138ehQfCHn5k FUs3hAVnbK26B5KLOIr8IOBLumVPAHjCOWQL15PbH3h5PhX7j+h7gQLWBLOqG2//BHCG cXGou/Nx6ShgS6NA6sKDVAndkxorVowRcaL8QLTFc1jLHUTUfY+G+O7YtLDVZN2VctFM A6EM8BJRy3tQ9zu1kkvuG4n2S5L6kSeulwZ/7AXXow9o43cEHe7zvjnI6YQL/lAdlHcs BmMv8xDFZp/PuRKkTW19TIKbQgVSIh7pNB+cc9GSu1nwSFtX+eO86RFRUIJrG6cr2O/g 71iA== X-Gm-Message-State: AOJu0YyNGTBoQZ/hAxSy6sXuan6Z2xHss2GoenweBKSUs/obH1LE1ka3 dbJJXxuKESYLyFBDYxHwzMiSXVstGIF1oyiOuJGgQ03znMz4g5Ler81fGiuLCUH61Qs= X-Gm-Gg: AfdE7clkkNZXlnc5x3Ik8sNfqqEkqHuaXktmIqCW77REJkmyD76AORVM05I8dsC9T9p 0Ebw1tW0an6izcyG6FZmAbSIbFyL/S/+O4f1OE/dI8mud57yCtCIVVJMlaxbo6Fn9TfpGpXcuYX wzQqqRw81mLRoBwGeR4XtmYzXUs91F5w5x9fl/lonj/BKw25VnhHcxWuOAj1YovO9cvap/CQ79b RxgA+kFxniUipyOk8tB54Ve8b1POakOdL73hvUhqg12r1hTmzXa0aPbx8H72ijPTj996fmCZM/R SPvVHnqE2VZG8s/tbrfZ8JSIk4GZs77mKhxgxDZ4bDtEPHnbcFlc8+lZCUhCQAImYxskIxXxgC1 PWK7SKOXAuMq3CwHOgGQhCiQ5Ov57n90szxbbbYmnfOcGmxXFPY9Y8fczDtKEEkbWT2r323d9uR TTfYh2Ch85VT/Ou6lIKEwKjOk= X-Received: by 2002:a05:7022:662b:b0:136:c2fa:32d6 with SMTP id a92af1059eb24-13b36d82fc8mr249170c88.7.1782882743835; Tue, 30 Jun 2026 22:12:23 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b2abbb44csm15170689c88.12.2026.06.30.22.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 22:12:23 -0700 (PDT) From: Thiago Jung Bauermann To: Cc: , , , , Subject: Re: [PATCH v2 7/7] gdb/testsuite: Add FEAT_S1POE testcases In-Reply-To: <20260626180821.376406-8-srinath.parvathaneni@arm.com> (srinath parvathaneni's message of "Fri, 26 Jun 2026 18:08:21 +0000") References: <20260626180821.376406-1-srinath.parvathaneni@arm.com> <20260626180821.376406-8-srinath.parvathaneni@arm.com> User-Agent: mu4e 1.14.2; emacs 30.2 Date: Wed, 01 Jul 2026 05:12:21 +0000 Message-ID: <87cxx7guoa.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hello Srinath, Today I ran the testcases on FVP and was able to complete the review of this patch. Sorry for the delay. writes: > From: Srinath Parvathaneni > > Add testcases for POR_EL0 register access, SIGSEGV diagnostics, fix-and-c= ontinue > support (updating $por_el0 after SIGSEGV and continuing with signal 0), a= nd core > file support. A good selection of test scenarios, thanks! > --- > gdb/testsuite/gdb.arch/aarch64-poe-core.exp | 102 ++++++++++++++++++ > gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c | 52 +++++++++ > .../gdb.arch/aarch64-poe-sigsegv.exp | 60 +++++++++++ > gdb/testsuite/gdb.arch/aarch64-poe.c | 29 +++++ > gdb/testsuite/gdb.arch/aarch64-poe.exp | 44 ++++++++ > gdb/testsuite/lib/gdb.exp | 55 ++++++++++ > 6 files changed, 342 insertions(+) > create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-core.exp > create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.exp > create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-poe.exp > > diff --git a/gdb/testsuite/gdb.arch/aarch64-poe-core.exp b/gdb/testsuite/= gdb.arch/aarch64-poe-core.exp > new file mode 100644 > index 00000000000..ab998781f10 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-poe-core.exp > @@ -0,0 +1,102 @@ > +# Copyright (C) 2026 Free Software Foundation, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# This file is part of the gdb testsuite. > + > +# Test generating and reading a core file with POR_EL0. > + > +proc check_poe_core_file {core_filename} { > + # Load the core file. > + if { > + [gdb_test "core $core_filename" \ This file is indented only with spaces, when the GDB style is to use tabs and spaces. Please adjust. I recently mentioned the .editorconfig file which we use to help configure editors to automatically use the right settings, perhaps it can be useful: https://inbox.sourceware.org/gdb-patches/87zf0jwr23.fsf@linaro.org/ > + [multi_line \ > + "Core was generated by .*" \ > + "Program terminated with signal SIGSEGV, Segmentation fa= ult\\." \ This regexp isn't matching in my test run because GDB doesn't print the last dot: Core was generated by `/home/bauermann/.cache/builds/gdb-native/gdb/testsui= te/outputs/gdb.arch/aarch64-poe-core/aarch64-poe-core'.^M Program terminated with signal SIGSEGV, Segmentation fault^M Protection Key Violation while accessing address 0x0000fffff7ff3000 with Pr= otection Key =3D 1.^M #0 0x0000aaaaaaaa09a4 in main () at /home/bauermann/src/binutils-gdb/gdb/t= estsuite/gdb.arch/aarch64-poe-sigsegv.c:49^M 49 buf[0] =3D 42; /* Expect SIGSEGV POE violation. */^M (gdb) FAIL: gdb.arch/aarch64-poe-core.exp: gcore corefile: load core file UNTESTED: gdb.arch/aarch64-poe-core.exp: gcore corefile: failed to load cor= e file > + "Protection Key Violation while accessing address ${::he= x} with Protection Key =3D ${::decimal}\\." \ > + "#0 ${::hex} in main \\(.*\\) at .*" \ > + ".*buf\\\[0\\\] =3D 42;.*"] \ > + "load core file"] > + } { > + untested "failed to load core file" > + return -1 > + } > + > + # Check the value of POR_EL0 in the core file. > + gdb_test "print/x \$por_el0" " =3D 0x55" \ > + "por_el0 contents from core file" When I remove the dot from the pattern above, this test fails: print/x $por_el0^M $1 =3D 0x37^M (gdb) FAIL: gdb.arch/aarch64-poe-core.exp: gcore corefile: por_el0 contents= from core file I get the output above both for the gcore and the native corefile. > +} > + > +require is_aarch64_target This require is redundant, since allow_aarch64_poe_tests already calls is_aarch64_target. > +require allow_aarch64_poe_tests > + > +standard_testfile aarch64-poe-sigsegv.c > + > +if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { > + return > +} > + > +set binfile [standard_output_file ${testfile}] > + > +if {![runto_main]} { > + return > +} > + > +set poe_crash_re [multi_line \ > + "Program received signal SIGSEGV, Segmentation fault\\." \ I also had to remove the dot here to make the RE match. > + "Protection Key Violation while accessing address ${::hex} with Prot= ection Key =3D ${::decimal}\\." \ > + ".*buf\\\[0\\\] =3D 42;.*"] > + > +gdb_test_multiple "continue" "run to POE crash" { > + -re "$poe_crash_re.*$gdb_prompt $" { $poe_crash_re already has .* at the end, so either remove .* there or here. > + pass $gdb_test_name > + } > + > + -re ".*exited with code 01.*$gdb_prompt $" { > + unsupported "POE userspace support unavailable" > + return > + } > +} > + > +# Generate the gcore core file. > +set gcore_filename [standard_output_file "${testfile}.gcore"] > +set gcore_generated [gdb_gcore_cmd "$gcore_filename" "generate gcore fil= e"] > + > +# Generate a native core file. > +set core_filename [core_find ${binfile}] > +set core_generated [expr {$core_filename !=3D ""}] > + > +# At this point we have a couple core files, the gcore one generated by = GDB > +# and the native one generated by the Linux Kernel. Make sure GDB can r= ead > +# both correctly. > + > +if {$gcore_generated} { > + clean_restart > + gdb_load ${binfile} > + with_test_prefix "gcore corefile" { > + check_poe_core_file $gcore_filename > + } > +} else { > + fail "gcore corefile not generated" > +} > + > +if {$core_generated} { > + clean_restart > + gdb_load ${binfile} > + with_test_prefix "native corefile" { > + check_poe_core_file $core_filename > + } > +} else { > + untested "native corefile not generated" > +} > diff --git a/gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c b/gdb/testsuite= /gdb.arch/aarch64-poe-sigsegv.c > new file mode 100644 > index 00000000000..6b0c07e782f > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.c > @@ -0,0 +1,52 @@ > +/* This test program is part of GDB, the GNU debugger. > + > + Copyright 2026 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +/* Exercise AArch64's POE Extension. */ > + > +/* This test is based on the Linux kernel documentation for Memory > + Protection Keys, including the arm64 Permission Overlay Extension > + (FEAT_S1POE) support described in > + Documentation/core-api/protection-keys.rst. */ > + > +#define _GNU_SOURCE > +#include > +#include > + > +int > +main (void) > +{ > + long pagesize =3D sysconf (_SC_PAGESIZE); > + > + int *buf =3D mmap (NULL, pagesize, PROT_READ | PROT_WRITE, > + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); > + if (buf =3D=3D MAP_FAILED) > + return 1; > + > + int pkey =3D pkey_alloc (0, 0); > + if (pkey =3D=3D -1) > + return 1; > + > + if (pkey_mprotect (buf, pagesize, PROT_READ | PROT_WRITE, pkey) =3D=3D= -1) > + return 1; > + > + if (pkey_set (pkey, PKEY_DISABLE_WRITE) =3D=3D -1) > + return 1; > + > + buf[0] =3D 42; /* Expect SIGSEGV POE violation. */ > + > + return 1; This needs to be "return 0" for aarch64-poe-sigsegv.exp to pass. > +} > diff --git a/gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.exp b/gdb/testsui= te/gdb.arch/aarch64-poe-sigsegv.exp > new file mode 100644 > index 00000000000..b22814f9ab9 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-poe-sigsegv.exp > @@ -0,0 +1,60 @@ > +# Copyright (C) 2026 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test a binary that supports FEAT_S1POE and exposes POR_EL0 register. > + > +global hex > +global decimal > + > +require is_aarch64_target > + > +if {![allow_aarch64_poe_tests]} { > + unsupported "AArch64 POE not supported" > + return > +} Like in the previous testcase, is_aarch64_target is redundant, and the if block above should just be "require allow_aarch64_poe_tests". > + > +standard_testfile > +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { > + return > +} > + > +if {![runto_main]} { > + return > +} > + > +# Display POE violation SIGSEGV error message. > +set poe_sigsegv_re [multi_line \ > + "Program received signal SIGSEGV, Segmentation fault\\." \ > + "Protection Key Violation while accessing address ${hex} with Protec= tion Key =3D ${decimal}"] > + > +gdb_test_multiple "continue" "display POE violation information" { > + -re "$poe_sigsegv_re.*$gdb_prompt $" { > + pass $gdb_test_name > + } > + -re ".*exited with code 01.*$gdb_prompt $" { > + unsupported "POE userspace support unavailable" > + return > + } > +} > + > +# Fix the POE permissions (set $por_el0) and continue without delivering= SIGSEGV. > +gdb_test "set \$por_el0 =3D 0x47" "" \ > + "allow write access by updating POR_EL0" It's clearer to use gdb_test_no_output here. > + > +gdb_test_multiple "signal 0" "continue after fixing POE fault" { > + -re ".*exited normally.*$gdb_prompt $" { Here is where the change of the last return statement in aarch64-poe-sigsegv.c is needed, otherwise I get: signal 0^M Continuing with no signal.^M [Inferior 1 (process 1513) exited with code 01]^M (gdb) FAIL: gdb.arch/aarch64-poe-sigsegv.exp: continue after fixing POE fau= lt (the program exited) > + pass $gdb_test_name > + } > +} =E2=8B=AE > diff --git a/gdb/testsuite/gdb.arch/aarch64-poe.exp b/gdb/testsuite/gdb.a= rch/aarch64-poe.exp > new file mode 100644 > index 00000000000..ae2663a7dbc > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-poe.exp > @@ -0,0 +1,44 @@ > +# Copyright (C) 2026 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test a binary that uses POE and exposed POR_EL0 register. > + > +global hex > +global decimal > + > +require is_aarch64_target > + > +if {![allow_aarch64_poe_tests]} { > + unsupported "AArch64 POE not supported" > + return > +} Same here: is_aarch64_target is redundant, and the if block above should just be "require allow_aarch64_poe_tests". > + > +standard_testfile > +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { > + return > +} > + > +if {![runto_main]} { > + return > +} > + > +# Validate the presence of the POE register. > + gdb_test "info registers por_el0" \ > + "por_el0\[ \t\]+$hex.*" \ > + "register por_el0 available" > + > + gdb_test "p/x \$por_el0" \ > + "\\$\[0-9\]+ =3D ${hex}" \ > + "print por_el0" The gdb_test statements above should start at the first column. > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index d8619ded236..40a8124955a 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -5654,6 +5654,61 @@ gdb_caching_proc allow_aarch64_gcs_tests {} { > return $allow_gcs_tests > } >=20=20 > +# Run a test on the target to see if it supports AArch64 POE extensions. > +# Return 1 if so, 0 if it does not. Note this causes a restart of GDB. > + > +gdb_caching_proc allow_aarch64_poe_tests {} { > + global srcdir subdir gdb_prompt inferior_exited_re > + > + set me "allow_aarch64_poe_tests" > + > + if { ![is_aarch64_target]} { Extraneous space after the { above. > + return 0 > + } > + > + # Compile a program that tests the POE feature. > + set src { > + #include > + #include > + > + /* Feature check for POE feature. */ > + #ifndef HWCAP2_POE > + #define HWCAP2_POE (1ULL << 63) > + #endif > + > + int main (void) { > + bool poe_supported =3D getauxval (AT_HWCAP2) & HWCAP2_POE; > + > + /* Return success if POE is supported. */ > + return !poe_supported; > + } > + } > + > + if {![gdb_simple_compile $me $src executable]} { > + return 0 > + } > + > + # Compilation succeeded so now run it via gdb. > + set allow_poe_tests 0 > + clean_restart > + gdb_load $obj > + gdb_run_cmd > + gdb_expect { > + -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { > + verbose -log "\n$me: poe support detected" > + set allow_poe_tests 1 > + } > + -re ".*$inferior_exited_re with code 01.*${gdb_prompt} $" { > + verbose -log "\n$me: poe support not detected" > + } > + } > + gdb_exit > + remote_file build delete $obj > + > + verbose "$me: returning $allow_poe_tests" 2 Extraneous space after the : above. > + return $allow_poe_tests > +} > + > # A helper that compiles a test case to see if __int128 is supported. > proc gdb_int128_helper {lang} { > return [gdb_can_simple_compile "i128-for-$lang" { --=20 Thiago (he/him)