From 69190f95b1698cec8366ad657000b275c2039c1b Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 6 Apr 2021 16:15:18 -0400 Subject: [PATCH] [libc++] NFCI: Fix test pinning down RTTI implementation on Apple platforms The test didn't handle arm64 correctly. --- .../type_info.comparison.apple.compile.pass.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp index 6806641..d8dd1ab9 100644 --- a/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp +++ b/libcxx/test/libcxx/language.support/support.rtti/type.info/type_info.comparison.apple.compile.pass.cpp @@ -6,14 +6,9 @@ // //===----------------------------------------------------------------------===// -// This test makes sure that we do assume that type_infos are unique across -// all translation units on Apple platforms. See https://llvm.org/PR45549. +// This test makes sure that we use the correct implementation for comparing +// type_info objects on Apple platforms. See https://llvm.org/PR45549. -// TODO: -// We don't really want to require 'darwin' here -- instead we'd like to express -// that this test requires the flavor of libc++ built by Apple, which we don't -// have a clear way to express right now. If another flavor of libc++ was built -// targetting Apple platforms without assuming merged RTTI, this test would fail. // REQUIRES: darwin #include @@ -22,6 +17,14 @@ # error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be defined on Apple platforms" #endif -#if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 1 -# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 1 (assume RTTI is merged) on Apple platforms" +#if defined(__x86_64__) +# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 1 +# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 1 (assume RTTI is merged) on Apple platforms" +# endif +#elif defined(__aarch64__) +# if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION != 3 +# error "_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION should be 3 (use the special ARM RTTI) on Apple platforms" +# endif +#else +# error "This test should be updated to pin down the RTTI behavior on this ABI." #endif -- 2.7.4