blob: 4c4d39a0c797465134c5f79f34c3afbe008b5d86 [file] [log] [blame]
// RUN: %target-typecheck-verify-swift
// UNSUPPORTED: OS=windows-msvc
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
typealias JumpBuffer = Int32
#elseif os(Android) || os(Cygwin) || os(FreeBSD) || os(Linux)
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}}
}