• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // This test makes sure that we do assume that type_infos are unique across
10 // all translation units on Apple platforms. See https://llvm.org/PR45549.
11 
12 // TODO:
13 // We don't really want to require 'darwin' here -- instead we'd like to express
14 // that this test requires the flavor of libc++ built by Apple, which we don't
15 // have a clear way to express right now. If another flavor of libc++ was built
16 // targetting Apple platforms without assuming merged RTTI, this test would fail.
17 // REQUIRES: darwin
18 
19 #include <typeinfo>
20 
21 #if !defined(_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
22 #   error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be defined on Apple platforms"
23 #endif
24 
25 #if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 1
26 #   error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 1 (assume RTTI is merged) on Apple platforms"
27 #endif
28