Message ID | 20220901195340.10653-1-david.faust@oracle.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp404289wro; Thu, 1 Sep 2022 12:54:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR7NoTDttAQzBIt72m97jmdJ6xZLfwH4BfFxJJpKj2YDpI+CeCtEujc+REqIy82tnp6zLfMm X-Received: by 2002:a17:907:1dc8:b0:741:61eb:9fba with SMTP id og8-20020a1709071dc800b0074161eb9fbamr17099391ejc.665.1662062078782; Thu, 01 Sep 2022 12:54:38 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dn4-20020a05640222e400b00446e24b2328si42942edb.133.2022.09.01.12.54.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 12:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rLR6SMGd; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 920493858403 for <ouuuleilei@gmail.com>; Thu, 1 Sep 2022 19:54:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 920493858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662062077; bh=g+E851+sAi22KV9L3PXzdhXIR2ruOB5MC5xl1Ny0w1Q=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rLR6SMGdmZhyMzJyKhsVM82ALEP5aR1TMLyRb4CwmBFb9rzA+8yNFCluXoMg6vr6e WRxVq0zOIgqkeZ+tiAnpAR3RjX6qOZHrMUbw9TU2bDE69DcYm+qm3c4ZxVTaUXc+kE nSGpIByDsJyqH5vf1qPpKIrNizGtd8RowWt90Udw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 8B7BC385841A for <gcc-patches@gcc.gnu.org>; Thu, 1 Sep 2022 19:53:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B7BC385841A Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 281HJZLV031367 for <gcc-patches@gcc.gnu.org>; Thu, 1 Sep 2022 19:53:48 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7bttdcfp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Thu, 01 Sep 2022 19:53:48 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 281IDaxh002291 for <gcc-patches@gcc.gnu.org>; Thu, 1 Sep 2022 19:53:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q6wnc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <gcc-patches@gcc.gnu.org>; Thu, 01 Sep 2022 19:53:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YRTVkFWIlE379oK9iD9Kwgc0C/2DzoMHgzsBabiL0zeeo9l4Bq90jBYMCKmOdB/HLUVEoScWM8bTvK9U/bDbNxhah+2E+wYZSJUf/VxgrevoaaAzMhV65wKHGk7uJKYb8znRantFCuhNH4QtxxrAa7AOEY4xXCAdeHHPgPXy9TBaQgqgcZIpKf0xBs+f3RbMbqEN1hwfGyY2L5Re45JY5z3IPvaUN6wPiuRv9HkeEUh7Rr8slgJowZ1WUBoAot6wKBgLwOm+XXwKuSnusGgAjjGKnZfg3QzOXykWDJkdYuL7c2/pedQUvxUCOZLGOWgSasJ9BgPYDRiQ6aZMu7RMaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=g+E851+sAi22KV9L3PXzdhXIR2ruOB5MC5xl1Ny0w1Q=; b=BEidkC6evUxL+E5SoAxvBZAjlUwAp08WLe3RShbFdn0yEivS2beoo+nmqdbodHV5g4aYULbnoT4ICbx40Z4qC3g/TH0vhUPmG6Xp35nUV0Foov+iIU01mkOptKZnE9Odjky+wOtX1kvsBLp7XiSmZQtjdwSpV795wfGIf4+Zz9EwgCeMrFXfChZB0pN+kBK0iyYaA3QtvrP02g1z8cTt+CFZ7lIyeSS9UkDk99Gpqv1zYNpDDYtDwyKdHxMKcS9NIv5eABhebZxgKzXmf4Sgs+Az4GQ62hMrVzRtkl1VIHm8dSARljrXmFIBYavLjWNMniW5UkbMGzZBFK6e2DSB7Q== 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 Received: from MN2PR10MB3213.namprd10.prod.outlook.com (2603:10b6:208:131::33) by PH0PR10MB5401.namprd10.prod.outlook.com (2603:10b6:510:e8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.12; Thu, 1 Sep 2022 19:53:44 +0000 Received: from MN2PR10MB3213.namprd10.prod.outlook.com ([fe80::815f:640c:8792:186b]) by MN2PR10MB3213.namprd10.prod.outlook.com ([fe80::815f:640c:8792:186b%5]) with mapi id 15.20.5566.021; Thu, 1 Sep 2022 19:53:44 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH] btf: do not skip emitting void variables [PR106773] Date: Thu, 1 Sep 2022 12:53:40 -0700 Message-Id: <20220901195340.10653-1-david.faust@oracle.com> X-Mailer: git-send-email 2.37.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0197.namprd13.prod.outlook.com (2603:10b6:a03:2c3::22) To MN2PR10MB3213.namprd10.prod.outlook.com (2603:10b6:208:131::33) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d14badfc-eb79-46ac-9a96-08da8c53ad34 X-MS-TrafficTypeDiagnostic: PH0PR10MB5401:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Man/JYLrQdbP/FrSd1TxM1CavKF5xly1WTnNsAY0kOennLvwiX20m79bhQnlAL18wpxJxd3heufwXWX+wAhzf9rJc6KxqGEYbZ+H3Yd/LMZgL9kVkMqwL+Uhvevf73kPePe2bLE/VsDPg9bYHr1qdxQrMRDXLlC9Qsv+HvDxMnwF8GktTcXfqZuPzYCwXBDs9R5zBh/rUxV9UHYAGZvirkICBQn5DFg+4okskUHWjIC3PEMlI/jwLTCPqksMemh+Rv4J+exqijeuIh3d2z/N0zcMiaPIZTVTLXBH9CpELZyhDoTFYmym6KdJEHh8oapbzHjwqBvFHDXUKTeHIDkxam82eNiUk4TQwRraUstF8l5uaeqQOHzkvg30AHkvl1JYccud3rJNZ24GIUzOftkgz8uV8aLUu2MTNf39pqBZkiH/SwGFCq8eULx+8Q0opZVe5Vkl5vuiA+3+G8yrOTmgmnrUB/Ux4oLgepCFl7lbE2bSHa7CHELO4vGx8WP42kc2TgKSUWS325dxrTok1yPeBxxM6PvStVIRVMorqNzoh+HacsVlhpsa58z1ziZPP3gWpiLCd9V9KGvxtM5SthV6XNq7oOMYWvuDfyskdQTvEKz3Ey4pkl9KinIvjt2hlPb8xkKXWABi+/4qIrOTQ+/9gLXUm++jNycm/3is+rrLeYLZeuG4H37bUjLTs8xqissHpmK0RZ/UWPDN8thop+JQcbSc5QnkjjstyZX22AVnH90= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB3213.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(376002)(366004)(136003)(39860400002)(396003)(8936002)(107886003)(6486002)(5660300002)(6666004)(41300700001)(478600001)(8676002)(66946007)(4326008)(66476007)(2616005)(83380400001)(1076003)(186003)(66556008)(86362001)(26005)(44832011)(2906002)(6506007)(6512007)(84970400001)(36756003)(38100700002)(6916009)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yFiIwbDmSoYpPqB0HnE7/WAWp2g/WOuUZotqeseYotj8b0X+YtOq+fdMXlV2O142DeDC41aAhLmRi8WmnNCP7b+Qrks3nKSWelbPajeRH55aZZxvVMM8c9laNi74rpGNcbmU6JDjYeu9FGbDLFNSkBV/vgOcfrZMBcQv3bV7RDC46Er+6hTfxP9nCt3YzXL0pFCIdYihLzAnL1oowDq+vl8Pxhu9+2VLOIxctzT/faAZ2qCuPdAioFUeKmoe4LHRnPMcDxsQLlsZCOoeSXUiv+cj8pzZ9VB53oXHVfBrjEFAVqKf71q5k614SEorVNfXXuB3etNdY+h3nlNEYsAFMmx5M54IOLFcx8XpWWHENNMAVOHkKdSkwhsNHMhwbd3vVntMdUauUilowRcP+MiVOO0HPxEN/sXg9d9qKcqn+rThYs1vDgbhjLNblndEfoZj8PtibDldW/rzaV9xg8orBQgEkduLPSdTD/YsSIHOfGSASCpj7BWkezUkU50HYLHxil0FlMzptBgdlDec0AqiD/NBjojuJS9qsUOB+c187Gs1LUoJjh6ICuxZJwrZ5bNYvSNBUCwYJYJehB6/E7lqb8wYWIYBDLDOlaVaW2WZJoJ8oj++oLcWSGYN8yYW/SeOO68u6ackixcMYlneOh820CUAebP6xipqYqBgx1/71MxCMbeqg2FIo066rkxkhF//64skyqeHdJ6TBPvvd7OvtLtdYHjyxzuZq+fuhNdsuk6vKY20f107vK5OjZXdRw0zacZ7nOLSze+Aa70n7maOhSUin5fyF9IOKebGe8jSwF4EgmyBCt5ORrlmaCK1JNDPlFQfICUg5gWpQTyjXDV65JlWZAQI9OEBZAo6zXRz6lH/hke++tgZbCca5cpOZE900Cc/U01Mpe3oyRoz9CKIgRYf//hyLQcmaWYN78Pw6red7NwBHMZNUzPZVm2IJo3vs/ff9zboI8rci1hdg25T2GQlbfDvsa1xRoyWo+/+gJUbmNn/nAAXutiDRqvRQ70yhnuebA977aklUdv1mc1CfYpExvLK/JSd/J7xSm20yvbZ7MzXpm5urus2GFHE2PupwM6wiOph0u00tOMB57i13GjCkYasBknHjXMgrOxNIfJZZydCs0NQe/wKwjHr4/eAbMuAOykV9Z7jgb+1a4FvnEFIwn230uC0n+Un1VL9bZo2hRjE9GmqA5D74qibcTQGVMlw1rVhKQAb/nzBtvSaoKMdMpgwMGgOE43JwFFIrIT0vxit9oq6Cqnxv0KrvYAHYjKQfbaCeWQkg4a8K10KPfmEj8gliYLS3NqvDCFKqDoJUCttWSVVnM4jxdajYSHQmMmiHXFc8ZYZtv8uNKQB1GpCsG+IVqJiXWiXCV77IQnGlxA/KSWeOuRmUHcXSlrOSQnxp/S/HR5TE2OFQrgxDAX1zMbnM66RRY+p0auKWSgPOPGTe+hVBiNRnBanNlXK4Wtcu0jO2Wf5OHN33EzAwcOU9SIyofdNx8jNApez8yqSLT0FV10M4MVMdge8krAk1lNwBYodxg64+oXJ1p9ROOQnltat3vyZRthu5OVPM/z0KNU0dICWRIbFd+oG4jZq X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d14badfc-eb79-46ac-9a96-08da8c53ad34 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB3213.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 19:53:44.3676 (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: rKmlaLnoYlCN1+Sb3rL3f1k5XMoPDOie75w5lWJb/gegGMVmMmz0NuQ0gWUa877qXG+md6NFJSbBb9S4+38yYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5401 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_12,2022-08-31_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209010087 X-Proofpoint-ORIG-GUID: Et7YyCCB7wQZxVcMR-hnjq34sH7m_p_0 X-Proofpoint-GUID: Et7YyCCB7wQZxVcMR-hnjq34sH7m_p_0 X-Spam-Status: No, score=-13.0 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: David Faust via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: David Faust <david.faust@oracle.com> Cc: indu.bhagat@oracle.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742798406036394660?= X-GMAIL-MSGID: =?utf-8?q?1742798406036394660?= |
Series |
btf: do not skip emitting void variables [PR106773]
|
|
Commit Message
David Faust
Sept. 1, 2022, 7:53 p.m. UTC
The eBPF loader expects to find BTF_KIND_VAR records for references to extern const void symbols. We were mistakenly identifing these as unsupported types, and as a result skipping emitting VAR records for them. Tested on bpf-unknown-none and x86_64, no known regressions. OK? Thanks. gcc/ChangeLog: PR target/106773 * btfout.cc (btf_dvd_emit_preprocess_cb): Do not skip emitting variables which refer to void types. gcc/testsuite/ChangeLog: PR target/106773 * gcc.dg/debug/btf/btf-pr106773.c: New test. --- gcc/btfout.cc | 2 +- gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c
Comments
On 9/1/22 12:53, David Faust wrote: > The eBPF loader expects to find BTF_KIND_VAR records for references to > extern const void symbols. We were mistakenly identifing these as > unsupported types, and as a result skipping emitting VAR records for > them. > > Tested on bpf-unknown-none and x86_64, no known regressions. > OK? Hi David, LGTM. Thanks, > > Thanks. > > gcc/ChangeLog: > > PR target/106773 > * btfout.cc (btf_dvd_emit_preprocess_cb): Do not skip emitting > variables which refer to void types. > > gcc/testsuite/ChangeLog: > > PR target/106773 > * gcc.dg/debug/btf/btf-pr106773.c: New test. > --- > gcc/btfout.cc | 2 +- > gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c | 21 +++++++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c > > diff --git a/gcc/btfout.cc b/gcc/btfout.cc > index 997a33fa089..37ec662c190 100644 > --- a/gcc/btfout.cc > +++ b/gcc/btfout.cc > @@ -430,7 +430,7 @@ btf_dvd_emit_preprocess_cb (ctf_dvdef_ref *slot, ctf_container_ref arg_ctfc) > ctf_dvdef_ref var = (ctf_dvdef_ref) * slot; > > /* Do not add variables which refer to unsupported types. */ > - if (btf_removed_type_p (var->dvd_type)) > + if (!voids.contains (var->dvd_type) && btf_removed_type_p (var->dvd_type)) > return 1; > > arg_ctfc->ctfc_vars_list[num_vars_added] = var; > diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c b/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c > new file mode 100644 > index 00000000000..4de15f76546 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c > @@ -0,0 +1,21 @@ > +/* Test BTF generation for extern const void symbols. > + BTF_KIND_VAR records should be emitted for such symbols if they are used. */ > + > +/* { dg-do compile } */ > +/* { dg-options "-O0 -gbtf -dA" } */ > + > +/* Expect 1 variable record only for foo. */ > +/* { dg-final { scan-assembler-times "\[\t \]0xe000000\[\t \]+\[^\n\]*btv_info" 1 } } */ > +/* { dg-final { scan-assembler-times "\[\t \]0x1\[\t \]+\[^\n\]*btv_linkage" 1 } } */ > + > +/* { dg-final { scan-assembler-times "ascii \"foo.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */ > + > +extern const void foo; > +extern const void bar; > + > +unsigned long func () { > + unsigned long x = (unsigned long) &foo; > + > + return x; > +} > +
diff --git a/gcc/btfout.cc b/gcc/btfout.cc index 997a33fa089..37ec662c190 100644 --- a/gcc/btfout.cc +++ b/gcc/btfout.cc @@ -430,7 +430,7 @@ btf_dvd_emit_preprocess_cb (ctf_dvdef_ref *slot, ctf_container_ref arg_ctfc) ctf_dvdef_ref var = (ctf_dvdef_ref) * slot; /* Do not add variables which refer to unsupported types. */ - if (btf_removed_type_p (var->dvd_type)) + if (!voids.contains (var->dvd_type) && btf_removed_type_p (var->dvd_type)) return 1; arg_ctfc->ctfc_vars_list[num_vars_added] = var; diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c b/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c new file mode 100644 index 00000000000..4de15f76546 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c @@ -0,0 +1,21 @@ +/* Test BTF generation for extern const void symbols. + BTF_KIND_VAR records should be emitted for such symbols if they are used. */ + +/* { dg-do compile } */ +/* { dg-options "-O0 -gbtf -dA" } */ + +/* Expect 1 variable record only for foo. */ +/* { dg-final { scan-assembler-times "\[\t \]0xe000000\[\t \]+\[^\n\]*btv_info" 1 } } */ +/* { dg-final { scan-assembler-times "\[\t \]0x1\[\t \]+\[^\n\]*btv_linkage" 1 } } */ + +/* { dg-final { scan-assembler-times "ascii \"foo.0\"\[\t \]+\[^\n\]*btf_string" 1 } } */ + +extern const void foo; +extern const void bar; + +unsigned long func () { + unsigned long x = (unsigned long) &foo; + + return x; +} +