Skip to content

Commit 69190f9

Browse files
committed
[libc++] NFCI: Fix test pinning down RTTI implementation on Apple platforms
The test didn't handle arm64 correctly.
1 parent 3ba2467 commit 69190f9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66
//
77
//===----------------------------------------------------------------------===//
88

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.
9+
// This test makes sure that we use the correct implementation for comparing
10+
// type_info objects on Apple platforms. See https://llvm.org/PR45549.
1111

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.
1712
// REQUIRES: darwin
1813

1914
#include <typeinfo>
@@ -22,6 +17,14 @@
2217
# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be defined on Apple platforms"
2318
#endif
2419

25-
#if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 1
26-
# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 1 (assume RTTI is merged) on Apple platforms"
20+
#if defined(__x86_64__)
21+
# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 1
22+
# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 1 (assume RTTI is merged) on Apple platforms"
23+
# endif
24+
#elif defined(__aarch64__)
25+
# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 3
26+
# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 3 (use the special ARM RTTI) on Apple platforms"
27+
# endif
28+
#else
29+
# error "This test should be updated to pin down the RTTI behavior on this ABI."
2730
#endif

0 commit comments

Comments
 (0)