File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed
test/Interop/SwiftToCxx/functions Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 5
5
// RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
6
6
7
7
// CHECK-NOT: SWIFT_EXTERN bool $s9Functions24alwaysEmitIntoClientFuncyS2bF(bool x) SWIFT_NOEXCEPT SWIFT_CALL; // alwaysEmitIntoClientFunc(_:)
8
- // CHECK-NOT: SWIFT_EXTERN double $s9Functions9asyncFuncyS2dYaF(double x) SWIFT_NOEXCEPT SWIFT_CALL; // asyncFunc(_:)
9
8
10
9
// CHECK: namespace Functions {
11
10
// CHECK-EMPTY:
12
11
// CHECK-EMPTY:
13
12
// CHECK-EMPTY:
14
13
// CHECK-EMPTY:
15
- // CHECK-EMPTY:
16
- // CHECK-EMPTY:
17
14
// CHECK-NEXT: } // namespace Functions
18
15
19
16
// CHECK-NOT: inline bool alwaysEmitIntoClientFunc(bool x) noexcept SWIFT_WARN_UNUSED_RESULT {
20
17
// CHECK-NOT: return _impl::$s9Functions24alwaysEmitIntoClientFuncyS2bF(x);
21
18
// CHECK-NOT: }
22
19
23
- // CHECK-NOT: inline double asyncFunc(double x) noexcept SWIFT_WARN_UNUSED_RESULT {
24
- // CHECK-NOT: return _impl::$s9Functions9asyncFuncyS2dYaF(x);
25
- // CHECK-NOT: }
26
-
27
- public func asyncFunc( _ x: Double ) async -> Double { return 2 * x }
28
-
29
20
@_alwaysEmitIntoClient
30
21
public func alwaysEmitIntoClientFunc( _ x: Bool ) -> Bool { return !x }
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-public-decls -emit-clang-header-path %t/functions.h
3
+ // RUN: %FileCheck %s < %t/functions.h
4
+
5
+ // RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
6
+
7
+ // CHECK-NOT: SWIFT_EXTERN double $s9Functions9asyncFuncyS2dYaF(double x) SWIFT_NOEXCEPT SWIFT_CALL; // asyncFunc(_:)
8
+
9
+ // CHECK: namespace Functions {
10
+ // CHECK-EMPTY:
11
+ // CHECK-EMPTY:
12
+ // CHECK-EMPTY:
13
+ // CHECK-EMPTY:
14
+ // CHECK-NEXT: } // namespace Functions
15
+
16
+ // CHECK-NOT: inline double asyncFunc(double x) noexcept SWIFT_WARN_UNUSED_RESULT {
17
+ // CHECK-NOT: return _impl::$s9Functions9asyncFuncyS2dYaF(x);
18
+ // CHECK-NOT: }
19
+
20
+ // REQUIRES: concurrency
21
+
22
+ public func asyncFunc( _ x: Double ) async -> Double { return 2 * x }
You can’t perform that action at this time.
0 commit comments