brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 94bc0b2 Raw
36 lines · cpp
1//===-- SPSMemoryFlagsTest.cpp --------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// Test SPS serialization for MemoryFlags APIs.10//11//===----------------------------------------------------------------------===//12 13#include "orc-rt/SPSMemoryFlags.h"14 15#include "SimplePackedSerializationTestUtils.h"16#include "gtest/gtest.h"17 18using namespace orc_rt;19 20TEST(SPSMemoryFlagsTest, TestAllocGroupSerialization) {21  for (bool Read : {false, true}) {22    for (bool Write : {false, true}) {23      for (bool Exec : {false, true}) {24        for (bool FinalizeLifetime : {false, true}) {25          AllocGroup AG((Read ? MemProt::Read : MemProt::None) |26                            (Write ? MemProt::Write : MemProt::None) |27                            (Exec ? MemProt::Exec : MemProt::None),28                        FinalizeLifetime ? MemLifetime::Finalize29                                         : MemLifetime::Standard);30          blobSerializationRoundTrip<SPSAllocGroup, AllocGroup>(AG);31        }32      }33    }34  }35}36