forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport-mixed-framework.swift
28 lines (18 loc) · 1.13 KB
/
import-mixed-framework.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: cp -r %S/Inputs/mixed-framework/Mixed.framework %t
// Don't crash if a generated header is present but the swiftmodule is missing.
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %t -parse %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t/Mixed.framework/Modules/Mixed.swiftmodule/%target-swiftmodule-name %S/Inputs/mixed-framework/Mixed.swift -import-underlying-module -F %t -module-name Mixed -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -F %t -parse %s -verify
// XFAIL: linux
import Mixed
let instance = SwiftClass(x: 42)
instance.pureSwiftMethod(nil)
let clangStruct = PureClangType(x: 1, y: 2)
instance.categoryMethod(clangStruct)
let x: BogusClass? = nil // expected-error {{'BogusClass' is unavailable: cannot find Swift declaration for this class}}
_ = PureSwiftClass.verify()
_ = Mixed.PureSwiftClass.verify()
let _: CustomNameType = convertToProto(CustomNameClass())
_ = SwiftClassWithCustomName() // expected-error {{use of unresolved identifier 'SwiftClassWithCustomName'}}