[PATCH] D131210: [libunwind] undef NDEBUG for assert.h in tests.

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 15:05:49 PDT 2022


fmayer created this revision.
Herald added projects: libunwind, All.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libunwind.
fmayer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This makes sure the assertions also get verified in optimized builds.
This matches what is already done in bad_unwind_info.pass.cpp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131210

Files:
  libunwind/test/forceunwind.pass.cpp
  libunwind/test/libunwind_02.pass.cpp
  libunwind/test/signal_frame.pass.cpp
  libunwind/test/signal_unwind.pass.cpp
  libunwind/test/unw_getcontext.pass.cpp
  libunwind/test/unwind_leaffunction.pass.cpp


Index: libunwind/test/unwind_leaffunction.pass.cpp
===================================================================
--- libunwind/test/unwind_leaffunction.pass.cpp
+++ libunwind/test/unwind_leaffunction.pass.cpp
@@ -13,6 +13,7 @@
 // TODO: Figure out why this fails with Memory Sanitizer.
 // XFAIL: msan
 
+#undef NDEBUG
 #include <assert.h>
 #include <dlfcn.h>
 #include <signal.h>
Index: libunwind/test/unw_getcontext.pass.cpp
===================================================================
--- libunwind/test/unw_getcontext.pass.cpp
+++ libunwind/test/unw_getcontext.pass.cpp
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#undef NDEBUG
 #include <assert.h>
 #include <libunwind.h>
 
Index: libunwind/test/signal_unwind.pass.cpp
===================================================================
--- libunwind/test/signal_unwind.pass.cpp
+++ libunwind/test/signal_unwind.pass.cpp
@@ -13,6 +13,7 @@
 // TODO: Figure out why this fails with Memory Sanitizer.
 // XFAIL: msan
 
+#undef NDEBUG
 #include <assert.h>
 #include <dlfcn.h>
 #include <signal.h>
Index: libunwind/test/signal_frame.pass.cpp
===================================================================
--- libunwind/test/signal_frame.pass.cpp
+++ libunwind/test/signal_frame.pass.cpp
@@ -21,6 +21,7 @@
 // are necessary to run this test.
 // UNSUPPORTED: target=powerpc{{(64)?}}-ibm-aix
 
+#undef NDEBUG
 #include <assert.h>
 #include <stdlib.h>
 #include <libunwind.h>
Index: libunwind/test/libunwind_02.pass.cpp
===================================================================
--- libunwind/test/libunwind_02.pass.cpp
+++ libunwind/test/libunwind_02.pass.cpp
@@ -10,6 +10,7 @@
 // TODO: Figure out why this fails with Memory Sanitizer.
 // XFAIL: msan
 
+#undef NDEBUG
 #include <assert.h>
 #include <stdlib.h>
 #include <unwind.h>
Index: libunwind/test/forceunwind.pass.cpp
===================================================================
--- libunwind/test/forceunwind.pass.cpp
+++ libunwind/test/forceunwind.pass.cpp
@@ -15,6 +15,7 @@
 // Basic test for _Unwind_ForcedUnwind.
 // See libcxxabi/test/forced_unwind* tests too.
 
+#undef NDEBUG
 #include <assert.h>
 #include <dlfcn.h>
 #include <signal.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131210.450148.patch
Type: text/x-patch
Size: 2247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220804/7682c7d9/attachment.bin>


More information about the llvm-commits mailing list