[clang] [clang-tools-extra] [compiler-rt] [lld] [llvm] [NFC] Fix tests with invalid RUN directives (PR #179668)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 06:19:27 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld-elf
@llvm/pr-subscribers-clang-tools-extra
Author: Vladimir Vuksanovic (vvuksanovic)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/179668.diff
11 Files Affected:
- (modified) clang-tools-extra/test/clang-apply-replacements/format.cpp (+1-1)
- (modified) clang/test/DebugInfo/KeyInstructions/flag.cpp (+1-5)
- (modified) clang/test/Driver/hip-save-temps.hip (+3-3)
- (modified) clang/test/OpenMP/openmp_attribute_compat.cpp (+2-2)
- (modified) compiler-rt/test/ctx_profile/TestCases/autodetect-roots.cpp (+41-34)
- (modified) lld/test/ELF/linkerscript/data-segment-relro-ppc64.test (+11-19)
- (modified) llvm/test/CodeGen/Generic/cfi-sections.ll (+2-2)
- (modified) llvm/test/MC/Disassembler/ARM/fullfp16-neon-arm.txt (+3-3)
- (modified) llvm/test/MC/Disassembler/ARM/fullfp16-neon-thumb.txt (+6-6)
- (modified) llvm/test/tools/llvm-objcopy/ELF/change-section-address.test (+2-1)
- (modified) llvm/test/tools/obj2yaml/ELF/shstrtab.yaml (+2-2)
``````````diff
diff --git a/clang-tools-extra/test/clang-apply-replacements/format.cpp b/clang-tools-extra/test/clang-apply-replacements/format.cpp
index 0f40ef623d284..53851e58071d7 100644
--- a/clang-tools-extra/test/clang-apply-replacements/format.cpp
+++ b/clang-tools-extra/test/clang-apply-replacements/format.cpp
@@ -12,4 +12,4 @@
// RUN: FileCheck --strict-whitespace -input-file=%t.dir/Inputs/format/yes.cpp %S/Inputs/format/yes.cpp
// RUN: FileCheck --strict-whitespace -input-file=%t.dir/Inputs/format/no.cpp %S/Inputs/format/no.cpp
//
-// RUN not clang-apply-replacements -format=blah %t.dir/Inputs/format
+// RUN: not clang-apply-replacements -format=blah %t.dir/Inputs/format
diff --git a/clang/test/DebugInfo/KeyInstructions/flag.cpp b/clang/test/DebugInfo/KeyInstructions/flag.cpp
index 4a4a5c4c142a7..e3cc5bf62d2c7 100644
--- a/clang/test/DebugInfo/KeyInstructions/flag.cpp
+++ b/clang/test/DebugInfo/KeyInstructions/flag.cpp
@@ -3,7 +3,7 @@
// RUN: %clang -### -target x86_64 -c -gno-key-instructions %s 2>&1 | FileCheck %s --check-prefixes=NO-DEBUG
//// Help.
-// RUN %clang --help | FileCheck %s --check-prefix=HELP
+// RUN: %clang --help | FileCheck %s --check-prefix=HELP
// HELP: -gkey-instructions Enable Key Instructions, which reduces the jumpiness of debug stepping in optimized C/C++ code in some debuggers. DWARF only.
// KEY-INSTRUCTIONS: "-gkey-instructions"
@@ -14,10 +14,6 @@
// NO-DEBUG-NOT: debug-info-kind
// NO-DEBUG-NOT: dwarf
-//// Help hidden: flag should not be visible.
-// RUN: %clang --help | FileCheck %s --check-prefix=HELP
-// HELP-NOT: key-instructions
-
// Smoke test: check for Key Instructions keywords in the IR.
void f() {}
// RUN: %clang_cc1 %s -triple x86_64-linux-gnu -debug-info-kind=line-tables-only -emit-llvm -o - | FileCheck %s --check-prefix=SMOKETEST-OFF
diff --git a/clang/test/Driver/hip-save-temps.hip b/clang/test/Driver/hip-save-temps.hip
index 142c3f1611a36..8cb5a60aa7e72 100644
--- a/clang/test/Driver/hip-save-temps.hip
+++ b/clang/test/Driver/hip-save-temps.hip
@@ -24,9 +24,9 @@
// RUN: FileCheck -check-prefixes=CHECK,RDC,RDCL,NOUT %s
// -fgpu-rdc with -o
-// UN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
-// UN: -nogpuinc -o executable -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
-// UN: FileCheck -check-prefixes=CHECK,RDC,RDCL,WOUT %s
+// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \
+// RUN: -nogpuinc -o executable -fgpu-rdc --offload-arch=gfx900 %s 2>&1 | \
+// RUN: FileCheck -check-prefixes=CHECK,RDC,RDCL,WOUT %s
// -fgpu-rdc host object path
// RDCL: "{{.*clang.*}}" "-cc1" {{.*}} "-E" {{.*}} "-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.hipi"
diff --git a/clang/test/OpenMP/openmp_attribute_compat.cpp b/clang/test/OpenMP/openmp_attribute_compat.cpp
index 69b809d45b43c..e37798bf93313 100644
--- a/clang/test/OpenMP/openmp_attribute_compat.cpp
+++ b/clang/test/OpenMP/openmp_attribute_compat.cpp
@@ -8,8 +8,8 @@
// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fsyntax-only -verify=off -Wno-openmp-51-extensions %s
// RUN: %clang_cc1 -fopenmp -fsyntax-only -verify=pre -Wpre-openmp-51-compat -x c -std=c2x %s
-// RUN-: %clang_cc1 -fopenmp -fsyntax-only -verify=off -x c -std=c2x %s
-// RUN-: %clang_cc1 -fopenmp -fopenmp-version=50 -fsyntax-only -verify=ext -Wopenmp -x c -std=c2x %s
+// RUN: %clang_cc1 -fopenmp -fsyntax-only -verify=off -x c -std=c2x %s
+// RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -fsyntax-only -verify=ext -Wopenmp -x c -std=c2x %s
// off-no-diagnostics
diff --git a/compiler-rt/test/ctx_profile/TestCases/autodetect-roots.cpp b/compiler-rt/test/ctx_profile/TestCases/autodetect-roots.cpp
index a6e0d920cbc82..8631757a2ae19 100644
--- a/compiler-rt/test/ctx_profile/TestCases/autodetect-roots.cpp
+++ b/compiler-rt/test/ctx_profile/TestCases/autodetect-roots.cpp
@@ -13,7 +13,11 @@
// RUN: -mllvm -profile-context-root="<autodetect>" -g -Wl,-export-dynamic
//
// Run the binary, and observe the profile fetch handler's output.
-// RUN %t.bin | FileCheck %s
+// RUN: %t.bin > %t.log
+// The check is split because the root order is non-deterministic.
+// RUN: cat %t.log | FileCheck %s
+// RUN: cat %t.log | FileCheck %s --check-prefix=CHECK-ROOT1
+// RUN: cat %t.log | FileCheck %s --check-prefix=CHECK-ROOT2
#include "CtxInstrContextNode.h"
#include <atomic>
@@ -110,40 +114,43 @@ class TestProfileWriter : public ProfileWriter {
// discern (with the current autodetection mechanism) if theRoot
// (Guid:8657661246551306189) is ever re-entered.
//
-// CHECK: Entered Context Section
-// CHECK-NEXT: Entering Root 6759619411192316602 with total entry count 12463157
-// CHECK-NEXT: Guid: 6759619411192316602
-// CHECK-NEXT: Entries: 5391142
-// CHECK-NEXT: 2 counters and 3 callsites
-// CHECK-NEXT: Counter values: 5391142 1832357
-// CHECK-NEXT: At Index 0:
-// CHECK-NEXT: Guid: 434762725428799310
-// CHECK-NEXT: Entries: 3558785
-// CHECK-NEXT: 1 counters and 0 callsites
-// CHECK-NEXT: Counter values: 3558785
-// CHECK-NEXT: At Index 1:
-// CHECK-NEXT: Guid: 5578595117440393467
-// CHECK-NEXT: Entries: 1832357
-// CHECK-NEXT: 1 counters and 0 callsites
-// CHECK-NEXT: Counter values: 1832357
-// CHECK-NEXT: At Index 2:
-// CHECK-NEXT: Guid: 3950394326069683896
-// CHECK-NEXT: Entries: 5391142
-// CHECK-NEXT: 1 counters and 0 callsites
-// CHECK-NEXT: Counter values: 5391142
-// CHECK-NEXT: Entering Root 3950394326069683896 with total entry count 11226401
-// CHECK-NEXT: Guid: 3950394326069683896
-// CHECK-NEXT: Entries: 10767423
-// CHECK-NEXT: 1 counters and 0 callsites
-// CHECK-NEXT: Counter values: 10767423
-// CHECK-NEXT: Exited Context Section
+// CHECK: Entered Context Section
+// CHECK: Entering Root
+// CHECK: Entering Root
+// CHECK-NOT: Entering Root
+// CHECK-ROOT1: Entering Root 6759619411192316602 with total entry count {{[0-9]+}}
+// CHECK-ROOT1-NEXT: Guid: 6759619411192316602
+// CHECK-ROOT1-NEXT: Entries: [[ROOT1_COUNTER1:[0-9]+]]
+// CHECK-ROOT1-NEXT: 2 counters and 3 callsites
+// CHECK-ROOT1-NEXT: Counter values: [[ROOT1_COUNTER1]] [[ROOT1_COUNTER2:[0-9]+]]
+// CHECK-ROOT1-NEXT: At Index 0:
+// CHECK-ROOT1-NEXT: Guid: 434762725428799310
+// CHECK-ROOT1-NEXT: Entries: [[ROOT1_COUNTER3:[0-9]+]]
+// CHECK-ROOT1-NEXT: 1 counters and 0 callsites
+// CHECK-ROOT1-NEXT: Counter values: [[ROOT1_COUNTER3]]
+// CHECK-ROOT1-NEXT: At Index 1:
+// CHECK-ROOT1-NEXT: Guid: 5578595117440393467
+// CHECK-ROOT1-NEXT: Entries: [[ROOT1_COUNTER2]]
+// CHECK-ROOT1-NEXT: 1 counters and 0 callsites
+// CHECK-ROOT1-NEXT: Counter values: [[ROOT1_COUNTER2]]
+// CHECK-ROOT1-NEXT: At Index 2:
+// CHECK-ROOT1-NEXT: Guid: 3950394326069683896
+// CHECK-ROOT1-NEXT: Entries: [[ROOT1_COUNTER1]]
+// CHECK-ROOT1-NEXT: 1 counters and 0 callsites
+// CHECK-ROOT1-NEXT: Counter values: [[ROOT1_COUNTER1]]
+// CHECK-ROOT2: Entering Root 3950394326069683896 with total entry count {{[0-9]+}}
+// CHECK-ROOT2-NEXT: Guid: 3950394326069683896
+// CHECK-ROOT2-NEXT: Entries: [[ROOT2_COUNTER:[0-9]+]]
+// CHECK-ROOT2-NEXT: 1 counters and 0 callsites
+// CHECK-ROOT2-NEXT: Counter values: [[ROOT2_COUNTER]]
+// CHECK: Exited Context Section
// CHECK-NEXT: Entered Flat Section
-// CHECK-NEXT: Flat: 2597020043743142491 1
-// CHECK-NEXT: Flat: 4321328481998485159 1
-// CHECK-NEXT: Flat: 8657661246551306189 9114175,18099613
-// CHECK-NEXT: Flat: 434762725428799310 10574815
-// CHECK-NEXT: Flat: 5578595117440393467 5265754
-// CHECK-NEXT: Flat: 12566320182004153844 1
+// CHECK-DAG: Flat: 434762725428799310 {{[0-9]+}}
+// CHECK-DAG: Flat: 5578595117440393467 {{[0-9]+}}
+// CHECK-DAG: Flat: 8657661246551306189 {{[0-9]+}},{{[0-9]+}}
+// CHECK-DAG: Flat: {{[0-9]+}} 1
+// CHECK-DAG: Flat: {{[0-9]+}} 1
+// CHECK-DAG: Flat: {{[0-9]+}} 1
// CHECK-NEXT: Exited Flat Section
bool profileWriter() {
diff --git a/lld/test/ELF/linkerscript/data-segment-relro-ppc64.test b/lld/test/ELF/linkerscript/data-segment-relro-ppc64.test
index f85241b6792e4..a97789ca6449f 100644
--- a/lld/test/ELF/linkerscript/data-segment-relro-ppc64.test
+++ b/lld/test/ELF/linkerscript/data-segment-relro-ppc64.test
@@ -5,31 +5,23 @@
# RUN: ld.lld -shared -soname=b %t/b.o -o %t/b.so
# RUN: ld.lld -z max-page-size=65536 -z norelro %t/a.o %t/b.so -T %t/1.t -o %t/a1
-# RN: llvm-readelf -S -l %t/a1 | FileCheck %s --check-prefixes=CHECK1
+# RUN: llvm-readelf -S -l %t/a1 | FileCheck %s --check-prefixes=CHECK1
# RUN: ld.lld -z max-page-size=65536 -z relro %t/a.o %t/b.so -T %t/1.t -o %t/a2
-# RUN: llvm-readelf -S -l %t/a2 | FileCheck %s --check-prefixes=CHECK2
+# RUN: llvm-readelf -S -l %t/a2 | FileCheck %s --check-prefixes=CHECK1,CHECK2
## -z norelro suppresses the .relro_padding section.
# CHECK1: Name Type Address Off Size ES Flg
-# CHECK1: .foo PROGBITS
-# CHECK1-NEXT: .orphan.rw PROGBITS
-# CHECK1-NEXT: .branch_lt PROGBITS
-# CHECK1-NEXT: .got PROGBITS
-# CHECK1-NEXT: .data PROGBITS
-# CHECK1-NEXT: .bss NOBITS
-
-# CHECK2: Name Type Address Off Size ES Flg
-# CHECK2-NEXT: NULL {{.*}}
-# CHECK2: .orphan.ro PROGBITS {{.*}} A
-# CHECK2: .dynamic DYNAMIC {{.*}} WA
-# CHECK2-NEXT: .branch_lt PROGBITS {{.*}} WA
-# CHECK2-NEXT: .got PROGBITS {{.*}} WA
+# CHECK1-NEXT: NULL {{.*}}
+# CHECK1: .orphan.ro PROGBITS {{.*}} A
+# CHECK1: .dynamic DYNAMIC {{.*}} WA
+# CHECK1-NEXT: .branch_lt PROGBITS {{.*}} WA
+# CHECK1-NEXT: .got PROGBITS {{.*}} WA
# CHECK2-NEXT: .relro_padding NOBITS 00000000000100f0 0100f0 000f10 00 WA
-# CHECK2-NEXT: .data PROGBITS {{.*}} WA
-# CHECK2-NEXT: .foo PROGBITS {{.*}} WA
-# CHECK2-NEXT: .orphan.rw PROGBITS {{.*}} WA
-# CHECK2-NEXT: .bss NOBITS {{.*}} WA
+# CHECK1-NEXT: .data PROGBITS {{.*}} WA
+# CHECK1-NEXT: .foo PROGBITS {{.*}} WA
+# CHECK1-NEXT: .orphan.rw PROGBITS {{.*}} WA
+# CHECK1-NEXT: .bss NOBITS {{.*}} WA
#--- a.s
.global _start
diff --git a/llvm/test/CodeGen/Generic/cfi-sections.ll b/llvm/test/CodeGen/Generic/cfi-sections.ll
index eb21fb5b01fa8..fb9a2ea3b405b 100644
--- a/llvm/test/CodeGen/Generic/cfi-sections.ll
+++ b/llvm/test/CodeGen/Generic/cfi-sections.ll
@@ -1,6 +1,6 @@
; When using Itanium ABI, do not emit .debug_frame.
-; RUNT: llc -mtriple=i386--linux -o - < %s | FileCheck %s -check-prefix=WITHOUT
-; RUNT: llc -mtriple=armv7-netbsd-eabi -o - < %s | FileCheck %s -check-prefix=WITHOUT
+; RUN: llc -mtriple=i386--linux -o - < %s | FileCheck %s -check-prefix=WITHOUT
+; RUN: llc -mtriple=armv7-netbsd-eabi -o - < %s | FileCheck %s -check-prefix=WITHOUT
; When using EHABI, do emit .debug_frame.
; RUN: llc -mtriple=arm-linux -mcpu=cortex-a7 -mattr=v7 -o - < %s | FileCheck %s -check-prefix=WITH
diff --git a/llvm/test/MC/Disassembler/ARM/fullfp16-neon-arm.txt b/llvm/test/MC/Disassembler/ARM/fullfp16-neon-arm.txt
index 232bd641f059f..906c912e25aa3 100644
--- a/llvm/test/MC/Disassembler/ARM/fullfp16-neon-arm.txt
+++ b/llvm/test/MC/Disassembler/ARM/fullfp16-neon-arm.txt
@@ -1,5 +1,5 @@
# RUN: not llvm-mc -disassemble -triple armv8a-none-eabi -mattr=+fullfp16,+neon -show-encoding < %s 2>%t | FileCheck %s
-# RUN FileCheck %s < %t --check-prefix=STDERR
+# RUN: FileCheck %s < %t --check-prefix=STDERR
# CHECK: vadd.f16 d0, d1, d2
# CHECK: vadd.f16 q0, q1, q2
@@ -290,7 +290,7 @@
[0x70,0x0f,0xc7,0xf2]
# CHECK: vmov.i32 d16, #0x70ff
# CHECK: vmov.i32 d16, #0x70ffff
-# CHECK: vmov.i8 d16, #0x70
+# CHECK: vmov.i8 d16, #0x70
# CHECK: vmov.f32 d16, #1.000000e+00
# CHECK: vmull.s8 q8, d7, d16
# STDERR: warning: invalid instruction encoding
@@ -300,7 +300,7 @@
# STDERR-NEXT: [0x20,0x0f,0xc7,0xf2]
# CHECK: vmov.i32 q8, #0x70ff
# CHECK: vmov.i32 q8, #0x70ffff
-# CHECK: vmov.i8 q8, #0x70
+# CHECK: vmov.i8 q8, #0x70
# CHECK: vmov.f32 q8, #1.000000e+00
# CHECK: vmvn.i32 q8, #0x70ff
# CHECK: vmvn.i32 q8, #0x70ffff
diff --git a/llvm/test/MC/Disassembler/ARM/fullfp16-neon-thumb.txt b/llvm/test/MC/Disassembler/ARM/fullfp16-neon-thumb.txt
index a776232b71479..4d11f722e7a46 100644
--- a/llvm/test/MC/Disassembler/ARM/fullfp16-neon-thumb.txt
+++ b/llvm/test/MC/Disassembler/ARM/fullfp16-neon-thumb.txt
@@ -1,5 +1,5 @@
# RUN: not llvm-mc -disassemble -triple thumbv8a-none-eabi -mattr=+fullfp16,+neon,+thumb-mode -show-encoding < %s 2>%t | FileCheck %s
-# RUN FileCheck %s < %t --check-prefix=STDERR
+# RUN: FileCheck %s < %t --check-prefix=STDERR
# CHECK: vadd.f16 d0, d1, d2
# CHECK: vadd.f16 q0, q1, q2
@@ -290,20 +290,20 @@
[0xc7,0xef,0x70,0x0f]
# CHECK: vmov.i32 d16, #0x70ff
# CHECK: vmov.i32 d16, #0x70ffff
-# CHECK: vmov.i8 d16, #0x70
+# CHECK: vmov.i8 d16, #0x70
# CHECK: vmov.f32 d16, #1.000000e+00
# CHECK: vmull.s8 q8, d7, d16
# STDERR: warning: invalid instruction encoding
-# STDERR-NEXT: [0x20,0x0d,0xc7,0xf2]
+# STDERR-NEXT: [0xc7,0xef,0x20,0x0d]
# CHECK: vmull.p8 q8, d7, d16
# STDERR: warning: invalid instruction encoding
-# STDERR-NEXT: [0x20,0x0f,0xc7,0xf2]
+# STDERR-NEXT: [0xc7,0xef,0x20,0x0f]
# CHECK: vmov.i32 q8, #0x70ff
# CHECK: vmov.i32 q8, #0x70ffff
-# CHECK: vmov.i8 q8, #0x70
+# CHECK: vmov.i8 q8, #0x70
# CHECK: vmov.f32 q8, #1.000000e+00
# CHECK: vmvn.i32 q8, #0x70ff
# CHECK: vmvn.i32 q8, #0x70ffff
# CHECK: vmov.i64 q8, #0xffffff0000000
# STDERR: warning: invalid instruction encoding
-# STDERR-NEXT: [0x70,0x0f,0xc7,0xf2]
+# STDERR-NEXT: [0xc7,0xef,0x70,0x0f]
diff --git a/llvm/test/tools/llvm-objcopy/ELF/change-section-address.test b/llvm/test/tools/llvm-objcopy/ELF/change-section-address.test
index b17b1492690af..a0eb725b92490 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/change-section-address.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/change-section-address.test
@@ -146,7 +146,7 @@
## Check error when the value is invalid in the argument value.
# RUN: not llvm-objcopy --change-section-address .anotherone+0c50 %ti1 2>&1 | FileCheck %s --check-prefix=ERR-NOT-INTEGER
## Check error when the value does not fit in uint64_t.
-# RUN not llvm-objcopy --change-section-address .text1=0x10000000000000000 %ti1 %to 2>&1 | FileCheck %s --chack-prefix=ERR-NOT-INTEGER
+# RUN: not llvm-objcopy --change-section-address .text1=0x10000000000000000 %ti1 %to 2>&1 | FileCheck %s --check-prefix=ERR-NOT-UINT64
## Check error when the section pattern is missing.
# RUN: not llvm-objcopy --change-section-address =0x10 %ti1 2>&1 | FileCheck %s --check-prefix=ERR-MISSING-SECTION
## Check error when the negative adjustment value is missing.
@@ -162,6 +162,7 @@
# ERR-UNDERFLOW: address 0x200 cannot be decreased by 0x201. The result would underflow
# ERR-IVALID-VAL: error: bad format for --change-section-address: argument value 0 is invalid. See --help
# ERR-NOT-INTEGER: error: bad format for --change-section-address: value after + is 0c50 when it should be a 64-bit integer
+# ERR-NOT-UINT64: error: bad format for --change-section-address: value after = is 0x10000000000000000 when it should be a 64-bit integer
# ERR-MISSING-SECTION: error: bad format for --change-section-address: missing section pattern to apply address change to
# ERR-MISSING-VALUE-MINUS: error: bad format for --change-section-address: missing value of offset after '-'
# ERR-MISSING-VALUE-PLUS: error: bad format for --change-section-address: missing value of offset after '+'
diff --git a/llvm/test/tools/obj2yaml/ELF/shstrtab.yaml b/llvm/test/tools/obj2yaml/ELF/shstrtab.yaml
index daea0dc8f7d58..9e1d587ec5c6a 100644
--- a/llvm/test/tools/obj2yaml/ELF/shstrtab.yaml
+++ b/llvm/test/tools/obj2yaml/ELF/shstrtab.yaml
@@ -296,9 +296,9 @@ Sections:
## Show that an error is reported if the section header string table name cannot
## be read.
# RUN: yaml2obj --docnum=11 %s -o %t11.o
-# RUNasda: not obj2yaml %t11.o 2>&1 | FileCheck %s --check-prefix=ERR -DFILE=%t11.o
+# RUN: not obj2yaml %t11.o 2>&1 | FileCheck %s --check-prefix=ERR -DFILE=%t11.o
-# ERR: Error reading file: [[FILE]]: unable to read section header string table name: a section [index 1] has an invalid sh_name (0x10000) offset which goes past the end of the section name string table
+# ERR: Error reading file: [[FILE]]: a section [index 1] has an invalid sh_name (0x10000) offset which goes past the end of the section name string table
--- !ELF
FileHeader:
``````````
</details>
https://github.com/llvm/llvm-project/pull/179668
More information about the cfe-commits
mailing list