Files
swift-mirror/test/Interop/SwiftToCxx/module/module-to-namespace.swift
Alex Lorenz 3b3d6c825a [interop][SwiftToCxx] Annotate emitted declarations with Clang's external_source_symbol attribute
Each emitted declaration is annotated with the external_source_symbol with its own USR, to allow Clang's indexer to recognize this declaration as a Swift declaration with a specific USR
2023-01-12 12:15:01 -08:00

16 lines
612 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -typecheck -module-name Test -clang-header-expose-decls=all-public -emit-clang-header-path %t/empty.h
// RUN: %FileCheck %s < %t/empty.h
// RUN: %check-interop-cxx-header-in-clang(%t/empty.h)
// CHECK: #ifdef SWIFT_SYMBOL
// CHECK-NEXT: #undef SWIFT_SYMBOL
// CHECK-NEXT: #endif
// CHECK-NEXT: #define SWIFT_SYMBOL(usrValue) SWIFT_SYMBOL_MODULE_USR("Test", usrValue)
// CHECK-LABEL: namespace Test __attribute__((swift_private)) SWIFT_SYMBOL_MODULE({{.*}}) {
// CHECK: } // namespace Test
// CHECK-EMPTY:
// CHECK-NEXT: #undef SWIFT_SYMBOL