From 3cbbdbbc30f4533522d865247f2fb7052ca414b6 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Tue, 27 Jun 2023 04:59:09 +0000 Subject: [PATCH] [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. --- llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 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)}));