Files
swift-mirror/test/stdlib/ErrorBridgedStatic.swift
T
Saleem Abdulrasool b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00

28 lines
776 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-clang -fmodules -c -o %t/ErrorBridgedStaticImpl.o %S/Inputs/ErrorBridgedStaticImpl.m
// RUN: %target-build-swift -static-stdlib -o %t/ErrorBridgedStatic %t/ErrorBridgedStaticImpl.o %s -import-objc-header %S/Inputs/ErrorBridgedStaticImpl.h
// RUN: strip %t/ErrorBridgedStatic
// RUN: %target-run %t/ErrorBridgedStatic
// REQUIRES: executable_test
// REQUIRES: objc_interop
// REQUIRES: static_stdlib
import StdlibUnittest
class Bar: Foo {
override func foo(_ x: Int32) throws {
try super.foo(5)
}
}
var ErrorBridgingStaticTests = TestSuite("ErrorBridging with static libs")
ErrorBridgingStaticTests.test("round-trip Swift override of ObjC method") {
do {
try (Bar() as Foo).foo(5)
} catch { }
}
runAllTests()