Skip to content

Commit 7455fb7

Browse files
committed
[android] Fix powl test in Android ARMv7/AArch64.
In Android ARMv7 there was no alias defined for CLongDouble, so importing anything with long double was failing. Defining the alias makes the test pass. AAPCS64 defines long double as 128 bits, which is still unsupported by Swift (SR-9072). Disable this particular test for Android and Linux in AArch64 to not fail (but still test all the other tests).
1 parent 1ee66cd commit 7455fb7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

stdlib/public/core/CTypes.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ public typealias CLongDouble = Float80
8787
// Long Double type equivalent to Double type.
8888
public typealias CLongDouble = Double
8989
#endif
90+
#elseif os(Android)
91+
// On Android, long double is Float128 for AAPCS64, which we don't have yet in
92+
// Swift (SR-9072); and Double for ARMv7.
93+
#if arch(arm)
94+
public typealias CLongDouble = Double
95+
#endif
9096
#endif
9197

9298
// FIXME: Is it actually UTF-32 on Darwin?

test/ClangImporter/cfuncs_parse.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ func test_pow() {
5858
pow(1.5, 2.5)
5959
}
6060

61+
#if !((os(Android) || os(Linux)) && arch(arm64))
62+
// long doubles in AAPCS64 are 128 bits, which is not supported by
63+
// Swift, so don't test this. SR-9072.
6164
func test_powl() {
6265
powl(1.5, 2.5)
6366
}
67+
#endif
6468

6569
func test_puts(_ s: String) {
6670
_ = s.withCString { puts($0) + 32 };

0 commit comments

Comments
 (0)