Commit 62ece2c5 authored by David Matlack's avatar David Matlack Committed by Paolo Bonzini

KVM: selftests: Tell the compiler that code after TEST_FAIL() is unreachable

Add __builtin_unreachable() to TEST_FAIL() so that the compiler knows
that any code after a TEST_FAIL() is unreachable.
Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Message-Id: <20220929181207.2281449-2-dmatlack@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c96409d1
......@@ -63,8 +63,10 @@ void test_assert(bool exp, const char *exp_str,
#a, #b, #a, (unsigned long) __a, #b, (unsigned long) __b); \
} while (0)
#define TEST_FAIL(fmt, ...) \
TEST_ASSERT(false, fmt, ##__VA_ARGS__)
#define TEST_FAIL(fmt, ...) do { \
TEST_ASSERT(false, fmt, ##__VA_ARGS__); \
__builtin_unreachable(); \
} while (0)
size_t parse_size(const char *size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment