Files
Lang Hames d855251d60 [orc-rt] Move the unit tests into test/unit (#208431)
Move unit tests from orc-rt/unittests into orc-rt/test/unit, completing
the consolidation of the runtime's tests under orc-rt/test (alongside
test/regression and test/tools).
2026-07-09 21:32:26 +10:00

36 lines
1.3 KiB
C++

//===-- SPSMemoryFlagsTest.cpp --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Test SPS serialization for MemoryFlags APIs.
//
//===----------------------------------------------------------------------===//
#include "orc-rt/SPSMemoryFlags.h"
#include "SimplePackedSerializationTestUtils.h"
#include "gtest/gtest.h"
using namespace orc_rt;
TEST(SPSMemoryFlagsTest, TestAllocGroupSerialization) {
for (bool Read : {false, true}) {
for (bool Write : {false, true}) {
for (bool Exec : {false, true}) {
for (bool FinalizeLifetime : {false, true}) {
AllocGroup AG((Read ? MemProt::Read : MemProt::None) |
(Write ? MemProt::Write : MemProt::None) |
(Exec ? MemProt::Exec : MemProt::None),
FinalizeLifetime ? MemLifetime::Finalize
: MemLifetime::Standard);
blobSerializationRoundTrip<SPSAllocGroup, AllocGroup>(AG);
}
}
}
}
}