From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wkSpGxODa2rwHjUAWB0awg (envelope-from ) for ; Thu, 30 Jul 2026 13:00:03 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=abmi9h2r; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 582491E09E; Thu, 30 Jul 2026 13:00:03 -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 0D1691E099 for ; Thu, 30 Jul 2026 13:00:02 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 637914BBC0FF for ; Thu, 30 Jul 2026 17:00:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 637914BBC0FF Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=abmi9h2r Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by sourceware.org (Postfix) with ESMTPS id 586C74BB3BA2 for ; Thu, 30 Jul 2026 16:59:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 586C74BB3BA2 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 586C74BB3BA2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785430778; cv=none; b=iVc2BCh9C1dB5xKgPl57ywoaTZb/OJ3MzAmIJJS/FKTvBJyPCX6ZRUAmiG6K9/cU8vsMm8/UEdlMRcKegsaceRksuB97y7acF82u2WTPH3ycfSRiN/T9c1nqUJ2H3hmxicDRuZGFsUesRZ9XdshRpUTbCROwjcht8agvDqpEYIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785430778; c=relaxed/simple; bh=sK+f1sh5u9f+a5yyAaduxqU1WapEkuKzQGIuQcO8oYM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xwHjPQHxL0e/AphVEDamRsQgiKjRjoY4r0nEc9V0J2lvvdaS0DRpusrcKeo/bNV9k1YWaZxMo1LAOjIPWcvsZ7TBMZal8tAi6bU7Ynno1GAxZPFcgvrixw9CjA/tyZWbCEK/CGyH+2mkvDKjIdwTNgJAxPidT74faLKCcRXbD74= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=abmi9h2r DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 586C74BB3BA2 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-6aae5eb0ee0so874166eaf.3 for ; Thu, 30 Jul 2026 09:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1785430778; x=1786035578; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=b6Joe+9k1QuOsOXPvjxhSkqffbJk6oYpqkAgDPoqtXs=; b=abmi9h2rgkguk8LzsxgsqdXe2woC+hizz54mgR0xBjXFUDsx4SsiTioWdBOWzzxIDW Vx36Wd/ea4tTAf9I/ZaWoWBV+XFcpag247JwxPRCuSw/tu7T+oHGUQEOmD1kKCtSCvc7 YG50DpTazAg5H338Zn99IMIeOWNCc7H52fn/6uAxPIsPzou6/Gh1GruFHkYlgqkRfrlr lgBHizMAv36VWqwiMLyvX1MPp4mskWdpoT3Y+sZAIvucXgyjs+thn+F7fE5rPhWyadAy 1ei/dlspfnoncsTJVQPsblMFa7eVrqezwGBuc2kHusRUEgTcn4DikAHTQ++dCqdr5au4 YfXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785430778; x=1786035578; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=b6Joe+9k1QuOsOXPvjxhSkqffbJk6oYpqkAgDPoqtXs=; b=fZkloQXlDniog1/k9olzGA0Ik5zKUOq1WN5rALwRdEVICckaOE6HF6KL07OlxzvgSW gl0NVcXemJ+2ErblH7jm9anJwrKP3XEBk7nWNq8EtqpDWszWTtDDLjIeptst9TKFIur4 Ub8OtRyfSGF7dvzDieba9NzxZlA37JHiFO/VTzKs+6QNbw7bjuQU5qC/Zl5TGpELMDjJ 9ilkkWPznvWdncOMgRvcVb7Ina8b6wzycgvys/+sfF8rMxdOHDlPj8ZklMvhEh88XVOI TcYUgBG4aeZyuztMvyPoMzeQ94Vc7jiGX3E80ipk5HHwbUKXlNaKFuEt6dFhEIoYlbIe aU+g== X-Gm-Message-State: AOJu0YwYk7fHP50lSYv5URBGPcnnHyJXU6hz8feqoAHnM7t1FGcX6h4n TRszQwOpRWcjRAt30SQdf+e3CmjkinbKBVRCM/7c18yB6XdKzB03nKpARYxFKS39wzHV8FftdMf 8E50= X-Gm-Gg: AR+sD12IM+8L2OtQYgHmn9+oy2C+sOBvTYkFsxLCrfSNSewmkl6GeNRJagYi2GeO1ym FfXAFy46K95OC/5Sr9MTX2j7P0oKDJF5e2msIrIoop+U6tcEzSv6LOzM1CsmoYSq6t07cQWOSh8 HR/Q+HSZK+3boCv7eMvq6qh09xF/io+NbJIzThmT03Vnvsh0b2FW0HgqyvA+pw6YDRclQZBrR5y u6jD94rD++pJ8mFpvkzpLSHrBx8xG5RBL5ww9p2/q8mbzgkGZHLI9yqkrsPM8awxypcqG3WUgBv apXv6Xigs/9dtMhU27K15KEjooPVZ2PrfIbB4a1Aax6LV90UJu+RM//Kfgzszg3DSSwEuU1GO2d hUia7lX6wTlCOaGP/QibGVM+NMzuJl1WyfhOkpJAdOoAkJQgG9IDhHoihghlVv7VAmvz1QDstNJ gUAB6yUt5n9chNCOMs++xwXi+TNyZSsL2+SXNNk2lZQIvXWEqmtMI/df9PGycKdmngV97qu02EJ J2HqEN5 X-Received: by 2002:a05:6820:4c08:b0:6aa:fc2b:eb04 with SMTP id 006d021491bc7-6acbc18b823mr1907416eaf.50.1785430777643; Thu, 30 Jul 2026 09:59:37 -0700 (PDT) Received: from bapiya (75-166-225-82.hlrn.qwest.net. [75.166.225.82]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6acbc233efcsm1849524eaf.1.2026.07.30.09.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 09:59:36 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix type of imported variable for arraydim.exp Date: Thu, 30 Jul 2026 10:59:33 -0600 Message-ID: <20260730165933.2515411-1-tromey@adacore.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The test code for gdb.ada/arraydim.exp imports a variable using a dummy type. Then the test tries to print the type of this variable. This works ok with GCC, because the import is emitted as a declaration; but this fails with gnat-llvm, where a definition is emitted. This seems to be a test bug to me. This patch fixes the problem by using the correct type here. --- gdb/testsuite/gdb.ada/arraydim.exp | 7 ++++++- gdb/testsuite/gdb.ada/arraydim/foo.adb | 7 ++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.ada/arraydim.exp b/gdb/testsuite/gdb.ada/arraydim.exp index 7b84a7af9b7..815a91ffa82 100644 --- a/gdb/testsuite/gdb.ada/arraydim.exp +++ b/gdb/testsuite/gdb.ada/arraydim.exp @@ -52,8 +52,13 @@ gdb_test "print m'first(3)" " = 4" gdb_test "print m'last(3)" " = 6" gdb_test "print m'length(3)" " = 3" +# With GCC the test shows "int" as the element type, but with +# gnat-llvm it shows "integer"; both of these are reasonable enough so +# we accept either. The difference here is because GCC emits a +# declaration in the DWARF for foo.o, but gnat-llvm emits a +# definition. gdb_test "ptype global_3dim_for_gdb_testing" \ - "array \\(0 \\.\\. 0, 0 \\.\\. 1, 0 \\.\\. 2\\) of int" + [quotemeta "array (0 .. 0, 0 .. 1, 0 .. 2) of @/(int|integer)/"] gdb_test "print global_3dim_for_gdb_testing'first" " = 0" gdb_test "print global_3dim_for_gdb_testing'last" " = 0" diff --git a/gdb/testsuite/gdb.ada/arraydim/foo.adb b/gdb/testsuite/gdb.ada/arraydim/foo.adb index 86204956d00..8da63e1af93 100644 --- a/gdb/testsuite/gdb.ada/arraydim/foo.adb +++ b/gdb/testsuite/gdb.ada/arraydim/foo.adb @@ -18,11 +18,8 @@ procedure Foo is type Multi is array (1 .. 1, 2 .. 3, 4 .. 6) of Integer; M : Multi := (others => (others => (others => 0))); - -- Use a fake type for importing our C multi-dimensional array. - -- It's only to make sure the C unit gets linked in, regardless - -- of possible optimizations. - type Void_Star is access integer; - E : Void_Star; + type C_Multi is array (0 .. 0, 0 .. 1, 0 .. 2) of Integer; + E : C_Multi; pragma Import (C, E, "global_3dim_for_gdb_testing"); begin Do_Nothing (M'Address); -- STOP base-commit: 6d1be0b90e837e4c82eaaf6f9e8c7da7227902e1 -- 2.55.0