blob: f0cee903f245ea0d0f0596bfbe0c9cc1e92dd652 [file] [log] [blame]
// RUN: %target-swift-frontend -typecheck -verify %s
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
typealias JumpBuffer = Int32
#else
import Glibc
typealias JumpBuffer = jmp_buf
#endif
func test_unavailable_returns_twice_function() {
var x: JumpBuffer
_ = setjmp(&x) // expected-error {{'setjmp' is unavailable: Functions that may return more than one time (annotated with the 'returns_twice' attribute) are unavailable in Swift}}
}