Skip to content

Commit 937264f

Browse files
committed
[libcxxabi] [test] Avoid test failures with 64/128 bit long doubles on x86
In libcxxabi/src/demangle/ItaniumDemangle.h, we have long double demangling defined to 20 bytes for i386 and x86_64, based on explicit arch ifdefs. For i386 and x86_64 configurations that actually don't use 80 bit long doubles (such as Android), we don't have LDBL_FP80 set within the test, but the demangler is still capable of demangling 80 bit long doubles, causing test failures like this. .---command stdout------------ | Testing 29859 symbols. | _ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c should be invalid but is not | Got: 0, void test0::h<float>(char (&) [(unsigned int)(sizeof (float) + 0x0.07ff98f7ep-1022L)]) `----------------------------- .---command stderr------------ | Assertion failed: !passed && "demangle did not fail", file libcxxabi/test/test_demangle.pass.cpp, line 30338 `-----------------------------
1 parent 0a1374f commit 937264f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxxabi/test/test_demangle.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30292,7 +30292,7 @@ const unsigned NF = sizeof(fp_literal_cases) / sizeof(fp_literal_cases[0]);
3029230292
const unsigned NEF = sizeof(fp_literal_cases[0].expecting) /
3029330293
sizeof(fp_literal_cases[0].expecting[0]);
3029430294

30295-
const char *invalid_cases[] = {
30295+
const char* invalid_cases[] = {
3029630296
// clang-format off
3029730297
"_ZIPPreEncode",
3029830298
"Agentt",
@@ -30301,7 +30301,7 @@ const char *invalid_cases[] = {
3030130301
"_ZNSt16allocator_traitsISaIN4llvm3sys2fs18directory_iteratorEEE9constructIS3_IS3_EEEDTcl12_S_constructfp_fp0_spcl7forwardIT0_Efp1_EEERS4_PT_DpOS7_",
3030230302
"3FooILdaaaaaaaaaaAAAAaaEE",
3030330303
"3FooILdaaaaaaaaaaaaaaEE",
30304-
#if !LDBL_FP80
30304+
#if !LDBL_FP80 && !defined(__x86_64__) && !defined(__i386__)
3030530305
"_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c",
3030630306
#endif
3030730307
// The following test cases were found by libFuzzer+ASAN

0 commit comments

Comments
 (0)