Skip to content

Commit

Permalink
tests: reorganize tests so that they actually use the target platform
Browse files Browse the repository at this point in the history
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
  • Loading branch information
gribozavr committed Jan 19, 2015
1 parent 753de15 commit 3b04d1b
Show file tree
Hide file tree
Showing 1,190 changed files with 3,556 additions and 2,656 deletions.
2 changes: 1 addition & 1 deletion test/1_stdlib/ArrayDiagnostics.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %s -parse -verify
// RUN: %target-parse-verify-swift

class NotEquatable {}

Expand Down
2 changes: 1 addition & 1 deletion test/1_stdlib/CharacterTypes.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -enable-character-literals
// RUN: %target-parse-verify-swift -enable-character-literals

func testTypeInference() {
func isUnicodeScalar(inout _: UnicodeScalar) {}
Expand Down
2 changes: 1 addition & 1 deletion test/1_stdlib/RangeDiagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// RUN: %swift -verify -parse %s
// RUN: %target-parse-verify-swift

func assertCollection<C: CollectionType>(_: C) {}
assertCollection(0..<10)
Expand Down
2 changes: 1 addition & 1 deletion test/1_stdlib/StringDiagnostics.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift

// Common pitfall: trying to subscript a string with integers.
func testIntSubscripting(s: String, i: Int) {
Expand Down
2 changes: 1 addition & 1 deletion test/1_stdlib/UnicodeScalarDiagnostics.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %s -parse -verify
// RUN: %target-parse-verify-swift

func isString(inout s: String) {}

Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/basicDeclarations.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -D FOO -D BAR -target x86_64-apple-macosx10.9
// RUN: %target-parse-verify-swift -D FOO -D BAR

class A {}

Expand Down
24 changes: 13 additions & 11 deletions test/BuildConfigurations/basicIdentity.swift
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
// RUN: %swift -parse %s -verify -D FOO -D BAZ -target x86_64-apple-macosx10.9
// RUN: %swift -parse %s -verify -D FOO -D BAZ -target x86_64-apple-macosx10.9 -parse-stdlib

struct Foo {}

#if FOO
var a = 0
var a = Foo()
#endif
var b = a

#if !BAR
var c = 0
var c = Foo()
#endif
var d = c

#if FOO || BAR
var e = 0
var e = Foo()
#endif
var f = e

#if BAR || FOO
var g = 0
var g = Foo()
#endif
var h = g

#if FOO && BAZ
var i = 0
var i = Foo()
#endif
var j = i

#if os(OSX)
var k = 0
var k = Foo()
#endif
var l = k

#if arch(x86_64)
var m = 0
var m = Foo()
#endif
var n = m

#if FOO && !BAR && BAZ && os(OSX) && arch(x86_64) && _runtime(_ObjC)
var o = 0
var o = Foo()
#endif
var p = o

#if FOO && (!BAR && BAZ && os(OSX) && arch(x86_64)) && _runtime(_ObjC)
var q = 0
var q = Foo()
#endif
var r = q

#if FOO && !(!BAZ && BAZ && os(OSX) && arch(x86_64)) && _runtime(_ObjC)
var s = 0
var s = Foo()
#endif
var t = s
2 changes: 1 addition & 1 deletion test/BuildConfigurations/basicParseErrors.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -D FOO -D BAZ -target x86_64-apple-macosx10.9
// RUN: %target-parse-verify-swift -D FOO -D BAZ

#if FOO == BAZ // expected-error{{expected '&&' or '||' expression}}
var x = 0
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/decl_parse_errors.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift

class C {

Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/module_top_level.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -parse-as-library
// RUN: %target-parse-verify-swift -parse-as-library

#if FAIL
class C {}
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/no_configuration_error1.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift

// With a space next to the '#if'
#if // expected-error {{expected a build configuration expression to follow the #if clause}}
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/no_configuration_error2.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift

// No space next to the '#if'

Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-function-2.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D BLAH %s -verify -parse
// RUN: %target-parse-verify-swift -D BLAH

// Check that if config statement has range properly nested in its parent
// EOF.
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-function-3.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D BLAH %s -verify -parse
// RUN: %target-parse-verify-swift -D BLAH

// Check that if config statement has range properly nested in its parent
// EOF.
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-function-4.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D BLAH %s -verify -parse
// RUN: %target-parse-verify-swift -D BLAH

// Check that if config statement has range properly nested in its parent
// EOF.
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-function.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %s -verify -parse
// RUN: %target-parse-verify-swift

// Check that if config statement has range properly nested in its parent
// EOF.
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-statement-2.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D BLAH %s -verify -parse
// RUN: %target-parse-verify-swift -D BLAH

func foo() { // expected-note {{to match this opening '{'}}
if true {
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-inside-statement.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %s -verify -parse
// RUN: %target-parse-verify-swift

func foo() { // expected-note {{to match this opening '{'}}
if true {
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-top-level-clean.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D FOO %s -verify -parse
// RUN: %target-parse-verify-swift -D FOO

var x = 0

Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/pound-if-top-level.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -D BLAH %s -verify -parse
// RUN: %target-parse-verify-swift -D BLAH

// Check that if config statement has range properly nested in its parent
// EOF.
Expand Down
2 changes: 1 addition & 1 deletion test/BuildConfigurations/topLevelDeclarations.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -D FOO
// RUN: %target-parse-verify-swift -D FOO

// This test is meant to ensure that mixes of top-level declarations, statements
// and expressions within #if blocks parse correctly
Expand Down
8 changes: 6 additions & 2 deletions test/BuildConfigurations/trailingClosureOnTargetConfig.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// RUN: %swift -parse %s -verify -D FOO -D BAZ -target x86_64-apple-macosx10.9
// RUN: %swift -parse %s -verify -D FOO -D BAZ -target x86_64-apple-macosx10.9 -parse-stdlib

struct Foo {}

func useFoo(foo: Foo) {}

#if arch(x86_64) && os(OSX)
println("Mac") // This should not be parsed as a trailing closure
useFoo(Foo()) // This should not be parsed as a trailing closure
#endif
2 changes: 1 addition & 1 deletion test/ClangModules/CoreServices_test.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-parse-verify-swift %clang-importer-sdk

import CoreServices

Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/Darwin_test.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-parse-verify-swift %clang-importer-sdk

import Darwin

Expand Down
8 changes: 4 additions & 4 deletions test/ClangModules/MixedSource/broken-modules.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: not %swift -parse %s -I %S/Inputs/broken-modules/ -enable-source-import -show-diagnostics-after-fatal 2> %t/err.txt
// RUN: not %target-swift-frontend -parse %s -I %S/Inputs/broken-modules/ -enable-source-import -show-diagnostics-after-fatal 2> %t/err.txt
// RUN: FileCheck -check-prefix CHECK -check-prefix CLANG-CHECK %s < %t/err.txt

// RUN: not %swift -parse %s -import-objc-header %S/Inputs/broken-modules/BrokenClangModule.h -enable-source-import 2> %t/err.bridging-header.txt
// RUN: not %target-swift-frontend -parse %s -import-objc-header %S/Inputs/broken-modules/BrokenClangModule.h -enable-source-import 2> %t/err.bridging-header.txt
// RUN: FileCheck -check-prefix CHECK-BRIDGING-HEADER -check-prefix CLANG-CHECK %s < %t/err.bridging-header.txt

// RUN: not %swift -parse %s -import-objc-header %t/fake.h 2>&1 | FileCheck -check-prefix=MISSING-HEADER %s
// RUN: not %target-swift-frontend -parse %s -import-objc-header %t/fake.h 2>&1 | FileCheck -check-prefix=MISSING-HEADER %s

// RUN: not %swift -parse %s -import-objc-header %S/../../Inputs/empty.swift 2>&1 | FileCheck -check-prefix=EMPTY-HEADER %s
// RUN: not %target-swift-frontend -parse %s -import-objc-header %S/../../Inputs/empty.swift 2>&1 | FileCheck -check-prefix=EMPTY-HEADER %s

// MISSING-HEADER: error: bridging header '{{.*}}/fake.h' does not exist
// MISSING-HEADER-NOT: error
Expand Down
8 changes: 3 additions & 5 deletions test/ClangModules/MixedSource/import-mixed-framework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
// RUN: cp -r %S/Inputs/mixed-framework/Mixed.framework %t

// Don't crash if a generated header is present but the swiftmodule is missing.
// RUN: not %swift %clang-importer-sdk -F %t -parse %s
// RUN: not %target-swift-frontend %clang-importer-sdk -F %t -parse %s

// RUN: %swiftc_driver -emit-module -o %t/Mixed.framework/Modules/Mixed.swiftmodule/x86_64.swiftmodule %S/Inputs/mixed-framework/Mixed.swift -import-underlying-module -F %t -module-name Mixed -Xfrontend -disable-objc-attr-requires-foundation-module
// RUN: %swift %clang-importer-sdk -F %t -parse %s -verify

// REQUIRES: X86
// RUN: %target-swift-frontend -emit-module -o %t/Mixed.framework/Modules/Mixed.swiftmodule/%target-swiftmodule-name %S/Inputs/mixed-framework/Mixed.swift -import-underlying-module -F %t -module-name Mixed -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend %clang-importer-sdk -F %t -parse %s -verify

import Mixed

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: cp -R %S/Inputs/mixed-target %t

// RUN: %swiftc_driver -Xfrontend %clang-importer-sdk -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header.h -emit-module-path %t/MixedWithHeader.swiftmodule %S/Inputs/mixed-with-header.swift %S/../../Inputs/empty.swift -module-name MixedWithHeader
// RUN: %swiftc_driver -Xfrontend %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header-again.h -emit-module-path %t/MixedWithHeaderAgain.swiftmodule %S/Inputs/mixed-with-header-again.swift %S/../../Inputs/empty.swift -module-name MixedWithHeaderAgain
// RUN: %swift %clang-importer-sdk -I %S/../Inputs/custom-modules -I %t -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header.h -emit-module-path %t/MixedWithHeader.swiftmodule %S/Inputs/mixed-with-header.swift %S/../../Inputs/empty.swift -module-name MixedWithHeader
// RUN: %target-swift-frontend %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header-again.h -emit-module-path %t/MixedWithHeaderAgain.swiftmodule %S/Inputs/mixed-with-header-again.swift %S/../../Inputs/empty.swift -module-name MixedWithHeaderAgain
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/../Inputs/custom-modules -I %t -parse %s -verify

// RUN: rm %t/mixed-target/header.h
// RUN: not %swift %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s 2>&1 | FileCheck %s -check-prefix=USE-SERIALIZED-HEADER
// RUN: not %target-swift-frontend %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s 2>&1 | FileCheck %s -check-prefix=USE-SERIALIZED-HEADER

// USE-SERIALIZED-HEADER: redefinition of 'Point2D'
// USE-SERIALIZED-HEADER: previous definition is here
Expand Down
6 changes: 3 additions & 3 deletions test/ClangModules/MixedSource/import-mixed-with-header.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: cp -R %S/Inputs/mixed-target %t

// RUN: %swiftc_driver -Xfrontend %clang-importer-sdk -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header.h -emit-module-path %t/MixedWithHeader.swiftmodule %S/Inputs/mixed-with-header.swift %S/../../Inputs/empty.swift -module-name MixedWithHeader
// RUN: %swift %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/../Inputs/custom-modules -import-objc-header %t/mixed-target/header.h -emit-module-path %t/MixedWithHeader.swiftmodule %S/Inputs/mixed-with-header.swift %S/../../Inputs/empty.swift -module-name MixedWithHeader
// RUN: %target-swift-frontend %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s -verify

// RUN: rm -rf %t/mixed-target/
// RUN: %swift %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %t -I %S/../Inputs/custom-modules -parse %s -verify

import MixedWithHeader

Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/MixedSource/mixed-nsuinteger.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -I %S/Inputs/user-module -parse -target x86_64-apple-darwin13 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/Inputs/user-module -parse %s -verify

// Type checker should not report any errors in the code below.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 -I %S/../Inputs/custom-modules -import-objc-header %S/Inputs/mixed-target/header.h -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/../Inputs/custom-modules -import-objc-header %S/Inputs/mixed-target/header.h -parse %s -verify

func test(foo : FooProto) {
let _: CInt = foo.bar
Expand Down
6 changes: 3 additions & 3 deletions test/ClangModules/MixedSource/mixed-target-using-module.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 -F %S/Inputs/mixed-target/ -module-name Mixed -import-underlying-module -parse %s -verify
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 -F %S/Inputs/mixed-target/ -module-name Mixed -import-underlying-module -emit-ir %S/../../Inputs/empty.swift - | FileCheck -check-prefix=CHECK-AUTOLINK %s
// RUN: not %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 -F %S/Inputs/mixed-target/ -module-name WrongName -import-underlying-module -parse %s 2>&1 | FileCheck -check-prefix=CHECK-WRONG-NAME %s
// RUN: %target-swift-frontend %clang-importer-sdk -F %S/Inputs/mixed-target/ -module-name Mixed -import-underlying-module -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -F %S/Inputs/mixed-target/ -module-name Mixed -import-underlying-module -emit-ir %S/../../Inputs/empty.swift - | FileCheck -check-prefix=CHECK-AUTOLINK %s
// RUN: not %target-swift-frontend %clang-importer-sdk -F %S/Inputs/mixed-target/ -module-name WrongName -import-underlying-module -parse %s 2>&1 | FileCheck -check-prefix=CHECK-WRONG-NAME %s

// CHECK-AUTOLINK: !{{[0-9]+}} = !{i32 {{[0-9]+}}, !"Linker Options", ![[LINK_LIST:[0-9]+]]}
// CHECK-AUTOLINK: ![[LINK_LIST]] = !{
Expand Down
4 changes: 2 additions & 2 deletions test/ClangModules/MixedSource/resolve-cross-language.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t

// RUN: %swiftc_driver -emit-module -emit-objc-header -o %t/Base.swiftmodule %S/Inputs/resolve-cross-language/Base.swift -Xfrontend -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend -emit-module -emit-objc-header -o %t/Base.swiftmodule %S/Inputs/resolve-cross-language/Base.swift -disable-objc-attr-requires-foundation-module
// RUN: cp %S/Inputs/resolve-cross-language/Base-module.map %t/module.map
// RUN: %swift %clang-importer-sdk -parse -I %t -F %S/Inputs/resolve-cross-language %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse -I %t -F %S/Inputs/resolve-cross-language %s -verify

import Base
import BaseUser
Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/Security_test.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify

import Security

Expand Down
4 changes: 3 additions & 1 deletion test/ClangModules/accessibility_framework.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify %s

// REQUIRES: OS=macosx

// The accessibility APIs are handled differently. A class might conform to both
// NSAccessibility (containing accessibility properties) and individual
Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/adapter.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %clang-importer-sdk -I %S/Inputs/custom-modules %s
// RUN: %target-swift-frontend -parse -verify %clang-importer-sdk -I %S/Inputs/custom-modules %s

// Do not import Foundation! This tests indirect visibility.
import Redeclaration
Expand Down
6 changes: 3 additions & 3 deletions test/ClangModules/autolinking.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %swift %s -sdk %S/Inputs -I %S/Inputs/custom-modules -emit-ir -o %t/without-adapter.ll
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -emit-ir -o %t/without-adapter.ll
// RUN: FileCheck %s < %t/without-adapter.ll

// RUN: %swift -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -module-link-name SwiftAdapter -module-name ClangModuleWithAdapter -I=%S/Inputs/custom-modules -o %t
// RUN: %swift %s -sdk %S/Inputs -I %S/Inputs/custom-modules -I %t -emit-ir -o %t/with-adapter.ll
// RUN: %target-swift-frontend -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -module-link-name SwiftAdapter -module-name ClangModuleWithAdapter -I %S/Inputs/custom-modules -o %t
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -I %t -emit-ir -o %t/with-adapter.ll
// RUN: FileCheck %s < %t/with-adapter.ll
// RUN: FileCheck --check-prefix=CHECK-WITH-SWIFT %s < %t/with-adapter.ll

Expand Down
6 changes: 1 addition & 5 deletions test/ClangModules/availability.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify -I %S/Inputs/custom-modules %s

import Dispatch
import Foundation
Expand Down Expand Up @@ -36,10 +36,6 @@ func test_class_avail(x:NSObject, obj: AnyObject) {
obj.`class`!() // expected-error {{'class()' is unavailable: use 'dynamicType' instead}}
}

func test_unavailable_because_deprecated() {
println(NSRealMemoryAvailable()) // expected-error {{'NSRealMemoryAvailable()' is unavailable: APIs deprecated as of OS X 10.9 and earlier are unavailable in Swift}}
}

func test_unavailable_app_extension() {
// No expected error here. See corresponding App extension test.
println(SomeCrazyAppExtensionForbiddenAPI()) // no-error
Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/availability_app_extension.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 -application-extension %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify -application-extension %s

import Foundation

Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/availability_ios.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -parse -verify %s
// RUN: %target-parse-verify-swift
// REQUIRES: OS=ios

import Foundation
Expand Down
10 changes: 10 additions & 0 deletions test/ClangModules/availability_macosx.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %target-parse-verify-swift

// REQUIRES: OS=macosx

import Foundation

func test_unavailable_because_deprecated() {
println(NSRealMemoryAvailable()) // expected-error {{APIs deprecated as of OS X 10.9 and earlier are unavailable in Swift}}
}

2 changes: 1 addition & 1 deletion test/ClangModules/blocks_parse.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify %s

import blocks
import Foundation
Expand Down
2 changes: 1 addition & 1 deletion test/ClangModules/broken-modules.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: not %swift -parse %s -I %S/Inputs/custom-modules/ -show-diagnostics-after-fatal 2> %t/err.txt
// RUN: not %target-swift-frontend -parse %s -I %S/Inputs/custom-modules/ -show-diagnostics-after-fatal 2> %t/err.txt
// RUN: FileCheck %s < %t/err.txt

import MissingHeader
Expand Down
Loading

0 comments on commit 3b04d1b

Please sign in to comment.