[llvm] [gold] Don't hardcode section index in test (PR #222339)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 07:23:54 PDT 2026


https://github.com/nikic created https://github.com/llvm/llvm-project/pull/222339

This can either be 1 or 2 depending on whether binutils was
compiled with --enable-rosegment=yes. The test does not care
about the index (only the address), so make it a wildcard.

>From b5153b63b47b32a534c9de753f925f9ebe136f88 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Wed, 9 Sep 2026 16:20:34 +0200
Subject: [PATCH] [gold] Don't hardcode section index in test

This can either be 1 or 2 depending on whether binutils was
compiled with --enable-rosegment=yes. The test does not care
about the index (only the address), so make it a wildcard.
---
 llvm/test/tools/gold/X86/multiple-sections.ll | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/test/tools/gold/X86/multiple-sections.ll b/llvm/test/tools/gold/X86/multiple-sections.ll
index 7693f825da683..e677057e3acad 100644
--- a/llvm/test/tools/gold/X86/multiple-sections.ll
+++ b/llvm/test/tools/gold/X86/multiple-sections.ll
@@ -9,9 +9,9 @@
 
 ; Check that the order of the sections is tin -> _start -> pat.
 
-; CHECK:      [[#%x, ADDR:]]       1  FUNC    LOCAL  DEFAULT    1 pat
-; CHECK:      [[#%x, ADDR - 31]]   1  FUNC    LOCAL  DEFAULT    1 tin
-; CHECK:      [[#%x, ADDR - 15]]   15 FUNC    GLOBAL DEFAULT    1 _start
+; CHECK:      [[#%x, ADDR:]]       1  FUNC    LOCAL  DEFAULT    [[#IDX:]] pat
+; CHECK:      [[#%x, ADDR - 31]]   1  FUNC    LOCAL  DEFAULT    [[#IDX]] tin
+; CHECK:      [[#%x, ADDR - 15]]   15 FUNC    GLOBAL DEFAULT    [[#IDX]] _start
 
 ;--- order
 .text : {



More information about the llvm-commits mailing list