From patchwork Tue Sep 10 17:28:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce McCulloch X-Patchwork-Id: 97401 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FC80385C6C0 for ; Tue, 10 Sep 2024 17:31:54 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 10D603858D39 for ; Tue, 10 Sep 2024 17:31:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10D603858D39 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 10D603858D39 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1725989475; cv=pass; b=wc8/pdv4XFu4TbivP4kZwUCMJRE1RpZtgmaltDkK6b2diu7OfY6aLZVFxAE8QBB9edv+r2xzYy+tp0e+zSEMr7JEF2ZGAzI0Pf2fVwsjt/w8x7DOanc87QnFga9HeAPhER25MlwKnyE+ijymSQfHXteVE7mp7IlAG98LzzC0olE= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1725989475; c=relaxed/simple; bh=Mc0WnnoQpuoAHy9heStqJrw2hR/3hEIk9coI8HcSDrg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=emmB/PTlrbrHw+Q4e8SrA8fNOaLJt1uc5UFBKdV3wox5Y/i9r2AtTZrCgCYpo+gUzn4OZEoSO3oYtTzTtwFeZEucldKC8rpR4Aomdubp7o9Y//cKkm5NlFnIW8RCtHnOA4HQdoDTFWFOc5NB5SeSVGyrlH57Nvl6EsVFWFfj6xw= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48AHNYpH005825 for ; Tue, 10 Sep 2024 17:31:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=corp-2023-11-20; bh=7ExRzLr8DhMSZC 3gbxhKBWzfzgXxmQvIeuZExSu1v1w=; b=enPBE0yHhRZHJHJ6aNfsA03HApbdMi qEMFA/WfE+3T52is+gMnOtGKio3d6LhfUQovDqr3SCkuGnz0ZyWofmbEsh0J9qqJ 4BNrgJl+e+5ftHvAGSJtZMyA01X755TrsPwRrGKjl3PoxIJdiZFZ/2EntdtCVW2L 0ps4x+ct4uNZdtidNZPHp1duaSPhZch7aNJiIk5+P7ceQxvxZAzMzLKcJmyaOiWW NA39QxZvAmR+R0PANXy3QMwuySEPFLAEuDtNTRZqU7Q7vdBMjpH0rbkf7A4fCiio nHFh529cijpEYRUM3N9AQFVKO98kWeQ3cRYSsFHBKCYf4JNiwFLdQrJw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41gjbup0c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 10 Sep 2024 17:31:11 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48AH96cs006247 for ; Tue, 10 Sep 2024 17:31:10 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2046.outbound.protection.outlook.com [104.47.70.46]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41gd98wcpy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 10 Sep 2024 17:31:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sj2+BpgRIOKQM7APXwDF7MewAc6oP8Xu8TtEK2lxLTmj2kWdL8U+I+u2x6sEdct+xzXCcpOEyjCuOkp+DH7n++5/lHUDIJ37GEpZZzz3uHcjyz4bEruJH/JE4GcRlvRGEXVQWRn447bCrwSEGX14/lH8stNLFGwpqzgw706pw6lFXsST9EaueSkfARDrMj65T0qs1c4ivjQrSDziXCfVz4c8Qd4hWlXl9zBrDe8m2SEGZ1rEWFmdHkrKKCyrNiQc2y3HFsaSuMbt3MZIEYwzVau9VtlY25nAc4sGe3cO6sF7JecnmvMYIwzHKe19tfRmZoYtxzG2p0D9i9gXWyljaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7ExRzLr8DhMSZC3gbxhKBWzfzgXxmQvIeuZExSu1v1w=; b=EGxCNfb1QsH0/AfnlA1p+SdQCqtMpOkksxCjG7rxT6m0bPMWv/aDtmmSED7joOM2GfTpRU9YO0bDk9isfvO4eCZyDvsuB1f7KKSOLT2rRz1SGRDUruvfZ9AzH9lVH9Mq6VThxmzXFPb291jMs75Nw7PKXdya/We9KbtaEGin3BHapZvZmWnlKTUkxIXSdHxAGep4rNozaS85L2VhoDG1XQs07Y49d2UI7uwZw/mH0LGAyNCmUYpriO2a2K5fyKALYWL4crDFe8uYX3WWI2eJ6qjg2W9Dy3IA/dpexUjGEGn9xkAx1uVLPBsCg3+I+6mRlqu/CHGqNf/nwH4f6d6qnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7ExRzLr8DhMSZC3gbxhKBWzfzgXxmQvIeuZExSu1v1w=; b=pf0R23XRoZiBaFtBGhb4lQSQ09c3d0XONjICfGjgVLlr1IBaCx7/wB6HsEUn8eZOW+oD4qDsUUV7iyDOUQWJyeYJ8f2p7baFGBbs76oWyPsh/m6A7O++ENkU38X/FgtqJ5VCW32IDAzLHuwpeHGjUdnR32ldI8wOeePJqT8rcEM= Received: from DS0PR10MB6127.namprd10.prod.outlook.com (2603:10b6:8:c5::11) by SJ0PR10MB5835.namprd10.prod.outlook.com (2603:10b6:a03:3ef::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Tue, 10 Sep 2024 17:31:03 +0000 Received: from DS0PR10MB6127.namprd10.prod.outlook.com ([fe80::c040:624d:e343:2441]) by DS0PR10MB6127.namprd10.prod.outlook.com ([fe80::c040:624d:e343:2441%3]) with mapi id 15.20.7939.010; Tue, 10 Sep 2024 17:31:03 +0000 From: Bruce McCulloch To: binutils@sourceware.org Cc: Bruce McCulloch Subject: [PATCH] libctf: print array dimensions in the right order Date: Tue, 10 Sep 2024 13:28:36 -0400 Message-ID: <20240910172835.45289-2-bruce.mcculloch@oracle.com> X-Mailer: git-send-email 2.43.5 X-ClientProxiedBy: BY1P220CA0016.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::13) To DS0PR10MB6127.namprd10.prod.outlook.com (2603:10b6:8:c5::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB6127:EE_|SJ0PR10MB5835:EE_ X-MS-Office365-Filtering-Correlation-Id: a129d108-2731-42b4-db20-08dcd1be5808 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: vlF7B1LtDKYLSoOkkVJRoMnXYKfRVBxnN4qPHgxcb8yZRql6l7NX8bK2XjlMiA4Ai+GSEvCMImmbzba4Zi1IsCEXR8uz0wY9KLQWOZxPl3qZFYxzswb8FZeqYcU8ePSWetvSUWZU6xIAB68VHSDL28kEF72v8bzTe8+zvRiyTkIC93/6ITvz+QHtauE8v+9GciL5/gu/qm3gzk6p6Fp1ti8T3fUaWngeKSp68ZFF1Ah+p7iyXkchp7Keg2Dnl+Ud7JBXHcF77XQqUxCtFZF3b1wqeAi6Xq+mUbzSslnvzM9AV8buO8uLCC1pAIQQs3oAtCDEpgl83N7UGAiT1julisU9PVqr1DPdWm7CYehkD60u1Z9slK6xW7sZkXXK+sHkF8pf9VdcJxjbOykSsZNDcF016vdkeARR07Vcwgm6X8QlQLyozHPJ680cHVbVDpOYa3Z7DYthzZg0x25Ob+c4h3OhZYW9migxK/RUbSofLznWUyZ6/pqRITR4kPKXdcdnpJ54cUkmfHsk+h9ZKvoFnJ8PAcAVtvM0EprX4lnIOjKQmGIdqhJe2dXrdmdJbFgL0NMisQNXBMZiuZfX/NC3RKEcvXiBWzM7gT6/L5GRhwn6uB2FLWdTNma5VHLIfgTMAYUkPX5R9ZyPcfZNGK081h/BVLN1CZPGKVLc7JWWGoOmkF7rd0c4FWxbRbNH8ADzSUqmBh426Bjz9VksBHPu7AmnMRosGXPg6Rq2mwUM5XCzIaHpCdDDD7USJnHUdG8oq0Qz0jhu9fUmsC/Bys1nPncoattomV+853VAaBk0U8Z4hUlVPPC9CWvA8stpMSU9Rd91p+esrVtDr8lFhm12g0EDcfGf5qz1A3yyNq8ZfTKGu8lR/QGiNpVH2fAP0PDDlF+WCJ30To2cQild/2IFSdCJfM+ziGfXvn4//HLwz0DukDDDyMRSNLHq2LL+nJn4ZeQyoE8qXj1cN9d5l5BfG5JPIlZmCsEyJdx4eTOHmyrXfs7xBxuo9nxlVgM9pArGnFxb8vg3ym7Pil/B9S/SWa/wY+hHonBk2NQQdEZtKuNdsZn7Hrckhk0s4XDQTsmG9T/sx6CVNZOXn0np3t6e7kpK1QDB4D0Fk2sTawIuobZVjPog7zcR+mDBErXAiIatiUKajnmcB/tASG/HkTLyWLPl82jU5LQUc8QQo3xISlRpU+dGfEH8fzOy+KeDQL8XHHt+5tQw/ySi6TFnQnJPTHJ7UPaldGQlTQtnbv6M2Ymtv5OFvX391e26sxqMNjtkmuAvFUn9MERUNs8YUYHdNjEtCIGug+xZCxXgkCLkfiYu2PiPuC4h7Uv8LSBp4UndkGkPQ+O4K/YMJQ2vbyIfTA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR10MB6127.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QmqlBqtB4Gtgf3KjZ5fqyeeF8vuEAVNaDJ4EAF5oV/3cC7cKEddnjhqysXABvCdDgUYWgWhbFyc7tk86N+xmSN0H3TnbRiWE3giT2Zcu6ImIzc8KcDMyfBNpROYba1vwy89ggiPdSzRc4HM1ANqaDRxEVOTXCRxsY9xfMYJOAbWmOj6TOLEO3+IJagswYGWHcTaxQ9r0xcVb0vw3DYNSCG+zeeXGftlkNNqyI1e2zOr61bpYeB3eUQnYCHkRcqa5Ke63EqofMmJ7DobqRy/CAvRY7m7WGWABaq3kHGU6pNQPWlE7sJ4klLwyyRnLd3M9JSIEm6QCv1YepU/04Dtn8nWWUadj5YbI/ar/H1ZhVJthTD4a1ZrlUwGY816N6p9MaGvOU66lR2nhiDhNXHiOZHmWvCSUf6d+HyTI+gWPwyRuM2ChILvQJgOVRyFR5a28QzZokxZLgIuEffXzyAKoZ30lV/AOjPAQgIQwHfzpt7uBN9BL3d0nIo7Zc1PzT+QTrDEMpWLJyzmOVBPMIx+wOwSX8nazud4sReq7XtCcRjx18L0cfDonXoC5tEcT7z+s6kjDdoVTph+SYNlKV0vPAsOa0DS4luR/ARakabICtZOUMDcZTXR98sMDNpNcFBSOP65TTmG5QUv+mJsk9HMepCixUBpxA0dnsV1Ga1RhZCsSC+S7Is5BV77x+A4lY9I0f9dHAcL6Z9KNpEJs4eraSXuQdl1SXTuGutGVr2Vrb8f011yvU12s+JEQXGqyVZdzPbE65oR0XxnLUtISsFz94F9xgvaIThJv1TFQnir8OTQ7Gttw+Ifedho1fZIbY1PZgAxJLK3ZXM2WN0EAf9rg1OyhoCas1zbRa9xWYa6AZ5mgyLniCuQ6gQrvfU5vS4UpcbiqRSQ0CDQffcBJ+AC1tSeztRdKFoG1bytxejWLg+RIkjXAHe901riM2RRIrbITuxZYP7tI+48A5Nvk2d9TBerZ6dYycxGsItLkV3vtLrYNdwgqFZvvnL71S8DHM7FKEm64MhpIvB/uXLGvsdvatq8HyzP/ZbyBP5ifgRp5OmMPs8SCFpAPFo/VWVJFAamMWcjgbkpcNfzqEPdV/A1kny79YrN8b/r5Zce6EdaNlKNKuZdDcEedbb3QmmrKrq5jjJB94lkYgWuSe527eMQbwE5txbkVveVGm6Blc5lLywaISo+RbvSKEwJzjghO8mYyRHoVljLReCQeOsuHOuALDVNSdqwDcvjHeWDAUQ7XfrtUCOhNDFYPQrDMyps5+iOdyYEfmQJQvxsm6yrPhO6+dPTvCEIhfHhVod5OWnCPheBHvFFJ4aE/DWrZaUQA7H0Yptkho1MJi425OSdpVxC5xBda8Irzn5dVmLDWYy9Q9g7Q/5uVP+CRr+xWoSEsJ3xA4WRaDJrKbrnWYrPffNOelf4HheGrrTMt3KWiVVNqcyhsOHYaulzQkK5hU1FZ1z0Ilf5sZap1+EvxRvZsDXSmOEJ7TVqb9Kuinj0X0VtEL8s+utdzgs6Sm+/KlDVD4sDWYLCFzn9hexdo1EqKUpEsWXJpAWD7vEE/Auxm3XhWD6CXoL0P/TZfHiKaX3m1XFnJqd8+Z1lQKs80HPf/60nO3L5Zt8d5kXpLaLJM9C2opLk= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: nclXH4kf6WR2rTobA81St+9u+yy9rrsi7qZcC6nt7kSNcffvgqTMb+REReBxxUADu46CgXLouG8c0XWG3WbjoV49InpA7U73aDjRJlpfjFL+qTdivqHGZcIkfJgU4tsg36IZJjIobQD1kGvhG6NMM4bresKqYgw5PdBpOwiCcATZGZKsoKVjBIxo2cCWGAwm58nXf0sGJJLgVMsJL76y7Bb47EkuMIdro0Goa3HyPRH0i+ZvdkYLDJrVkhDW/6sHWiqhAGz45lvwhKjFSiSYnIFfvycl3kLFXiNgOjksVhRMPFgb5G0AzRHaxTj22Y+tTWS7moYLJX/69jFd6uYU13eLTPyZiHJ961CiP/GxLuxe+qpeXX91CI+vXP8j27h1C0sxTu9lMTe5gBhqU/2um9+iIzSSnre28vz0c5VdFn0uMOZ8vSi2SJ33u2157WWileNXfgD11f1loMrP7WjXEK+7hmciLSxnBoomGPvXYIMEejYWAO6bDRoLX9/wH8BXrWlFA4SSMyPJv+8S6wmlnUW/SUebQym4CSdfsgJrSw3Wjkk9iLDPWJTk7mB2EC/l3VtqCY8wSS6FKvHTtXxWMEpJ3Kaqbww2EObckjx/2nE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a129d108-2731-42b4-db20-08dcd1be5808 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB6127.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 17:31:03.2212 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MtqgEzVVqvhEymSylIuKHaOjniFO4SGNRI4XlUvZh7JyVK9O9o42+bVPB70D5S3TllNDXGVRraL3BxwpotldgHec04KNsqpU7JtX0KlVd/M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5835 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_06,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409100130 X-Proofpoint-GUID: q3YsxN4_Q3dqgAe21mIdsyfOyQBwDtfa X-Proofpoint-ORIG-GUID: q3YsxN4_Q3dqgAe21mIdsyfOyQBwDtfa X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Hi All, This is the patch relating to bug 32161, which I just posted. I'm mostly looking for comments on how to proceed with this, given that applying this patch while using a version of gcc older than 14.2.0 would result in reversing the nelems of multidimensional arrays, which work properly with the current version of CTF and older versions of gcc. Bruce --- libctf/ChangeLog | 7 ++++ libctf/ctf-decl.c | 6 ++-- .../libctf-lookup/multidim-array-ctf.c | 2 ++ .../testsuite/libctf-lookup/multidim-array.c | 34 +++++++++++++++++++ .../testsuite/libctf-lookup/multidim-array.lk | 8 +++++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 libctf/testsuite/libctf-lookup/multidim-array-ctf.c create mode 100644 libctf/testsuite/libctf-lookup/multidim-array.c create mode 100644 libctf/testsuite/libctf-lookup/multidim-array.lk diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 5c53be7ec7a..703890342d2 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,10 @@ +2024-09-09 Bruce McCulloch + + * ctf-decl.c (ctf_decl_push): + * testsuite/libctf-lookup/multidim-array-ctf.c: New test. + * testsuite/libctf-lookup/multidim-array.c: New test. + * testsuite/libctf-lookup/multidim-array.lk: New test. + 2024-07-20 Nick Clifton * 2.43 branch point. diff --git a/libctf/ctf-decl.c b/libctf/ctf-decl.c index 2fd4bde1864..772d337b1ee 100644 --- a/libctf/ctf-decl.c +++ b/libctf/ctf-decl.c @@ -154,9 +154,11 @@ ctf_decl_push (ctf_decl_t *cd, ctf_dict_t *fp, ctf_id_t type) cd->cd_qualp = prec; /* By convention qualifiers of base types precede the type specifier (e.g. - const int vs. int const) even though the two forms are equivalent. */ + const int vs. int const) even though the two forms are equivalent. + As of gcc-14.2.0, arrays must also be prepended in order to dump with the + dimensions properly ordered. */ - if (is_qual && prec == CTF_PREC_BASE) + if ((is_qual && prec == CTF_PREC_BASE) || (kind == CTF_K_ARRAY)) ctf_list_prepend (&cd->cd_nodes[prec], cdp); else ctf_list_append (&cd->cd_nodes[prec], cdp); diff --git a/libctf/testsuite/libctf-lookup/multidim-array-ctf.c b/libctf/testsuite/libctf-lookup/multidim-array-ctf.c new file mode 100644 index 00000000000..e450e8112bd --- /dev/null +++ b/libctf/testsuite/libctf-lookup/multidim-array-ctf.c @@ -0,0 +1,2 @@ +int a[3][5][9]; +int b[1][2]; diff --git a/libctf/testsuite/libctf-lookup/multidim-array.c b/libctf/testsuite/libctf-lookup/multidim-array.c new file mode 100644 index 00000000000..56db6ff8507 --- /dev/null +++ b/libctf/testsuite/libctf-lookup/multidim-array.c @@ -0,0 +1,34 @@ +#include +#include +#include + +int +main (int argc, char *argv[]) +{ + ctf_archive_t *ctf; + ctf_dict_t *fp; + int err; + ctf_dump_state_t *state = NULL; + ctf_sect_names_t sect = CTF_SECT_TYPE; + char *item; + ctf_next_t *it = NULL; + ctf_id_t type; + + + if ((ctf = ctf_open (argv[1], NULL, &err)) == NULL) + goto open_err; + if ((fp = ctf_dict_open (ctf, NULL, &err)) == NULL) + goto open_err; + + while ((type = ctf_type_next (fp, &it, NULL, 1)) != -1) + printf("%s\n", ctf_type_aname(fp, type)); + + ctf_dict_close (fp); + ctf_close (ctf); + + return 0; + + open_err: + fprintf (stderr, "%s: cannot open: %s\n", argv[0], ctf_errmsg (err)); + return 1; +} diff --git a/libctf/testsuite/libctf-lookup/multidim-array.lk b/libctf/testsuite/libctf-lookup/multidim-array.lk new file mode 100644 index 00000000000..2e155d67fc6 --- /dev/null +++ b/libctf/testsuite/libctf-lookup/multidim-array.lk @@ -0,0 +1,8 @@ +# source: multidim-array-ctf.c +int +long unsigned int +int \[9\] +int \[5\]\[9\] +int \[3\]\[5\]\[9\] +int \[2\] +int \[1\]\[2\]