1*115b8763SRahul Joshi //===- llvm/unittest/Support/ModRefTest.cpp - ModRef tests ----------------===// 2*115b8763SRahul Joshi // 3*115b8763SRahul Joshi // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*115b8763SRahul Joshi // See https://llvm.org/LICENSE.txt for license information. 5*115b8763SRahul Joshi // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*115b8763SRahul Joshi // 7*115b8763SRahul Joshi //===----------------------------------------------------------------------===// 8*115b8763SRahul Joshi 9*115b8763SRahul Joshi #include "llvm/Support/ModRef.h" 10*115b8763SRahul Joshi #include "llvm/ADT/SmallString.h" 11*115b8763SRahul Joshi #include "llvm/Support/raw_ostream.h" 12*115b8763SRahul Joshi #include "gtest/gtest.h" 13*115b8763SRahul Joshi #include <string> 14*115b8763SRahul Joshi 15*115b8763SRahul Joshi using namespace llvm; 16*115b8763SRahul Joshi 17*115b8763SRahul Joshi namespace { 18*115b8763SRahul Joshi 19*115b8763SRahul Joshi // Verify that printing a MemoryEffects does not end with a ,. 20*115b8763SRahul Joshi TEST(ModRefTest, PrintMemoryEffects) { 21*115b8763SRahul Joshi std::string S; 22*115b8763SRahul Joshi raw_string_ostream OS(S); 23*115b8763SRahul Joshi OS << MemoryEffects::none(); 24*115b8763SRahul Joshi EXPECT_EQ(S, "ArgMem: NoModRef, InaccessibleMem: NoModRef, Other: NoModRef"); 25*115b8763SRahul Joshi } 26*115b8763SRahul Joshi 27*115b8763SRahul Joshi } // namespace 28