[llvm] It is really the byte order of the target that matters (PR #107915)

Sean Perry via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 10:19:55 PDT 2024


https://github.com/perry-ca updated https://github.com/llvm/llvm-project/pull/107915

>From 53e069a8579028993b266621cfaf1605b81bbdd3 Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Mon, 9 Sep 2024 16:11:07 -0500
Subject: [PATCH 1/4] It is really the byte order of the target that matters

---
 llvm/test/CodeGen/Generic/allow-check.ll                | 2 +-
 llvm/test/Object/AArch64/chained-fixups-header.test     | 2 +-
 llvm/test/Object/AArch64/filetype-fileset.yaml          | 2 +-
 llvm/test/lit.cfg.py                                    | 5 ++++-
 llvm/test/tools/dsymutil/X86/reflection-dump.test       | 2 +-
 llvm/test/tools/sancov/covered_functions.test           | 2 +-
 llvm/test/tools/sancov/ignorelist.test                  | 2 +-
 llvm/test/tools/sancov/not_covered_functions.test       | 2 +-
 llvm/test/tools/sancov/print.test                       | 2 +-
 llvm/test/tools/sancov/stats.test                       | 2 +-
 llvm/test/tools/sancov/symbolize.test                   | 2 +-
 llvm/test/tools/sancov/symbolize_noskip_dead_files.test | 2 +-
 12 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/llvm/test/CodeGen/Generic/allow-check.ll b/llvm/test/CodeGen/Generic/allow-check.ll
index a08488959862ab..148ee811ea806c 100644
--- a/llvm/test/CodeGen/Generic/allow-check.ll
+++ b/llvm/test/CodeGen/Generic/allow-check.ll
@@ -1,5 +1,5 @@
 ; Avoid `!DL->isLittleEndian() && !CLI->enableBigEndian()` missmatch on PPC64BE.
-; REQUIRES: host-byteorder-little-endian
+; REQUIRES: target-byteorder-little-endian
 
 ; -global-isel=1 is unsupported.
 ; XFAIL: target=loongarch{{.*}}
diff --git a/llvm/test/Object/AArch64/chained-fixups-header.test b/llvm/test/Object/AArch64/chained-fixups-header.test
index 5bdf07a56d3609..409c1222ffa39f 100644
--- a/llvm/test/Object/AArch64/chained-fixups-header.test
+++ b/llvm/test/Object/AArch64/chained-fixups-header.test
@@ -1,4 +1,4 @@
-REQUIRES: host-byteorder-little-endian
+REQUIRES: target-byteorder-little-endian
 RUN: cat %p/../Inputs/MachO/chained-fixups.yaml \
 RUN:   | sed 's/__LINKEDIT:      00000000/__LINKEDIT:      AB000000/' \
 RUN:   | yaml2obj | not llvm-objdump --macho --dyld-info - 2>&1 \
diff --git a/llvm/test/Object/AArch64/filetype-fileset.yaml b/llvm/test/Object/AArch64/filetype-fileset.yaml
index 0f9631ff076b2f..73bb2e01db43fb 100644
--- a/llvm/test/Object/AArch64/filetype-fileset.yaml
+++ b/llvm/test/Object/AArch64/filetype-fileset.yaml
@@ -1,4 +1,4 @@
-# REQUIRES: host-byteorder-little-endian
+# REQUIRES: target-byteorder-little-endian
 # RUN: yaml2obj %s \
 # RUN:   | llvm-objdump --macho --private-header - 2>&1 \
 # RUN:   | FileCheck %s
diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index 1e0dd0a7df34f1..cff6dc962e98be 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -363,7 +363,10 @@ def version_int(ver):
 ):
     config.available_features.add("llvm-64-bits")
 
-config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
+if re.match(r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*", config.target_triple):
+    config.available_features.add("target-byteorder-big-endian")
+else:
+    config.available_features.add("target-byteorder-little-endian")
 
 if sys.platform in ["win32"]:
     # ExecutionEngine, no weak symbols in COFF.
diff --git a/llvm/test/tools/dsymutil/X86/reflection-dump.test b/llvm/test/tools/dsymutil/X86/reflection-dump.test
index 9cf9874f4acddd..dc58d399596145 100644
--- a/llvm/test/tools/dsymutil/X86/reflection-dump.test
+++ b/llvm/test/tools/dsymutil/X86/reflection-dump.test
@@ -12,7 +12,7 @@ RUN: llvm-objdump -s %t.dir/main.dSYM/Contents/Resources/DWARF/main | FileCheck
 RUN: dsymutil --linker parallel -oso-prepend-path=%t.dir %t.dir/main -o %t.dir/main.dSYM
 RUN: llvm-objdump -s %t.dir/main.dSYM/Contents/Resources/DWARF/main | FileCheck %s
 
-REQUIRES: host-byteorder-little-endian
+REQUIRES: target-byteorder-little-endian
 
 
 CHECK: Contents of section __DWARF,__swift5_assocty:
diff --git a/llvm/test/tools/sancov/covered_functions.test b/llvm/test/tools/sancov/covered_functions.test
index bcdfaf8879d41a..bca37bb7bdf878 100644
--- a/llvm/test/tools/sancov/covered_functions.test
+++ b/llvm/test/tools/sancov/covered_functions.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 RUN: sancov -covered-functions -strip_path_prefix=Inputs/ %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck --check-prefix=STRIP_PATH %s
 RUN: sancov -demangle=0 -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck --check-prefix=NO_DEMANGLE %s
diff --git a/llvm/test/tools/sancov/ignorelist.test b/llvm/test/tools/sancov/ignorelist.test
index 01d03aed05b237..0456b9b0dc1ded 100644
--- a/llvm/test/tools/sancov/ignorelist.test
+++ b/llvm/test/tools/sancov/ignorelist.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s --check-prefix=ALL
 RUN: sancov -covered-functions -ignorelist %p/Inputs/fun_ignorelist.txt %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 RUN: sancov -covered-functions -ignorelist %p/Inputs/src_ignorelist.txt %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=CHECK1 %s
diff --git a/llvm/test/tools/sancov/not_covered_functions.test b/llvm/test/tools/sancov/not_covered_functions.test
index d1b91f6e56820a..54541bbcb124bb 100644
--- a/llvm/test/tools/sancov/not_covered_functions.test
+++ b/llvm/test/tools/sancov/not_covered_functions.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -skip-dead-files=0 -not-covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 RUN: sancov -not-covered-functions %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.1.sancov | FileCheck --check-prefix=CHECK1 --allow-empty %s
 
diff --git a/llvm/test/tools/sancov/print.test b/llvm/test/tools/sancov/print.test
index 62ab3d991b8e3c..26bbf47f4d987e 100644
--- a/llvm/test/tools/sancov/print.test
+++ b/llvm/test/tools/sancov/print.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -print %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 
 CHECK: 0x4e132b
diff --git a/llvm/test/tools/sancov/stats.test b/llvm/test/tools/sancov/stats.test
index 46ff6e5e5db10e..1777a6d04fed74 100644
--- a/llvm/test/tools/sancov/stats.test
+++ b/llvm/test/tools/sancov/stats.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -print-coverage-stats %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 
 CHECK: all-edges: 8
diff --git a/llvm/test/tools/sancov/symbolize.test b/llvm/test/tools/sancov/symbolize.test
index acf58ae1171238..4ffafb7448815f 100644
--- a/llvm/test/tools/sancov/symbolize.test
+++ b/llvm/test/tools/sancov/symbolize.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -symbolize -strip_path_prefix="llvm/" %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s --check-prefixes=CHECK,STRIP
 RUN: sancov -symbolize %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s --check-prefixes=CHECK,NOSTRIP
 
diff --git a/llvm/test/tools/sancov/symbolize_noskip_dead_files.test b/llvm/test/tools/sancov/symbolize_noskip_dead_files.test
index 0038ea197735aa..e366bdcb2ef75f 100644
--- a/llvm/test/tools/sancov/symbolize_noskip_dead_files.test
+++ b/llvm/test/tools/sancov/symbolize_noskip_dead_files.test
@@ -1,4 +1,4 @@
-REQUIRES: x86-registered-target && host-byteorder-little-endian
+REQUIRES: x86-registered-target && target-byteorder-little-endian
 RUN: sancov -symbolize -skip-dead-files=0 -strip_path_prefix="llvm/" %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
 
 CHECK: {

>From 04b2929b0e4c77b649e95e0202f31699171d3404 Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Mon, 9 Sep 2024 16:22:32 -0500
Subject: [PATCH 2/4] fix fomrating

---
 llvm/test/lit.cfg.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index cff6dc962e98be..e9b4d3c5aee3f9 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -363,7 +363,10 @@ def version_int(ver):
 ):
     config.available_features.add("llvm-64-bits")
 
-if re.match(r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*", config.target_triple):
+if re.match(
+    r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*", 
+    config.target_triple
+):
     config.available_features.add("target-byteorder-big-endian")
 else:
     config.available_features.add("target-byteorder-little-endian")

>From 07f5c632e968b9e9d0aeaea6ec92cec7cd9110ca Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Tue, 10 Sep 2024 10:41:23 -0500
Subject: [PATCH 3/4] more formatting

---
 llvm/test/lit.cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index e9b4d3c5aee3f9..6407f85f88d132 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -365,7 +365,7 @@ def version_int(ver):
 
 if re.match(
     r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*", 
-    config.target_triple
+    config.target_triple,
 ):
     config.available_features.add("target-byteorder-big-endian")
 else:

>From db171744906e20bc4aefab578b0810b814d66fc5 Mon Sep 17 00:00:00 2001
From: Sean Perry <perry at ca.ibm.com>
Date: Tue, 10 Sep 2024 12:19:42 -0500
Subject: [PATCH 4/4] trailing space

---
 llvm/test/lit.cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index 6407f85f88d132..bb7216c3eacc8a 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -364,7 +364,7 @@ def version_int(ver):
     config.available_features.add("llvm-64-bits")
 
 if re.match(
-    r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*", 
+    r"(aarch64_be|arc|armeb|bpfeb|lanai|m68k|mips|mips64|powerpc|powerpc64|sparc|sparcv9|s390x|s390|tce|thumbeb)-.*",
     config.target_triple,
 ):
     config.available_features.add("target-byteorder-big-endian")



More information about the llvm-commits mailing list