From patchwork Sun Jun 8 01:03:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 894806 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp1176819wrb; Sat, 7 Jun 2025 18:11:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgbbrAZu5mbFU+63z/oxNn8AM0dVblS/P+tDQarBkzqVUi5pgH0oR1s0IguBFP14XVPvunGQ==@linaro.org X-Google-Smtp-Source: AGHT+IECUO88sU4WY0OGkOLR5Jp2uhEuCInZ0cLtfCqVgDvHDFRClbl+IboXEulPKQt0Voc4UuzU X-Received: by 2002:a05:622a:4c84:b0:4a4:2d64:a7e3 with SMTP id d75a77b69052e-4a5b9ece19cmr134950671cf.38.1749345063508; Sat, 07 Jun 2025 18:11:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1749345063; cv=pass; d=google.com; s=arc-20240605; b=iJHgQf7WTtB7mF080WTPMtP+a3ASiDxTESYkXij/1e1aNaa6zRjOPwtPlmgde+JQli g2mZG0Rui9j1f2ummtp/raEjh1cDPtdJiMi3rdnkrqo2U7x35hWuOW+R7qv1wplmHsFR kL7n6E8MY+ZmFXwtZWApeLvGen5uH77udJANzW7AuF3gjzJDFCLZdJIZehbJQMNlUy+u 6SxvCwjw5EJ8Yz3tpF5dGVydjeaUiPcJ3alZJa95cYLEcVjFtuSjtG5BEerPQJ6d/4ci cGiOUcnju9+UQFbLy3HngU3tS9Kmmmj7n6OBxHaSuBiprr+pYGTp5iJVtA4aKZMG5XYV ysuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:dkim-filter:arc-filter:dmarc-filter:delivered-to :dkim-filter; bh=nZHLA6ELDf/GbesL0yfSJe0al5B4XIkJKH4o+Jg/nkQ=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=PQBmHcYcBuNNtHC+WdKXHC+Izky/rGMZ01E1232TU41eIB3AHfIIkNCefxfNYdfQYV upw5KCwC2+ZmKJmIAGiMteqEpRQR/oYXXG7gCTVMc//TAYzbOFA3BDdAiO5cqgqV6JFe R94ZKkH75xw2cLcAMISzxRVzOlieNvLSfeAfMLZWYPQ5EBQ7lXhxf5Jfs+o0XqWDu1u+ fVxQtm5nkTfhKwuzMitw8p/Nxb18DqUYg0ZUqTy5Y/XWV2Vfnp9U8Kt56wHPPHWmZ6Lc nKYSSB4JCKB1u5C1+MOMapvhcWYbcEDQObRzrDBiyKcxd9poYvEErKgNbXWa+NT5hMFq sicg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QPZkjD1h; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d75a77b69052e-4a6198b4001si47145421cf.559.2025.06.07.18.11.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jun 2025 18:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QPZkjD1h; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10FB63858C51 for ; Sun, 8 Jun 2025 01:11:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10FB63858C51 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=QPZkjD1h X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) by sourceware.org (Postfix) with ESMTPS id DD0FE3858C51 for ; Sun, 8 Jun 2025 01:04:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DD0FE3858C51 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 DD0FE3858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::92c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749344643; cv=none; b=FmAsfogib8ZxOUraOTmMBqNb6f1NRMEsQ2hYcejSgE3gmMEn3IBYpl5LpFZQG0k10V91SHwZZr1Ft8hbbDz1ZJBWYJR9dEPj7PO3Sf8Oj6Jh+Mnv8nCQkgS+GTOU0qKVtmbMQbVzwIUfmj+51+TB3LZoMGfMYfb/wxk5r3kO/GQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749344643; c=relaxed/simple; bh=cTv+ISESjCOV2sud/ulfLQrc1YAqDw7T2jopC2mhX1E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qh9dPR6HFy5Tadf8kWnFrM5D6uRn2Olw+1YhrrWZ+/77EIFc94tUqKVm62ZLnZGfx2HpsHcMtIYMX/Eg1gXXyNbZOQOVwcye2EUkkbg/sjgLIqQvvVL3hALsMGQPyn/dUi8RAv8H1/ixn/0mj9yjW/vp3N6Z9BUnkrDl8OepvKo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD0FE3858C51 Received: by mail-ua1-x92c.google.com with SMTP id a1e0cc1a2514c-877d7fa49e0so2131361241.2 for ; Sat, 07 Jun 2025 18:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749344642; x=1749949442; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nZHLA6ELDf/GbesL0yfSJe0al5B4XIkJKH4o+Jg/nkQ=; b=QPZkjD1hOV6NjAvV+qfV4ewOYlginxvaBhJtHlxnaTEcviVeN+j4LTCrei1R0JmCB5 ekCdyohIuJOXyHakUhmgg2niIpFDgZmk8SiONBApcQrX0y2G0Z7YRngfmILlw1YEThtg lAMN8Dn/ot3Qd61/k43alEGFex0hjIbyandm8D+NGFhvCyHIz2FFO3kcdDzZBORR9HBb Kh/zMDQNzHVFab8bc67pWL3ELtOEUC3aO82a0QLyY3x+K+B9yyyAkz9bAcXtvRSfaB6F e37WcksM1HUGvcIJc9o9Q+9Iu5VmPt+LYoVRO4NYU5jQDDhhAqtPmJtQ/bl8BD4Jt4ny YT9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749344642; x=1749949442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nZHLA6ELDf/GbesL0yfSJe0al5B4XIkJKH4o+Jg/nkQ=; b=GVZMIsIEZp9aEMoNdh9RxyH+y6r+2IazDDrxGCqW12DUh/zYlJ8wc+CNbUf+sMPmaY riQAYuXdW0Rd8ZiXUP82GHPbEO+0CYTSnvxoxqA296RccVkZCgMWk4wnNvflsoGuZXIy VIQyuNruoCOzRxUt9CXOL5ks7q0lfV2p//PyYzVFD+INqBE/AZiFJ8DmiBgbIUgfSD72 YB/AkEDc/Hg74hhX8KU9fJNWiyxjzg/uQDKzqnD2JBAUs0NLYAExm0VlAkjPaXGFI/LZ mo8nPPuk1UxS9C7r9PzlUztvxQ6f5FwkE3EW6gUFludZfAsT+Q+yZD5+Qkwx3xxhRSHZ hzZA== X-Gm-Message-State: AOJu0YyqgDb3nfjibwTJo8z8csKXQ472BMi9PHPmpYtsCtqWhUhBdL9V lImj/PIGnZ6+YxooF4fU/RIyZbGaU+uDFo4b5CjHKnUwCAwW2IkCZFZxmLpNbkwVwn7N6vf/cK2 AW/pq X-Gm-Gg: ASbGncupOlpYc5OHD/gTIXEfy4jI6nRPr7kgnDbUPnahtMdRo9I7FCfHJ5WQ26emjlh dYxV2iPFp1OLTUP++ABZfn5PABL9gWMTBSu9yLitXv9TSzs/mXQWKKeFl3uT+/uppz0XrURcPTO pw0ffiP+dnj2hEhHNsX+ov+cH0nuh5CiWEG4e2WZXF9ACyUFW5lg38R4VvA2qMTkiMcdhVvul+n Gag9CXQKVETPwOJGOjPtDj4Xw2jq8N4F8PSbiFm8xUzZrVv8wmR0FjvBQhoHvbdN0+Lt4F7Gojr 7wQYO6j9sghlouQuLpjY/MQ9ZBQZe4LQs8O4zss1U1Wn+F2CaLgx+I9CPUgqSg== X-Received: by 2002:a05:6102:510f:b0:4e5:f673:7da4 with SMTP id ada2fe7eead31-4e77292063fmr7960055137.8.1749344641618; Sat, 07 Jun 2025 18:04:01 -0700 (PDT) Received: from localhost ([2804:14d:7e39:88d6:8cb1:1e8e:e951:f687]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-87ebd194e03sm2994981241.2.2025.06.07.18.04.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jun 2025 18:04:01 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH 6/8] GDB: testsuite: Add gdb.arch/aarch64-gcs.exp testcase Date: Sat, 7 Jun 2025 22:03:17 -0300 Message-ID: <20250608010338.2234530-7-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250608010338.2234530-1-thiago.bauermann@linaro.org> References: <20250608010338.2234530-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 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~patch=linaro.org@sourceware.org Also add allow_aarch64_gcs_tests procedure to determine whether Guarded Control Stack tests should run. --- gdb/testsuite/gdb.arch/aarch64-gcs.c | 168 +++++++++++++++++++++++++ gdb/testsuite/gdb.arch/aarch64-gcs.exp | 78 ++++++++++++ gdb/testsuite/lib/gdb.exp | 58 +++++++++ 3 files changed, 304 insertions(+) create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-gcs.exp diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs.c b/gdb/testsuite/gdb.arch/aarch64-gcs.c new file mode 100644 index 000000000000..8e579de10cdb --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-gcs.c @@ -0,0 +1,168 @@ +/* This test program is part of GDB, the GNU debugger. + + Copyright 2025 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 . */ + +#include +#include +#include +#include +#include +#include + +/* Feature check for Guarded Control Stack. */ +#ifndef HWCAP_GCS +#define HWCAP_GCS (1UL << 32) +#endif + +#ifndef PR_GET_SHADOW_STACK_STATUS +#define PR_GET_SHADOW_STACK_STATUS 74 +#define PR_SET_SHADOW_STACK_STATUS 75 +#define PR_SHADOW_STACK_ENABLE (1UL << 0) +#endif + +/* We need to use a macro to call prctl because after GCS is enabled, it's not + possible to return from the function which enabled it. This is because the + return address of the calling function isn't on the GCS. */ +#define my_syscall2(num, arg1, arg2) \ + ({ \ + register long _num __asm__("x8") = (num); \ + register long _arg1 __asm__("x0") = (long)(arg1); \ + register long _arg2 __asm__("x1") = (long)(arg2); \ + register long _arg3 __asm__("x2") = 0; \ + register long _arg4 __asm__("x3") = 0; \ + register long _arg5 __asm__("x4") = 0; \ + \ + __asm__ volatile("svc #0\n" \ + : "=r"(_arg1) \ + : "r"(_arg1), "r"(_arg2), "r"(_arg3), "r"(_arg4), \ + "r"(_arg5), "r"(_num) \ + : "memory", "cc"); \ + _arg1; \ + }) + +#define get_gcspr(void) \ + ({ \ + unsigned long *gcspr; \ + \ + /* Get GCSPR_EL0. */ \ + asm volatile("mrs %0, S3_3_C2_C5_1" : "=r"(gcspr) : : "cc"); \ + \ + gcspr; \ + }) + +static unsigned long *handler_gcspr = 0; + +static void +handler (int sig) +{ + handler_gcspr = get_gcspr (); +} + +static int __attribute__ ((unused)) +called_from_gdb (int val) +{ + return val + 1; +} + +/* Corrupt the return address to see if GDB will report a SIGSEGV with the expected + $_siginfo.si_code. */ +static void __attribute__ ((noinline)) +normal_function2 (void) +{ + /* x30 holds the return address. */ + register unsigned long x30 __asm__("x30") __attribute__ ((unused)); + + /* Cause a GCS exception. */ + x30 = 0xbadc0ffee; + __asm__ volatile("ret\n"); +} + +static inline void __attribute__ ((__always_inline__)) +inline_function2 (void) +{ + normal_function2 (); +} + +/* Corrupt the return address to see if GDB will report a GCS error in this + function's frame . */ +static void __attribute__ ((noinline)) +normal_function1 (void) +{ + /* x30 holds the return address. */ + register unsigned long x30 __asm__ ("x30") __attribute__ ((unused)); + x30 = 0xbadc0ffee; + inline_function2 (); +} + +static inline void __attribute__ ((__always_inline__)) +inline_function1 (void) +{ + normal_function1 (); +} + +int +main (void) +{ + if (!(getauxval (AT_HWCAP) & HWCAP_GCS)) + { + fprintf (stderr, "GCS support not found in AT_HWCAP\n"); + return EXIT_FAILURE; + } + + /* Force shadow stacks on, our tests *should* be fine with or + without libc support and with or without this having ended + up tagged for GCS and enabled by the dynamic linker. We + can't use the libc prctl() function since we can't return + from enabling the stack. Also lock GCS if not already + locked so we can test behaviour when it's locked. */ + unsigned long gcs_mode; + int ret = my_syscall2 (__NR_prctl, PR_GET_SHADOW_STACK_STATUS, &gcs_mode); + if (ret) + { + fprintf (stderr, "Failed to read GCS state: %d\n", ret); + return EXIT_FAILURE; + } + + if (!(gcs_mode & PR_SHADOW_STACK_ENABLE)) + { + gcs_mode = PR_SHADOW_STACK_ENABLE; + ret = my_syscall2 (__NR_prctl, PR_SET_SHADOW_STACK_STATUS, gcs_mode); + if (ret) + { + fprintf (stderr, "Failed to configure GCS: %d\n", ret); + return EXIT_FAILURE; + } + } + + /* This is used by GDB. */ + __attribute__((unused)) unsigned long *gcspr = get_gcspr (); + + struct sigaction act = { 0 }; + + act.sa_handler = &handler; /* Break here. */ + if (sigaction (SIGUSR1, &act, NULL) == -1) + { + perror ("sigaction"); + exit (EXIT_FAILURE); + } + + raise (SIGUSR1); + + inline_function1 (); + + /* Avoid returning, in case libc doesn't understand GCS. */ + exit (EXIT_SUCCESS); +} diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs.exp b/gdb/testsuite/gdb.arch/aarch64-gcs.exp new file mode 100644 index 000000000000..211fabf2f86b --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-gcs.exp @@ -0,0 +1,78 @@ +# Copyright 2025 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 a Guarded Control Stack. + +require allow_aarch64_gcs_tests + +standard_testfile + +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { + return +} + +set linespec ${srcfile}:[gdb_get_line_number "Break here"] + +if ![runto ${linespec}] { + return +} + +gdb_test "print \$gcs_features_enabled" \ + [string_to_regexp { = [ PR_SHADOW_STACK_ENABLE ]}] \ + "GCS is enabled" + +gdb_test "print \$gcspr" ". = \\(void \\*\\) $hex" "GDB knows about gcspr" +gdb_test "print \$gcspr == gcspr" ". = 1" "GDB has the correct gcspr value" +gdb_test_no_output "set \$gcspr_in_main = \$gcspr" \ + "save gcspr value in main for later" + +# If the inferior function call fails, we don't want the tests following it +# to be affected. +gdb_test_no_output "set unwindonsignal on" +gdb_test "print called_from_gdb (41)" ". = 42" "call inferior function" + +gdb_test "break handler" "Breakpoint \[0-9\]+ .*aarch64-gcs.c, line \[0-9\]+\\." +gdb_test "handle SIGUSR1 nostop" \ + ".*\r\nSIGUSR1\\s+No\\s+Yes\\s+Yes\\s+User defined signal 1" \ + "let the inferior receive SIGUSR1 uninterrupted" +gdb_test "continue" \ + ".*\r\nBreakpoint \[0-9\]+, handler \\(sig=10\\) at .*aarch64-gcs.c.*handler_gcspr = get_gcspr \\(\\);" \ + "continue to signal handler" + +gdb_test_no_output "set \$gcspr_in_handler = \$gcspr" \ + "save gcspr value in handler for later" +# Select the frame above the frame, which makes GDB +# unwind the gcspr from the signal frame GCS context. +gdb_test "frame 2" "#2 ($hex in )?\\S+ \\(.*\\) (at|from) \\S+.*" \ + "reached frame 2" +gdb_test "print \$gcspr" ". = \\(void \\*\\) $hex" "gcspr in frame level 2" +gdb_test "print \$gcspr == \$gcspr_in_handler + 8" ". = 1" \ + "gcspr unwound from signal context is correct" + +gdb_test "continue" \ + [multi_line \ + "Continuing\\." \ + "" \ + "Program received signal SIGSEGV, Segmentation fault" \ + "Guarded Control Stack error\\." \ + "normal_function2 \\(\\) at .*aarch64-gcs.c:$decimal" \ + "${decimal}\\s+__asm__ volatile\\(\"ret\\\\n\"\\);"] \ + "continue to SIGSEGV" + +gdb_test "print \$_siginfo.si_code" ". = 10" \ + "test value of si_code when GCS SIGSEGV happens" +# The GCS grows down, and there are two real frames until main. +gdb_test "print \$gcspr == \$gcspr_in_main - 16" ". = 1" \ + "test value of gcspr when GCS SIGSEGV happens" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ea498c430405..2adfd4b1bcfe 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5094,6 +5094,64 @@ gdb_caching_proc allow_aarch64_mops_tests {} { return $allow_mops_tests } +# Run a test on the target to see if it supports Aarch64 GCS extensions. +# Return 0 if so, 1 if it does not. Note this causes a restart of GDB. + +gdb_caching_proc allow_aarch64_gcs_tests {} { + global srcdir subdir gdb_prompt inferior_exited_re + + set me "allow_aarch64_gcs_tests" + + if { ![is_aarch64_target]} { + return 0 + } + + # Compile a program that tests the GCS feature. + set src { + #include + #include + + /* Feature check for Guarded Control Stack. */ + #ifndef HWCAP_GCS + #define HWCAP_GCS (1UL << 32) + #endif + + int main (void) { + bool gcs_supported = getauxval (AT_HWCAP) & HWCAP_GCS; + + /* Return success if GCS is supported. */ + return !gcs_supported; + } + } + + if {![gdb_simple_compile $me $src executable]} { + return 0 + } + + # Compilation succeeded so now run it via gdb. + clean_restart $obj + gdb_run_cmd + gdb_expect { + -re ".*$inferior_exited_re with code 01.*${gdb_prompt} $" { + verbose -log "\n$me gcs support not detected" + set allow_gcs_tests 0 + } + -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { + verbose -log "\n$me: gcs support detected" + set allow_gcs_tests 1 + } + default { + warning "\n$me: default case taken" + set allow_gcs_tests 0 + } + } + gdb_exit + remote_file build delete $obj + + verbose "$me: returning $allow_gcs_tests" 2 + return $allow_gcs_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" {