[libcxx-commits] [libcxx] 69190f9 - [libc++] NFCI: Fix test pinning down RTTI implementation on Apple platforms

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 6 13:15:56 PDT 2021


Author: Louis Dionne
Date: 2021-04-06T16:15:48-04:00
New Revision: 69190f95b1698cec8366ad657000b275c2039c1b

URL: https://github.com/llvm/llvm-project/commit/69190f95b1698cec8366ad657000b275c2039c1b
DIFF: https://github.com/llvm/llvm-project/commit/69190f95b1698cec8366ad657000b275c2039c1b.diff

LOG: [libc++] NFCI: Fix test pinning down RTTI implementation on Apple platforms

The test didn't handle arm64 correctly.

Added: 
    

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

Removed: 
    


################################################################################
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 68066416fd367..d8dd1ab9a559b 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 <typeinfo>
@@ -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


        


More information about the libcxx-commits mailing list