1 //===----------------------------------------------------------------------===// 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 // test type_info 10 11 #include <typeinfo> 12 #include <cstring> 13 #include <cassert> 14 15 #include "test_macros.h" 16 main(int,char **)17int main(int, char**) 18 { 19 const std::type_info& t1 = typeid(int); 20 const std::type_info& t2 = typeid(int); 21 const std::type_info& t3 = typeid(short); 22 assert(t1.hash_code() == t2.hash_code()); 23 assert(t1.hash_code() != t3.hash_code()); 24 25 return 0; 26 } 27