Files
swift-mirror/validation-test/Serialization/bridging-header-first.swift
Xi Ge 36f25c3130 ClangImporter: teach clang importer to import Clang SPI symbols and model them similarly as Swift SPIs
For clang symbols marked with SPI_AVAILABLE, we add SPIAccessControlAttr to them so they will be
considered as SPIs in the AST. To be able to use all these symbols, we also add an implicit SPI import
statement for all clang modules. All clang SPIs belong to the same SPI group named "OBJC_DEFUALT_SPI_GROUP" because clang
currently doesn't support custom SPI group.

rdar://73902734
2021-08-28 11:11:09 -07:00

29 lines
1001 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-module -emit-executable %s -g -I %S/Inputs/bridging-header-first/ -import-objc-header %S/Inputs/bridging-header-first/bridging.h -o %t/main
// RUN: llvm-bcanalyzer -dump %t/main.swiftmodule | %FileCheck -check-prefix CHECK-DUMP %s
// RUN: %target-build-swift -emit-module -emit-executable %s -g -I %S/Inputs/bridging-header-first/ -import-objc-header %S/Inputs/bridging-header-first/bridging.h -o %t/main -whole-module-optimization
// RUN: llvm-bcanalyzer -dump %t/main.swiftmodule | %FileCheck -check-prefix CHECK-DUMP %s
// REQUIRES: objc_interop
// CHECK-DUMP-LABEL: CONTROL_BLOCK
// CHECK-DUMP: MODULE_NAME
// CHECK-DUMP-SAME: 'main'
// CHECK-DUMP-LABEL: INPUT_BLOCK
// CHECK-DUMP: IMPORTED_HEADER
// CHECK-DUMP-SAME: '{{.+}}/bridging.h'
// CHECK-DUMP: IMPORTED_MODULE
// CHECK-DUMP-SAME: 'Module'
// CHECK-DUMP: IMPORTED_MODULE
// CHECK-DUMP: 'Swift'
import Module
class C {}
extension C: AmbivalentProtocol {
func f() {}
}