From 31ac53fbdc2346876da201b9e1495565b38b46ba Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Thu, 7 Jun 2012 19:14:18 +0200 Subject: Move NOINLINE definition to test where it's used. --- src/test/bignum_tests.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/test/bignum_tests.cpp') diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp index 38c625bba..8620f81f1 100644 --- a/src/test/bignum_tests.cpp +++ b/src/test/bignum_tests.cpp @@ -6,6 +6,22 @@ BOOST_AUTO_TEST_SUITE(bignum_tests) +// Unfortunately there's no standard way of preventing a function from being +// inlined, so we define a macro for it. +// +// You should use it like this: +// NOINLINE void function() {...} +#if defined(__GNUC__) +// This also works and will be defined for any compiler implementing gcc +// extensions, such as clang and icc. +#define NOINLINE __attribute__((noinline)) +#elif defined(_MSC_VER) +#define NOINLINE __declspec(noinline) +#else +// We give out a warning because it impacts the correctness of one bignum test. +#warning You should define NOINLINE for your compiler. +#define NOINLINE +#endif // For the following test case, it is useful to use additional tools. // -- cgit v1.2.3