Skip to content

Commit

Permalink
[llvm-exegesis] Fix test failure caused by assymetric values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boomanaiden154 committed Jun 27, 2023
1 parent c3e3372 commit 3cbbdbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion llvm/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)}));
Expand Down

0 comments on commit 3cbbdbb

Please sign in to comment.