mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] start to emitting a unified header file for a Swift module
This change removes the -emit-cxx-header option, and adds a new -emit-clang-header-path option instead. It's aliased to -emit-objc-header-path for now, but in the future, -emit-objc-header-path will alias to it. After this change Swift can start emitting a single header file that can be expose declarations to C, Objective-C, or C++. For now C++ interface is generated (for all public decls) only when -enable-cxx-interop flag is passed, but that behavior will change once attribute is supported.
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s -typecheck -emit-cxx-header-path %t/empty.h
|
||||
// RUN: %target-swift-frontend %s -typecheck -enable-cxx-interop -emit-clang-header-path %t/empty.h
|
||||
// RUN: %FileCheck %s < %t/empty.h
|
||||
|
||||
// RUN: %check-cxx-header-in-clang -std=c++14 %t/empty.h
|
||||
// RUN: %check-cxx-header-in-clang -std=c++17 %t/empty.h
|
||||
|
||||
// CHECK-NOT: @import Swift;
|
||||
// CHECK-NOT: IBSegueAction
|
||||
|
||||
// CHECK-LABEL: #ifndef EMPTY_SWIFT_H
|
||||
// CHECK-NEXT: #define EMPTY_SWIFT_H
|
||||
|
||||
@@ -63,7 +57,19 @@
|
||||
// CHECK: # define SWIFT_EXTENSION(M)
|
||||
// CHECK: # define OBJC_DESIGNATED_INITIALIZER
|
||||
|
||||
// CHECK-LABEL: namespace empty {
|
||||
// CHECK: } // namespace empty
|
||||
// CHECK-LABEL: #if defined(__OBJC__)
|
||||
// CHECK-NEXT: #if !defined(IBSegueAction)
|
||||
// CHECK-NEXT: # define IBSegueAction
|
||||
// CHECK-NEXT: #endif
|
||||
|
||||
// CHECK-LABEL: #if defined(__OBJC__)
|
||||
// CHECK-NEXT: #if __has_feature(modules)
|
||||
|
||||
// CHECK-LABEL: #if defined(__OBJC__)
|
||||
// CHECK-NEXT: #endif
|
||||
// CHECK-NEXT: #if defined(__cplusplus)
|
||||
// CHECK-NEXT: namespace empty {
|
||||
// CHECK: } // namespace empty
|
||||
// CHECK: #endif
|
||||
|
||||
// CHECK-NOT: @
|
||||
|
||||
Reference in New Issue
Block a user