145
|
1 //===-- interception_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 AddressSanitizer, an address sanity checker.
|
|
10 //
|
|
11 // Compile-time tests of the internal type definitions.
|
|
12 //===----------------------------------------------------------------------===//
|
|
13
|
|
14 #include "interception.h"
|
|
15
|
|
16 #if SANITIZER_LINUX || SANITIZER_MAC
|
|
17
|
|
18 #include <sys/types.h>
|
|
19 #include <stddef.h>
|
|
20 #include <stdint.h>
|
|
21
|
|
22 COMPILER_CHECK(sizeof(::SIZE_T) == sizeof(size_t));
|
|
23 COMPILER_CHECK(sizeof(::SSIZE_T) == sizeof(ssize_t));
|
|
24 COMPILER_CHECK(sizeof(::PTRDIFF_T) == sizeof(ptrdiff_t));
|
|
25 COMPILER_CHECK(sizeof(::INTMAX_T) == sizeof(intmax_t));
|
|
26
|
|
27 #if !SANITIZER_MAC
|
|
28 COMPILER_CHECK(sizeof(::OFF64_T) == sizeof(off64_t));
|
|
29 #endif
|
|
30
|
|
31 // The following are the cases when pread (and friends) is used instead of
|
|
32 // pread64. In those cases we need OFF_T to match off_t. We don't care about the
|
|
33 // rest (they depend on _FILE_OFFSET_BITS setting when building an application).
|
|
34 # if SANITIZER_ANDROID || !defined _FILE_OFFSET_BITS || \
|
|
35 _FILE_OFFSET_BITS != 64
|
|
36 COMPILER_CHECK(sizeof(::OFF_T) == sizeof(off_t));
|
|
37 # endif
|
|
38
|
|
39 #endif
|