summaryrefslogtreecommitdiffstats
path: root/libcxxabi/test/dynamic_cast5.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-11-24 22:38:57 +0000
committerEric Fiselier <eric@efcs.ca>2014-11-24 22:38:57 +0000
commitc5de7b113b53a72ea02ea269d81151e8b3c3f9df (patch)
treee005e50154517fc7194131839475a171945f4c8d /libcxxabi/test/dynamic_cast5.cpp
parente1526fc20515aecd4a26bf7dd377f72afbb080e1 (diff)
downloadbcm5719-llvm-c5de7b113b53a72ea02ea269d81151e8b3c3f9df.tar.gz
bcm5719-llvm-c5de7b113b53a72ea02ea269d81151e8b3c3f9df.zip
[libcxxabi] Refactor test timing logic and disable by default.
Summary: When using LIT the timing output is entirely unused but introduces a dependency on `<chrono>`. When libc++ is built without a montonic clock this causes some of the tests to fail. This patch factors out all of the timing logic into `support/timer.hpp` and disables it by default. To enable the timing you must define `LIBCXXABI_TIME_TESTS`. Reviewers: mclow.lists, danalbert, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6391 llvm-svn: 222701
Diffstat (limited to 'libcxxabi/test/dynamic_cast5.cpp')
-rw-r--r--libcxxabi/test/dynamic_cast5.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/libcxxabi/test/dynamic_cast5.cpp b/libcxxabi/test/dynamic_cast5.cpp
index 89869698c34..d7064f4b4de 100644
--- a/libcxxabi/test/dynamic_cast5.cpp
+++ b/libcxxabi/test/dynamic_cast5.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include <cassert>
+#include "support/timer.hpp"
namespace t1
{
@@ -1298,15 +1299,10 @@ void test()
} // t9
-#include <chrono>
-#include <iostream>
int main()
{
- typedef std::chrono::high_resolution_clock Clock;
- typedef Clock::time_point time_point;
- typedef std::chrono::duration<double, std::micro> NS;
- time_point t0 = Clock::now();
+ timer t;
t1::test();
t2::test();
t3::test();
@@ -1316,6 +1312,4 @@ int main()
t7::test();
t8::test();
t9::test();
- time_point t1 = Clock::now();
- std::cout << NS(t1-t0).count() << " microseconds\n";
}
OpenPOWER on IntegriCloud