File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
llvm/unittests/Transforms/Utils Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -719,23 +719,28 @@ attributes #0 = { presplitcoroutine }
719719
720720TEST (BasicBlockUtils, BasicBlockPrintable) {
721721 std::string S;
722+ std::string SCheck;
722723 llvm::raw_string_ostream OS{S};
724+ llvm::raw_string_ostream OSCheck{SCheck};
723725
724726 LLVMContext C;
725727 std::unique_ptr<Module> M = parseIR (C, R"IR(
726728define void @foo() {
727- .entry:
728729 br label %bb0
729730bb0:
731+ br label %.exit
732+ .exit:
730733 ret void
731734}
732735)IR" );
733736
734737 Function *F = M->getFunction (" foo" );
735- for (BasicBlock &BB : *F) {
738+ for (const BasicBlock &BB : *F) {
736739 OS << printBasicBlock (&BB);
737- EXPECT_EQ (OS.str (), " label %" + BB.getName ().str ());
740+ BB.printAsOperand (OSCheck);
741+ EXPECT_EQ (OS.str (), OSCheck.str ());
738742 S.clear ();
743+ SCheck.clear ();
739744 }
740745 OS << printBasicBlock (nullptr );
741746 EXPECT_EQ (OS.str (), " " );
You can’t perform that action at this time.
0 commit comments