1 // Use, modification and distribution are subject to the
2 // Boost Software License, Version 1.0. (See accompanying file
3 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <boost/config.hpp>
7 int test_fallthrough(int n
)
21 int test_unreachable(int i
)
23 if(BOOST_LIKELY(i
)) return i
;
26 BOOST_UNREACHABLE_RETURN(0);
29 BOOST_FORCEINLINE
int always_inline(int i
){ return ++i
; }
30 BOOST_NOINLINE
int never_inline(int i
){ return ++i
; }
32 BOOST_NORETURN
void always_throw()
37 struct BOOST_MAY_ALIAS aliasing_struct
{};
38 typedef unsigned int BOOST_MAY_ALIAS aliasing_uint
;
41 #define test_fallthrough(x) foobar(x)
46 typedef int unused_type BOOST_ATTRIBUTE_UNUSED
;
49 int result
= test_fallthrough
BOOST_PREVENT_MACRO_SUBSTITUTION(0);
50 BOOST_STATIC_CONSTANT(bool, value
= 0);
51 result
+= test_unreachable(1);
52 result
+= always_inline(2);
53 result
+= never_inline(3);
54 if(BOOST_UNLIKELY(!result
))