diff --git a/test/syscalls/linux/mmap.cc b/test/syscalls/linux/mmap.cc index e52c9cbcb..83546830d 100644 --- a/test/syscalls/linux/mmap.cc +++ b/test/syscalls/linux/mmap.cc @@ -592,6 +592,12 @@ TEST_F(MMapTest, ProtExec) { memcpy(reinterpret_cast(addr), machine_code, sizeof(machine_code)); +#if defined(__aarch64__) + // We use this as a memory barrier for Arm64. + ASSERT_THAT(Protect(addr, kPageSize, PROT_READ | PROT_EXEC), + SyscallSucceeds()); +#endif + func = reinterpret_cast(addr); EXPECT_EQ(42, func());