xref: /qemu/include/tcg/debug-assert.h (revision 78f314cf)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Define tcg_debug_assert
4  * Copyright (c) 2008 Fabrice Bellard
5  */
6 
7 #ifndef TCG_DEBUG_ASSERT_H
8 #define TCG_DEBUG_ASSERT_H
9 
10 #if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS
11 # define tcg_debug_assert(X) do { assert(X); } while (0)
12 #else
13 # define tcg_debug_assert(X) \
14     do { if (!(X)) { __builtin_unreachable(); } } while (0)
15 #endif
16 
17 #endif
18