1 | //===-- hwasan_type_test.cpp ------------------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // This file is a part of HWAddressSanitizer. |
10 | // |
11 | // Compile-time tests of the internal type definitions. |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | #include "interception/interception.h" |
15 | #include "sanitizer_common/sanitizer_platform_limits_posix.h" |
16 | #include "hwasan.h" |
17 | #include <setjmp.h> |
18 | |
19 | #define CHECK_TYPE_SIZE_FITS(TYPE) \ |
20 | COMPILER_CHECK(sizeof(__hw_##TYPE) <= sizeof(TYPE)) |
21 | |
22 | #if HWASAN_WITH_INTERCEPTORS |
23 | CHECK_TYPE_SIZE_FITS(jmp_buf); |
24 | CHECK_TYPE_SIZE_FITS(sigjmp_buf); |
25 | #endif |
26 | |