From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id C78A93858D35 for ; Wed, 29 Sep 2021 05:47:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C78A93858D35 Received: by mail-pj1-x1031.google.com with SMTP id k23-20020a17090a591700b001976d2db364so1018838pji.2 for ; Tue, 28 Sep 2021 22:47:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=0C5A6GkwSX32l8inhLpn7bBDIZBGXd9cf6RxlxZG7mE=; b=T8jB3TjCb3r6up2ffhahzE1BlMIrUGdNX048eb6mpvzfsNhfC76pYK/v0Hq1TZhK9h jaNHV1F7nkLp2TpLLCZ9TOhQGzFhEgKnonG+rLAfoyp2+BA1A22agfLbCcxprMej3w/V EjP6wuYql6Cil9WRPhvU1O1bnJufKeH6r7Z3d9G3RkjZdc0ZUgMXidIDPn8eI6HLzGN3 PBu3Zu/c+9CXaIhejUdcssK61WO6CdR7fTzlvil6c1b14vbkR/nmpuzHJIU+FeASlcTB UWD9F8LrJ+FyNFB27HGqULp8b2ydqb9mBjSe5zUnof/6cGVfAH6CjgCKP1GCf+jawmPn JD8A== X-Gm-Message-State: AOAM531Ehx+AG8q0UYXfVblowJmmskaWHnD2m88T7cRc2AW6jH4D14U1 zFdvqYOUPPZsr33S0kv9YRdXGhkDAzo= X-Google-Smtp-Source: ABdhPJwyh1XNEixbnKFQ8ONicYm/gYzGWJrnsYnwNMxgaYTWc+Szd9x8dSGoUwLf7gPjLYd4J0bHGQ== X-Received: by 2002:a17:903:11c9:b0:13b:9a01:aa27 with SMTP id q9-20020a17090311c900b0013b9a01aa27mr8595244plh.46.1632894451382; Tue, 28 Sep 2021 22:47:31 -0700 (PDT) Received: from gnu-gram-1.localdomain (cpe-76-173-15-247.hawaii.res.rr.com. [76.173.15.247]) by smtp.gmail.com with ESMTPSA id r14sm1052340pgf.49.2021.09.28.22.47.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 22:47:31 -0700 (PDT) Received: from gnu-gram-1.localdomain (localhost [IPv6:::1]) by gnu-gram-1.localdomain (Postfix) with ESMTP id 081A4E0072 for ; Tue, 28 Sep 2021 22:47:29 -0700 (PDT) From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] Add a testcase for PR binutils/27202 Date: Tue, 28 Sep 2021 22:47:21 -0700 Message-Id: <20210929054721.1763491-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3032.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 05:47:34 -0000 If there are no objections, I will check in this tomorrow. PR binutils/27202 * testsuite/gas/elf/dwarf-5-loc0.d: New file. * testsuite/gas/elf/dwarf-5-loc0.s: Likewise. * testsuite/gas/elf/elf.exp: Run dwarf-5-loc0. --- gas/testsuite/gas/elf/dwarf-5-loc0.d | 16 ++++++++++++++++ gas/testsuite/gas/elf/dwarf-5-loc0.s | 11 +++++++++++ gas/testsuite/gas/elf/elf.exp | 1 + 3 files changed, 28 insertions(+) create mode 100644 gas/testsuite/gas/elf/dwarf-5-loc0.d create mode 100644 gas/testsuite/gas/elf/dwarf-5-loc0.s diff --git a/gas/testsuite/gas/elf/dwarf-5-loc0.d b/gas/testsuite/gas/elf/dwarf-5-loc0.d new file mode 100644 index 00000000000..eb752c9caed --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf-5-loc0.d @@ -0,0 +1,16 @@ +#as: -gdwarf-5 +#readelf: -wL +#name: DWARF5 .loc 0 +# The am33 cr16 crx ft32 mn10 msp430 nds32 and rl78 targets do not evaluate the subtraction of symbols at assembly time. +# The riscv targets do not support the subtraction of symbols. +#xfail: am3*-* cr16-* crx-* ft32*-* mn10*-* msp430-* nds32*-* riscv*-* rl78-* + +Contents of the \.debug_line section: + +CU: \./foo\.c: +File name +Line number +Starting address +View +Stmt + +\./foo.c:\[\+\+\] +foo\.c +1 +0x8 +x +foo\.c +2 +0x10 +x +foo\.c +- +0x10 diff --git a/gas/testsuite/gas/elf/dwarf-5-loc0.s b/gas/testsuite/gas/elf/dwarf-5-loc0.s new file mode 100644 index 00000000000..093d5bc39f3 --- /dev/null +++ b/gas/testsuite/gas/elf/dwarf-5-loc0.s @@ -0,0 +1,11 @@ + .file "foo.c" + .text + .balign 16 + .globl _start +_start: + .file 0 "foo.c" + .quad 0 + .loc 0 1 view 0 + .balign 16 + .loc 0 2 view 0 + .size _start, .-_start diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index ab862640974..df6b2851c78 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -300,6 +300,7 @@ if { [is_elf_format] } then { run_dump_test "dwarf-5-file0" $dump_opts run_dump_test "dwarf-5-file0-2" $dump_opts run_dump_test "dwarf-5-dir0" $dump_opts + run_dump_test "dwarf-5-loc0" $dump_opts run_dump_test "dwarf-4-cu" $dump_opts run_dump_test "dwarf-5-cu" $dump_opts run_dump_test "dwarf-5-nop-for-line-table" $dump_opts -- 2.31.1