[llvm] [cross-project] Add tests for LLDB data-formatters for llvm::ArrayRef (PR #173238)

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 6 22:58:09 PST 2026


================
@@ -12,12 +12,19 @@ add_llvm_executable(check-gdb-llvm-support
 )
 target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
 
+add_executable(check-lldb-llvm-support-arrayref
+        debuginfo-tests/llvm-prettyprinters/lldb/arrayref.cpp
+)
+target_link_libraries(check-lldb-llvm-support-arrayref PRIVATE LLVMSupport)
+target_compile_options(check-lldb-llvm-support-arrayref PRIVATE -g -O0)
----------------
mikaelholmen wrote:

Hello @Michael137

I noticed that if you compile with ```-D_FORTIFY_SOURCE=2``` we now get
```
In file included from /app/gcc/14.2.0/include/c++/14.2.0/x86_64-pc-linux-gnu/bits/os_defines.h:39,
                 from /app/gcc/14.2.0/include/c++/14.2.0/x86_64-pc-linux-gnu/bits/c++config.h:680,
                 from /app/gcc/14.2.0/include/c++/14.2.0/type_traits:38,
                 from ../include/llvm/ADT/ADL.h:12,
                 from ../include/llvm/ADT/Hashing.h:47,
                 from ../include/llvm/ADT/ArrayRef.h:12,
                 from ../../cross-project-tests/debuginfo-tests/llvm-prettyprinters/lldb/arrayref.cpp:1:
/usr/include/features.h:381:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  381 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
```
when compiling cross-project-tests. And if compiling with -Werror, the build then fails.

I suppose it's because of the hardcoded "-O0" in the config above.

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


More information about the llvm-commits mailing list