summaryrefslogtreecommitdiff
path: root/absl/debugging/symbolize_test.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-03-16 09:53:25 -0700
committerGravatar Andy Getz <durandal@google.com>2022-03-16 15:34:01 -0400
commite6ae2641f6261c67adb5766ccbcf953e2bb0a8fd (patch)
treed40c777d1efb37dcf25adf76565d7d85120523a5 /absl/debugging/symbolize_test.cc
parent231c393a170ce3c6d83e8456bc87fe917c333ecf (diff)
Export of internal Abseil changes
-- c49308e5361da572b5accdfe664757ca6bf7fed1 by Derek Mauro <dmauro@google.com>: Disable TestArmThumbOverlap on platforms that don't support it TestArmThumbOverlap includes a pair of test functions, one built in arm mode and the other built in thumb mode. Unfortunately when configured for armv6 hardfloat, gcc refuses to build any functions in thumb mode (even if they don't actually use floating point) Closes #1112 PiperOrigin-RevId: 435078532 Change-Id: I090623d0f89839a5f9dde831756aba5267c9a45c GitOrigin-RevId: c49308e5361da572b5accdfe664757ca6bf7fed1
Diffstat (limited to 'absl/debugging/symbolize_test.cc')
-rw-r--r--absl/debugging/symbolize_test.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/absl/debugging/symbolize_test.cc b/absl/debugging/symbolize_test.cc
index a62fa35d..3165c6ed 100644
--- a/absl/debugging/symbolize_test.cc
+++ b/absl/debugging/symbolize_test.cc
@@ -483,7 +483,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
}
}
-#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) && \
+ ((__ARM_ARCH >= 7) || !defined(__ARM_PCS_VFP))
// Test that we correctly identify bounds of Thumb functions on ARM.
//
// Thumb functions have the lowest-order bit set in their addresses in the ELF
@@ -502,6 +503,10 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
// bit in the Thumb function's entry point. It will correctly compute the end of
// the Thumb function, it will find no overlap between the Thumb and ARM
// functions, and it will return the name of the ARM function.
+//
+// Unfortunately we cannot perform this test on armv6 or lower systems that use
+// the hard float ABI because gcc refuses to compile thumb functions on such
+// systems with a "sorry, unimplemented: Thumb-1 hard-float VFP ABI" error.
__attribute__((target("thumb"))) int ArmThumbOverlapThumb(int x) {
return x * x * x;
@@ -521,7 +526,8 @@ void ABSL_ATTRIBUTE_NOINLINE TestArmThumbOverlap() {
#endif
}
-#endif // defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+#endif // defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) && ((__ARM_ARCH >= 7)
+ // || !defined(__ARM_PCS_VFP))
#elif defined(_WIN32)
#if !defined(ABSL_CONSUME_DLL)
@@ -596,7 +602,8 @@ int main(int argc, char **argv) {
TestWithPCInsideInlineFunction();
TestWithPCInsideNonInlineFunction();
TestWithReturnAddress();
-#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target) && \
+ ((__ARM_ARCH >= 7) || !defined(__ARM_PCS_VFP))
TestArmThumbOverlap();
#endif
#endif