aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2012-06-07 19:14:18 +0200
committerRicardo M. Correia <rcorreia@wizy.org>2012-06-07 20:22:18 +0200
commit31ac53fbdc2346876da201b9e1495565b38b46ba (patch)
tree97b316d9ec964f36d1b96771f68659e46e736a39 /src/test
parent43346904e15c3f1c3f92eee140dbf37b897c7c21 (diff)
Move NOINLINE definition to test where it's used.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bignum_tests.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
index 38c625bba1..8620f81f17 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.
//