Files
swift-mirror/test/Interpreter/SDK/submodules_smoke_test.swift
Devin Coughlin d08b98b1ca Sema: Turn on availability checking by default
Enable checking for uses of potentially unavailable APIs. There is
a frontend option to disable it: -disable-availability-checking.

This commit updates the SDK overlays with @availability() annotations for the
declarations where the overlay refers to potentially unavailable APIs. It also changes
several tests that refer to potentially unavailable APIs to use either #available()
or @availability annotations.

Swift SVN r27272
2015-04-14 06:44:01 +00:00

31 lines
712 B
Swift

// RUN: %target-build-swift -parse %s -Xfrontend -verify
// RUN: %target-build-swift -emit-ir -g %s -DNO_ERROR > /dev/null
// REQUIRES: objc_interop
import OpenAL.AL
let _ = alGetError
let _ = OpenAL.alGetError
#if !NO_ERROR
let _ = alcCreateContext // expected-error{{use of unresolved identifier 'alcCreateContext'}}
#endif
#if os(OSX)
import OpenGL.GL3
let _ = glGetString
let _ = OpenGL.glGetString
import AppKit.NSPanGestureRecognizer
@availability(OSX, introduced=10.10)
typealias PanRecognizer = NSPanGestureRecognizer
typealias PanRecognizer2 = AppKit.NSPanGestureRecognizer
#endif
#if !NO_ERROR
let _ = glVertexPointer // expected-error{{use of unresolved identifier 'glVertexPointer'}}
#endif