brintos

brintos / llvm-project-archived public Read only

0
0
Text · 906 B · 128501b Raw
28 lines · cpp
1//===- llvm/unittest/Support/ModRefTest.cpp - ModRef tests ----------------===//
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/Support/ModRef.h"
10#include "llvm/Support/raw_ostream.h"
11#include "gtest/gtest.h"
12#include <string>
13
14using namespace llvm;
15
16namespace {
17
18// Verify that printing a MemoryEffects does not end with a ,.
19TEST(ModRefTest, PrintMemoryEffects) {
20  std::string S;
21  raw_string_ostream OS(S);
22  OS << MemoryEffects::none();
23  EXPECT_EQ(S, "ArgMem: NoModRef, InaccessibleMem: NoModRef, ErrnoMem: "
24               "NoModRef, Other: NoModRef, TargetMem0: NoModRef, TargetMem1: NoModRef");
25}
26
27} // namespace
28