blob: 140c91b53e6e591b879eda4e7ae6d5665eb1dfa0 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <stddef.h>
11
12#include <stddef.h>
13#include <type_traits>
14
15#ifndef NULL
16#error NULL not defined
17#endif
18
19#ifndef offsetof
20#error offsetof not defined
21#endif
22
23int main()
24{
25 static_assert(sizeof(size_t) == sizeof(void*),
26 "sizeof(size_t) == sizeof(void*)");
27 static_assert(std::is_unsigned<size_t>::value,
28 "std::is_unsigned<size_t>::value");
29 static_assert(std::is_integral<size_t>::value,
30 "std::is_integral<size_t>::value");
31 static_assert(sizeof(ptrdiff_t) == sizeof(void*),
32 "sizeof(ptrdiff_t) == sizeof(void*)");
33 static_assert(std::is_signed<ptrdiff_t>::value,
34 "std::is_signed<ptrdiff_t>::value");
35 static_assert(std::is_integral<ptrdiff_t>::value,
36 "std::is_integral<ptrdiff_t>::value");
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000037}