[llvm] 226fb1c - [llvm][support] Fix DebugLogTest. (#150585)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 01:40:45 PDT 2025


Author: Jacques Pienaar
Date: 2025-07-25T10:40:41+02:00
New Revision: 226fb1c246afec41927dab023e78fc87f8625e52

URL: https://github.com/llvm/llvm-project/commit/226fb1c246afec41927dab023e78fc87f8625e52
DIFF: https://github.com/llvm/llvm-project/commit/226fb1c246afec41927dab023e78fc87f8625e52.diff

LOG: [llvm][support] Fix DebugLogTest. (#150585)

Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.

Added: 
    

Modified: 
    llvm/unittests/Support/DebugLogTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/DebugLogTest.cpp b/llvm/unittests/Support/DebugLogTest.cpp
index 513699913f922..22dffd857613d 100644
--- a/llvm/unittests/Support/DebugLogTest.cpp
+++ b/llvm/unittests/Support/DebugLogTest.cpp
@@ -66,7 +66,7 @@ TEST(DebugLogTest, Basic) {
   // LDBG should be compiled out in NDEBUG, so just check it compiles and has
   // no effect.
   llvm::DebugFlag = true;
-  static const char *DT[] = {};
+  static const char *DT[] = {"A"};
   setCurrentDebugTypes(DT, 0);
   int count = 0;
   auto inc = [&]() { return ++count; };


        


More information about the llvm-commits mailing list