mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
29 lines
1001 B
Swift
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() {}
|
|
}
|