#include "src/base/cpu.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "src/heap/base/memory-tagging.h"
namespace v8 {
namespace base {
#if defined(V8_HOST_ARCH_ARM64)
TEST(CPUTest, SuppressTagCheckingScope) {
CPU cpu;
if (!cpu.has_mte()) GTEST_SKIP();
uint64_t val;
asm volatile(".arch_extension memtag \n mrs %0, tco" : "=r" (val));
EXPECT_EQ(val, 0u);
{
heap::base::SuspendTagCheckingScope s;
asm volatile(".arch_extension memtag \n mrs %0, tco" : "=r" (val));
EXPECT_EQ(val, 1u << 25);
}
asm volatile(".arch_extension memtag \n mrs %0, tco" : "=r" (val));
EXPECT_EQ(val, 0u);
}
#endif
TEST(CPUTest, FeatureImplications) { … }
TEST(CPUTest, RequiredFeatures) { … }
}
}