[llvm] 3cbbdbb - [llvm-exegesis] Fix test failure caused by assymetric values
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 22:02:18 PDT 2023
Author: Aiden Grossman
Date: 2023-06-27T05:01:32Z
New Revision: 3cbbdbbc30f4533522d865247f2fb7052ca414b6
URL: https://github.com/llvm/llvm-project/commit/3cbbdbbc30f4533522d865247f2fb7052ca414b6
DIFF: https://github.com/llvm/llvm-project/commit/3cbbdbbc30f4533522d865247f2fb7052ca414b6.diff
LOG: [llvm-exegesis] Fix test failure caused by assymetric values
I fixed compilation on 32-bit ARM earlier in the -Werror case using
preprocessor directives but forgot to update the unit tests that also
depend upon that value. This patch updates the unit tests as well as a
quick fix for the builders that were broken by the earlier patch.
Added:
Modified:
llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp b/llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
index 092feb164ed2d..92d656423c285 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
+++ b/llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
@@ -598,6 +598,12 @@ TEST_F(X86Core2TargetTest, GenerateLowerMunmapTest) {
OpcodeIs(X86::SYSCALL)));
}
+#ifdef __arm__
+static constexpr const intptr_t VAddressSpaceCeiling = 0xC0000000;
+#else
+static constexpr const intptr_t VAddressSpaceCeiling = 0x0000800000000000;
+#endif
+
TEST_F(X86Core2TargetTest, GenerateUpperMunmapTest) {
std::vector<MCInst> GeneratedCode;
State.getExegesisTarget().generateUpperMunmap(GeneratedCode);
@@ -607,7 +613,7 @@ TEST_F(X86Core2TargetTest, GenerateUpperMunmapTest) {
OpcodeIs(X86::ADD64rr), OpcodeIs(X86::SHR64ri),
OpcodeIs(X86::SHL64ri), OpcodeIs(X86::ADD64ri32),
IsMovImmediate(X86::MOV64ri, X86::RSI,
- 0x0000800000000000 - getpagesize()),
+ VAddressSpaceCeiling - getpagesize()),
OpcodeIs(X86::SUB64rr),
IsMovImmediate(X86::MOV64ri, X86::RAX, SYS_munmap),
OpcodeIs(X86::SYSCALL)}));
More information about the llvm-commits
mailing list