Daily bump.
[official-gcc.git] / libsanitizer / interception / interception_type_test.cc
blobf664eeeb04fe622565be498cb3520c34cd065637
1 //===-- interception_type_test.cc -------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is a part of AddressSanitizer, an address sanity checker.
9 //
10 // Compile-time tests of the internal type definitions.
11 //===----------------------------------------------------------------------===//
13 #if defined(__linux__) || defined(__APPLE__)
15 #include "interception.h"
16 #include <sys/types.h>
17 #include <stddef.h>
18 #include <stdint.h>
20 COMPILER_CHECK(sizeof(SIZE_T) == sizeof(size_t));
21 COMPILER_CHECK(sizeof(SSIZE_T) == sizeof(ssize_t));
22 COMPILER_CHECK(sizeof(PTRDIFF_T) == sizeof(ptrdiff_t));
23 COMPILER_CHECK(sizeof(INTMAX_T) == sizeof(intmax_t));
25 #ifndef __APPLE__
26 COMPILER_CHECK(sizeof(OFF64_T) == sizeof(off64_t));
27 #endif
29 // The following are the cases when pread (and friends) is used instead of
30 // pread64. In those cases we need OFF_T to match off_t. We don't care about the
31 // rest (they depend on _FILE_OFFSET_BITS setting when building an application).
32 # if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \
33 _FILE_OFFSET_BITS != 64
34 COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
35 # endif
37 #endif