Skip to content

Commit d46655e

Browse files
committed
PrintAsClang: Disable Float16 check on platforms where it's unsupported
1 parent 20c7334 commit d46655e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/PrintAsObjC/unicode-scalar-reference.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// or actually be printed using a C / Objective-C compatible type.
66

77
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) \
8-
// RUN: %s -emit-module -verify -o %t \
8+
// RUN: %s -emit-module -verify -o %t -emit-module-doc \
99
// RUN: -emit-clang-header-path %t/compat.h
1010
// RUN: %FileCheck %s --input-file %t/compat.h
1111

@@ -17,6 +17,15 @@ func referencesScalar() -> Unicode.Scalar { fatalError() }
1717
func x_referencesRelated(a: CChar32, b: CWideChar) { }
1818
// CHECK: SWIFT_EXTERN void referencesRelated(char32_t a, wchar_t b)
1919

20-
@_cdecl("referencesFloat16")
21-
func y_referencesFloat16(a: Float16, b: CFloat16) { }
20+
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))
21+
// Actual test of Float16, on supported platforms.
22+
@_cdecl("referencesFloat16")
23+
func y_referencesFloat16(a: Float16, b: CFloat16) { }
24+
#else
25+
// Just print the expected string on macOS&x86_64 where there's no Float16.
26+
// This disables this one check on unsupported platforms.
27+
/// SWIFT_EXTERN void referencesFloat16(_Float16 a, _Float16 b)
28+
@_cdecl("printTheDoc")
29+
public func y_printTheDoc() { }
30+
#endif
2231
// CHECK: SWIFT_EXTERN void referencesFloat16(_Float16 a, _Float16 b)

0 commit comments

Comments
 (0)