[llvm] Introduce LDBG_OS() macro as a variant of LDBG() (PR #157194)

Andrzej WarzyƄski via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 02:43:34 PDT 2025


================
@@ -128,6 +128,131 @@ TEST(DebugLogTest, DestructorPrefix) {
   // After destructors, nothing should have been printed.
   EXPECT_EQ(os.str(), "");
 }
+
+TEST(DebugLogTest, LDBG_MACROS) {
+  llvm::DebugFlag = true;
+  static const char *DT[] = {"A:3", "B:2"};
+  setCurrentDebugTypes(DT, sizeof(DT) / sizeof(DT[0]));
+  std::string Str;
+  raw_string_ostream DebugOs(Str);
+  std::string StrRef;
----------------
banach-space wrote:

Could this be renamed to avoid confusing it with `StringRef`?

Is this meant to be the reference output? Why not "ExpectedDebugLog"? Or something else with "expected" inside?

https://github.com/llvm/llvm-project/pull/157194


More information about the llvm-commits mailing list