Files
swift-mirror/test/Interpreter/objc_throw_in_noescape_block.swift
Meghana Gupta 27e826559a Fix analysis invalidation in ClosureLifetimeFixup (#31295)
Accumulate modifiedCFG when calling correctStackNesting.
Found this bug with -sil-verify-force-analysis=true flag
2020-04-24 16:47:11 -07:00

27 lines
748 B
Swift

// RUN: %empty-directory(%t)
//
// RUN: %target-clang -fobjc-arc %S/Inputs/ObjCException.m -c -o %t/ObjCException.o
// RUN: %target-build-swift -Xllvm -sil-verify-force-analysis=true -import-objc-header %S/Inputs/ObjCException.h -Xlinker %t/ObjCException.o %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %target-run %t/a.out
// REQUIRES: executable_test
// REQUIRES: objc_interop
import Foundation
import StdlibUnittest
var ThrowingTestSuite = TestSuite("Throwing")
ThrowingTestSuite.test("noescape verification") {
let catcher = ExceptionCatcher()
let e = catcher.tryBlock {
NSException(name: NSExceptionName(rawValue: "Flames"), reason: "Fire", userInfo: nil).raise()
}
expectEqual(e!.reason, "Fire")
}
runAllTests()