From fb946da259d26e703c8da7f7cb155fa244757f75 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 18 Jul 2016 03:00:09 +0000 Subject: [PATCH] Add checkpoint diagnostics to help diagnose buildbot failures. llvm-svn: 275754 --- .../category.ctype/locale.ctype.byname/types.pass.cpp | 4 ++++ libcxx/test/support/assert_checkpoint.h | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp index fdfab57..34af418 100644 --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp @@ -28,10 +28,12 @@ #include #include "platform_support.h" // locale name macros +#include "assert_checkpoint.h" int main() { { + CHECKPOINT("constructing en-US.UTF-8"); std::locale l(LOCALE_en_US_UTF_8); { assert(std::has_facet >(l)); @@ -45,6 +47,7 @@ int main() } } { + CHECKPOINT("constructing default locale"); std::locale l(""); { assert(std::has_facet >(l)); @@ -58,6 +61,7 @@ int main() } } { + CHECKPOINT("constructing C locale"); std::locale l("C"); { assert(std::has_facet >(l)); diff --git a/libcxx/test/support/assert_checkpoint.h b/libcxx/test/support/assert_checkpoint.h index cf03328..6627b35 100644 --- a/libcxx/test/support/assert_checkpoint.h +++ b/libcxx/test/support/assert_checkpoint.h @@ -11,6 +11,11 @@ struct Checkpoint { int line; const char* msg; + Checkpoint() : file(nullptr), func(nullptr), line(-1), msg(nullptr) {} + Checkpoint(const char* xfile, const char* xfunc, int xline, const char* xmsg) + : file(xfile), func(xfunc), line(xline), msg(xmsg) + {} + template void print(Stream& s) const { if (!file) { @@ -30,7 +35,7 @@ inline Checkpoint& globalCheckpoint() { } inline void clearCheckpoint() { - globalCheckpoint() = {}; + globalCheckpoint() = Checkpoint(); } #if defined(__GNUC__) @@ -39,7 +44,7 @@ inline void clearCheckpoint() { #define CHECKPOINT_FUNCTION_NAME __func__ #endif -#define CHECKPOINT(msg) globalCheckpoint() = Checkpoint{__FILE__, CHECKPOINT_FUNCTION_NAME, __LINE__, msg} +#define CHECKPOINT(msg) globalCheckpoint() = Checkpoint(__FILE__, CHECKPOINT_FUNCTION_NAME, __LINE__, msg); inline void checkpointSignalHandler(int signal) { if (signal == SIGABRT) { -- 2.7.4