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/ADT/SmallString.h" 11 #include "llvm/Support/raw_ostream.h" 12 #include "gtest/gtest.h" 13 #include <string> 14 15 using namespace llvm; 16 17 namespace { 18 19 // Verify that printing a MemoryEffects does not end with a ,. 20 TEST(ModRefTest, PrintMemoryEffects) { 21 std::string S; 22 raw_string_ostream OS(S); 23 OS << MemoryEffects::none(); 24 EXPECT_EQ(S, "ArgMem: NoModRef, InaccessibleMem: NoModRef, Other: NoModRef"); 25 } 26 27 } // namespace 28