[llvm] 249acb8 - MC: Update tests that check column information

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 4 10:44:39 PDT 2025


Author: Fangrui Song
Date: 2025-07-04T10:44:34-07:00
New Revision: 249acb8e4913adcab94217fc3dd10386c3a58c34

URL: https://github.com/llvm/llvm-project/commit/249acb8e4913adcab94217fc3dd10386c3a58c34
DIFF: https://github.com/llvm/llvm-project/commit/249acb8e4913adcab94217fc3dd10386c3a58c34.diff

LOG: MC: Update tests that check column information

Remove \t to make column checking easier.
Replace {{[0-9]+}} with [[#]].
Remove some redundant column testing.

Added: 
    

Modified: 
    llvm/test/MC/AArch64/ilp32-diagnostics.s
    llvm/test/MC/ARM/lower-upper-errors-2.s
    llvm/test/MC/ARM/thumb-branches.s
    llvm/test/MC/ARM/thumb2-branch-ranges.s
    llvm/test/MC/ELF/relocation-alias.s
    llvm/test/MC/Mips/reloc-directive-bad-obj.s
    llvm/test/MC/RISCV/Relocations/expr-err.s

Removed: 
    


################################################################################
diff  --git a/llvm/test/MC/AArch64/ilp32-diagnostics.s b/llvm/test/MC/AArch64/ilp32-diagnostics.s
index 1529035903357..0679dea3135c0 100644
--- a/llvm/test/MC/AArch64/ilp32-diagnostics.s
+++ b/llvm/test/MC/AArch64/ilp32-diagnostics.s
@@ -6,99 +6,99 @@
 // ERROR: [[#@LINE-1]]:8: error: 8 byte PC relative data relocation is not supported in ILP32
 
 .xword sym+16
-// ERROR: [[#@LINE-1]]:8: error: 8 byte absolute data relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 8 byte absolute data relocation is not supported in ILP32
 
 .xword sym at AUTH(da,42)
 // ERROR: [[#@LINE-1]]:8: error: 8 byte absolute data relocation is not supported in ILP32
 
 .xword sym at AUTH(da,42,addr)
-// ERROR: [[#@LINE-1]]:8: error: 8 byte absolute data relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 8 byte absolute data relocation is not supported in ILP32
 
 movz x7, #:abs_g3:some_label
 // ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
 // ERROR:        movz x7, #:abs_g3:some_label
 
 movz x3, #:abs_g2:some_label
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x3, #:abs_g2:some_label
 
 movz x19, #:abs_g2_s:some_label
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x19, #:abs_g2_s:some_label
 
 movk x5, #:abs_g2_nc:some_label
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movk x5, #:abs_g2_nc:some_label
 
 movz x19, #:abs_g1_s:some_label
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x19, #:abs_g1_s:some_label
 
 movk x5, #:abs_g1_nc:some_label
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movk x5, #:abs_g1_nc:some_label
 
 movz x3, #:dtprel_g2:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x3, #:dtprel_g2:var
 
 movk x9, #:dtprel_g1_nc:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movk x9, #:dtprel_g1_nc:var
 
 movz x3, #:tprel_g2:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x3, #:tprel_g2:var
 
 movk x9, #:tprel_g1_nc:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movk x9, #:tprel_g1_nc:var
 
 movz x15, #:gottprel_g1:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movz x15, #:gottprel_g1:var
 
 movk x13, #:gottprel_g0_nc:var
-// ERROR: [[#@LINE-1]]:1: error: absolute MOV relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: absolute MOV relocation is not supported in ILP32
 // ERROR: movk x13, #:gottprel_g0_nc:var
 
 ldr x10, [x0, #:gottprel_lo12:var]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 // ERROR: ldr x10, [x0, #:gottprel_lo12:var]
 
 ldr x24, [x23, #:got_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 
 ldr x24, [x23, #:got_auth_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 
 add x24, x23, #:got_auth_lo12:sym
-// ERROR: [[#@LINE-1]]:1: error: ADD AUTH relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: ADD AUTH relocation is not supported in ILP32
 
 ldr x24, [x23, :gottprel_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 
 ldr x10, [x0, #:gottprel_lo12:var]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 // ERROR: ldr x10, [x0, #:gottprel_lo12:var]
 
 ldr x24, [x23, #:got_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 
 ldr x24, [x23, :gottprel_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store relocation is not supported in ILP32
 
 ldr x24, :got_auth:sym
 // ERROR: [[#@LINE-1]]:1: error: LDR AUTH relocation is not supported in ILP32
 
 adr x24, :got_auth:sym
-// ERROR: [[#@LINE-1]]:1: error: ADR AUTH relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: ADR AUTH relocation is not supported in ILP32
 
 adrp x24, :tlsdesc_auth:sym
-// ERROR: [[#@LINE-1]]:1: error: ADRP AUTH relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: ADRP AUTH relocation is not supported in ILP32
 
 ldr x24, [x23, :tlsdesc_auth_lo12:sym]
-// ERROR: [[#@LINE-1]]:1: error: 64-bit load/store AUTH relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: 64-bit load/store AUTH relocation is not supported in ILP32
 
 add x24, x23, :tlsdesc_auth_lo12:sym
-// ERROR: [[#@LINE-1]]:1: error: ADD AUTH relocation is not supported in ILP32
+// ERROR: [[#@LINE-1]]:[[#]]: error: ADD AUTH relocation is not supported in ILP32

diff  --git a/llvm/test/MC/ARM/lower-upper-errors-2.s b/llvm/test/MC/ARM/lower-upper-errors-2.s
index 58c1f11792300..6561b0751930f 100644
--- a/llvm/test/MC/ARM/lower-upper-errors-2.s
+++ b/llvm/test/MC/ARM/lower-upper-errors-2.s
@@ -11,7 +11,7 @@
 // CHECK: [[@LINE+1]]:1: error: unsupported relocation
 adds r0, r0, #foo
 
-// CHECK: [[@LINE+1]]:1: error: unsupported relocation
+// CHECK: [[@LINE+1]]:[[#]]: error: unsupported relocation
 add r9, r0, #foo
 
 // CHECK: [[@LINE+1]]:1: error: expected relocatable expression

diff  --git a/llvm/test/MC/ARM/thumb-branches.s b/llvm/test/MC/ARM/thumb-branches.s
index c9e1660e1cdb6..cef1e83729004 100644
--- a/llvm/test/MC/ARM/thumb-branches.s
+++ b/llvm/test/MC/ARM/thumb-branches.s
@@ -7,65 +7,65 @@
 // Thumb BL has range +- 4 Megabytes if CPU does not support Thumb2 or does not
 // have v8-M baseline ops, it is +- 16 Megabytes otherwise.
 
-        .code 16
-        bl      shortend
-        .space 0x3fffff
+.code 16
+bl      shortend
+.space 0x3fffff
 shortend:
 // CHECKSHORT-NOT: error:
-// CHECKSHORT: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl      shortend2
-        .space 0x400000
+// CHECKSHORT: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl      shortend2
+.space 0x400000
 shortend2:
 
-// CHECKSHORT: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl      end
-        .space 0xffffff
+// CHECKSHORT: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl      end
+.space 0xffffff
 end:
-        bl      end2
-        .space 0xffffff
-        .global end2
+bl      end2
+.space 0xffffff
+.global end2
 end2:
 
-        bl      end3
-        .space 0x1000000
-        .global end3
+bl      end3
+.space 0x1000000
+.global end3
 end3:
 
 // CHECK-NOT: error:
 // CHECKSHORT-NOT: error:
-// CHECKSHORT: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
-// CHECK: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl      end4
-        .space 0x1000000
+// CHECKSHORT: [[@LINE+2]]:[[#]]: error: Relocation out of range
+// CHECK: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl      end4
+.space 0x1000000
 end4:
 
 shortstart1:
-        .space 0x3ffffc
-        bl shortstart1
+.space 0x3ffffc
+bl shortstart1
 
 shortstart2:
-        .space 0x400000
-// CHECKSHORT: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl shortstart2
+.space 0x400000
+// CHECKSHORT: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl shortstart2
 
 start1:
-        .space 0xfffffc
-// CHECKSHORT: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl start1
+.space 0xfffffc
+// CHECKSHORT: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl start1
 
-        .global start2
+.global start2
 start2:
-        .space 0xfffffc
-        bl start2
+.space 0xfffffc
+bl start2
 
-        .global start3
+.global start3
 start3:
-        .space 0xfffffd
-        bl start3
+.space 0xfffffd
+bl start3
 
 // CHECK-NOT: error:
 start4:
-        .space 0xfffffd
-// CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
-// CHECKSHORT: [[@LINE+1]]:{{[0-9]}}: error: Relocation out of range
-        bl start4
+.space 0xfffffd
+// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range
+// CHECKSHORT: [[@LINE+1]]:[[#]]: error: Relocation out of range
+bl start4

diff  --git a/llvm/test/MC/ARM/thumb2-branch-ranges.s b/llvm/test/MC/ARM/thumb2-branch-ranges.s
index fc8044acde8a3..495ceb87f6c18 100644
--- a/llvm/test/MC/ARM/thumb2-branch-ranges.s
+++ b/llvm/test/MC/ARM/thumb2-branch-ranges.s
@@ -26,7 +26,7 @@ end3:   bx lr
 
 // branch to thumb function is resolved at assembly time
 // CHECK-NOT: error:
-// CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
+// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range
 // CHECK-LABEL: b.w end4
         b.w end4
         .space 0x1000000
@@ -47,7 +47,7 @@ end6:   bx lr
 
 // conditional branch to thumb function resolved at assembly time
 // CHECK-NOT: error:
-// CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
+// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range
 // CHECK-LABEL: beq.w end7
         beq.w end7
         .space 0x100000
@@ -70,7 +70,7 @@ start3:
         .space 0x1000000
 // branch to thumb function resolved at assembly time
 // CHECK-NOT: error:
-// CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
+// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range
 // CHECK-LABEL: b.w start3
         b.w start3
 
@@ -91,12 +91,12 @@ start6:
         .space 0x100000
 // branch to thumb function resolved at assembly time
 // CHECK-NOT: error:
-// CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
+// CHECK: [[@LINE+2]]:[[#]]: error: Relocation out of range
 // CHECK-LABEL: beq.w start6
         beq.w start6
 
 start7:
 // branch to thumb function resolved at assembly time
-// CHECK: [[#@LINE+1]]:{{[0-9]}}: error: Relocation out of range
+// CHECK: [[#@LINE+1]]:[[#]]: error: Relocation out of range
         b.w start8 - start7 + 0x1000000
 start8:

diff  --git a/llvm/test/MC/ELF/relocation-alias.s b/llvm/test/MC/ELF/relocation-alias.s
index 9720a55556ed0..d35e741a9449d 100644
--- a/llvm/test/MC/ELF/relocation-alias.s
+++ b/llvm/test/MC/ELF/relocation-alias.s
@@ -2,8 +2,8 @@
 # RUN: llvm-objdump --no-print-imm-hex -dr %t | FileCheck %s
 # RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYM
 
-# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR0=1 %s 2>&1 | FileCheck %s --check-prefix=ERR0 --implicit-check-not=error:
-# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR=1 %s 2>&1 | FileCheck %s --check-prefix=ERR
+# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR0=1 %s -o %t 2>&1 | FileCheck %s --check-prefix=ERR0 --implicit-check-not=error:
+# RUN: not llvm-mc -filetype=obj -triple x86_64 --defsym ERR=1 %s -o %t 2>&1 | FileCheck %s --check-prefix=ERR
 
 ## If a fixup symbol is equated to an undefined symbol, convert the fixup
 ## to be against the target symbol, even if there is a variant (@PLT).

diff  --git a/llvm/test/MC/Mips/reloc-directive-bad-obj.s b/llvm/test/MC/Mips/reloc-directive-bad-obj.s
index 94317d0830df7..38056badffca2 100644
--- a/llvm/test/MC/Mips/reloc-directive-bad-obj.s
+++ b/llvm/test/MC/Mips/reloc-directive-bad-obj.s
@@ -1,9 +1,9 @@
 # RUN: not llvm-mc -triple mips-unknown-linux %s -show-encoding \
 # RUN:     -target-abi=o32 -filetype=obj 2>&1 | FileCheck %s
-	.text
-	nop
-	.reloc foo, R_MIPS_32, .text  # CHECK: :[[@LINE]]:2: error: unresolved relocation offset
-	nop
-	nop
-	.reloc bar, R_MIPS_32, .text  # CHECK: :[[@LINE]]:2: error: unresolved relocation offset
-	nop
+.text
+nop
+.reloc foo, R_MIPS_32, .text  # CHECK: :[[@LINE]]:1: error: unresolved relocation offset
+nop
+nop
+.reloc bar, R_MIPS_32, .text  # CHECK: :[[@LINE]]:1: error: unresolved relocation offset
+nop

diff  --git a/llvm/test/MC/RISCV/Relocations/expr-err.s b/llvm/test/MC/RISCV/Relocations/expr-err.s
index 897004b646368..72c33c7ff5eff 100644
--- a/llvm/test/MC/RISCV/Relocations/expr-err.s
+++ b/llvm/test/MC/RISCV/Relocations/expr-err.s
@@ -3,26 +3,26 @@
 .Ltmp1:
 	.quad	tls
 
-	lui a0, %hi(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	lw a0, %lo(tls+0-.Ltmp1)(t0)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	lui a0, %tprel_hi(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	add a0, a0, tp, %tprel_add(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	addi a0, a0, %tprel_lo(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	auipc a0, %tls_ie_pcrel_hi(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	auipc a0, %tls_gd_pcrel_hi(tls+0-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	auipc a0, %pcrel_hi(tls-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	auipc a0, %got_pcrel_hi(tls-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
-	addi a0, a0, %pcrel_lo(tls-.Ltmp1)
-# CHECK: :[[#@LINE-1]]:2: error: expected relocatable expression
+lui a0, %hi(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+lw a0, %lo(tls+0-.Ltmp1)(t0)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+lui a0, %tprel_hi(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+add a0, a0, tp, %tprel_add(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+addi a0, a0, %tprel_lo(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+auipc a0, %tls_ie_pcrel_hi(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+auipc a0, %tls_gd_pcrel_hi(tls+0-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+auipc a0, %pcrel_hi(tls-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+auipc a0, %got_pcrel_hi(tls-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
+addi a0, a0, %pcrel_lo(tls-.Ltmp1)
+# CHECK: :[[#@LINE-1]]:1: error: expected relocatable expression
 
 #	tail tls+32
 #	tail tls-tls


        


More information about the llvm-commits mailing list