aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/MachineInstrTest.cpp
diff options
context:
space:
mode:
authorJOE1994 <joseph942010@gmail.com>2024-09-13 09:35:57 -0400
committerJOE1994 <joseph942010@gmail.com>2024-09-13 09:42:32 -0400
commit387bee91f095c197270b4d0a9e19cc86b2edea73 (patch)
treee985eeb26f9f3e6716cee57813e0200907018d9d /llvm/unittests/CodeGen/MachineInstrTest.cpp
parent6be9be5e0b4ba9d561dc005bea4eace40b53510d (diff)
downloadllvm-387bee91f095c197270b4d0a9e19cc86b2edea73.zip
llvm-387bee91f095c197270b4d0a9e19cc86b2edea73.tar.gz
llvm-387bee91f095c197270b4d0a9e19cc86b2edea73.tar.bz2
[llvm][unittests] Strip unneeded uses of raw_string_ostream::str() (NFC)
Avoid excess layer of indirection.
Diffstat (limited to 'llvm/unittests/CodeGen/MachineInstrTest.cpp')
-rw-r--r--llvm/unittests/CodeGen/MachineInstrTest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp
index af25acb..d1546cf 100644
--- a/llvm/unittests/CodeGen/MachineInstrTest.cpp
+++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp
@@ -223,9 +223,8 @@ TEST(MachineInstrPrintingTest, DebugLocPrinting) {
raw_string_ostream OS(str);
MI->print(OS, /*IsStandalone*/true, /*SkipOpers*/false, /*SkipDebugLoc*/false,
/*AddNewLine*/false);
- ASSERT_TRUE(
- StringRef(OS.str()).starts_with("$noreg = UNKNOWN debug-location "));
- ASSERT_TRUE(StringRef(OS.str()).ends_with("filename:1:5"));
+ ASSERT_TRUE(StringRef(str).starts_with("$noreg = UNKNOWN debug-location "));
+ ASSERT_TRUE(StringRef(str).ends_with("filename:1:5"));
}
TEST(MachineInstrSpan, DistanceBegin) {