mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This enables additional tests for the ClangImporter. This found a missing piece in the `-enable-objc-interop` work that was done previously. Address that and enable the tests. There are now the following failing tests on Linux: * sdk - depends on Foundation (not hermetic, see SR-7572) * mixed-nsuinteger - depends on Foundation (not hermetic, see SR-7572) * import-mixed-with-header-twice - requires apple/swift PR#16022 * can_import_objc_idempotent - requires apple/swift PR#16022 * objc_protocol_renaming - requires apple/swift PR#16022
25 lines
1.5 KiB
Swift
25 lines
1.5 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: cp -R %S/Inputs/mixed-target %t
|
|
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/../Inputs/custom-modules -enable-objc-interop -import-objc-header %t/mixed-target/header.h -emit-module-path %t/MixedWithHeader.swiftmodule %S/Inputs/mixed-with-header.swift %S/../../Inputs/empty.swift -module-name MixedWithHeader -disable-objc-attr-requires-foundation-module
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %t -I %S/../Inputs/custom-modules -enable-objc-interop -import-objc-header %t/mixed-target/header-again.h -emit-module-path %t/MixedWithHeaderAgain.swiftmodule %S/Inputs/mixed-with-header-again.swift %S/../../Inputs/empty.swift -module-name MixedWithHeaderAgain -disable-objc-attr-requires-foundation-module
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/../Inputs/custom-modules -I %t -enable-objc-interop -typecheck %s -verify
|
|
|
|
// RUN: rm %t/mixed-target/header.h
|
|
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %t -I %S/../Inputs/custom-modules -enable-objc-interop -typecheck %s 2>&1 | %FileCheck %s -check-prefix=USE-SERIALIZED-HEADER
|
|
|
|
// USE-SERIALIZED-HEADER: redefinition of 'Point2D'
|
|
// USE-SERIALIZED-HEADER: previous definition is here
|
|
|
|
import MixedWithHeaderAgain
|
|
|
|
func testLine(line: Line) {
|
|
testLineImpl(line)
|
|
}
|
|
|
|
func useOriginal(a: ForwardClass, b: Derived, c: ForwardClassUser) {
|
|
let conformer = c as! ProtoConformer
|
|
testOriginal(a, b, conformer)
|
|
doSomething(a)
|
|
}
|