diff --git a/stdlib/public/SwiftShims/swift/shims/_SwiftConcurrency.h b/stdlib/public/SwiftShims/swift/shims/_SwiftConcurrency.h index a70b178a4da21..30ba154dfe53e 100644 --- a/stdlib/public/SwiftShims/swift/shims/_SwiftConcurrency.h +++ b/stdlib/public/SwiftShims/swift/shims/_SwiftConcurrency.h @@ -25,13 +25,16 @@ typedef struct _SwiftContext { struct _SwiftContext *parentContext; } _SwiftContext; -void exit(int); - -#define EXIT_SUCCESS 0 - #ifdef __cplusplus } // extern "C" } // namespace swift #endif +#ifdef __cplusplus +extern "C" [[noreturn]] +#endif +void exit(int); + +#define EXIT_SUCCESS 0 + #endif // SWIFT_CONCURRENCY_H diff --git a/test/Interop/Cxx/stdlib/print-swiftconcurrencyshims-interface.swift b/test/Interop/Cxx/stdlib/print-swiftconcurrencyshims-interface.swift new file mode 100644 index 0000000000000..7ed9355c89c25 --- /dev/null +++ b/test/Interop/Cxx/stdlib/print-swiftconcurrencyshims-interface.swift @@ -0,0 +1,10 @@ +// RUN: %target-swift-ide-test -print-module -module-to-print=_SwiftConcurrencyShims -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s +// RUN: %target-swift-ide-test -print-module -module-to-print=_SwiftConcurrencyShims -source-filename=x | %FileCheck %s + +// REQUIRES: concurrency + +// Ensure that _SwiftConcurrencyShims defines the same `exit` regardless of whether +// C++ interoperability is enabled. + +// CHECK: func exit(_: Int32) -> Never +// CHECK: var EXIT_SUCCESS: Int32 { get }