tests: reorganize tests so that they actually use the target platform

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
This commit is contained in:
Dmitri Hrybenko
2015-01-19 06:52:49 +00:00
parent 753de15e99
commit 3b04d1b013
1190 changed files with 3520 additions and 2620 deletions

View File

@@ -1,4 +1,4 @@
// RUN: %swift %s -parse -verify
// RUN: %target-parse-verify-swift
class NotEquatable {}

View File

@@ -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) {}

View File

@@ -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)

View File

@@ -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) {

View File

@@ -1,4 +1,4 @@
// RUN: %swift %s -parse -verify
// RUN: %target-parse-verify-swift
func isString(inout s: String) {}

View File

@@ -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 {}

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
class C {

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify -parse-as-library
// RUN: %target-parse-verify-swift -parse-as-library
#if FAIL
class C {}

View File

@@ -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}}

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift
// No space next to the '#if'

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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 {

View File

@@ -1,4 +1,4 @@
// RUN: %swift %s -verify -parse
// RUN: %target-parse-verify-swift
func foo() { // expected-note {{to match this opening '{'}}
if true {

View File

@@ -1,4 +1,4 @@
// RUN: %swift -D FOO %s -verify -parse
// RUN: %target-parse-verify-swift -D FOO
var x = 0

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-parse-verify-swift %clang-importer-sdk
import CoreServices

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-parse-verify-swift %clang-importer-sdk
import Darwin

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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]] = !{

View File

@@ -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

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import Security

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -parse -verify %s
// RUN: %target-parse-verify-swift
// REQUIRES: OS=ios
import Foundation

View File

@@ -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}}
}

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify -import-cf-types -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend -parse -verify -import-cf-types -I %S/Inputs/custom-modules %s
import CoreCooling

View File

@@ -1,4 +1,6 @@
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 %s -emit-ir -o - | FileCheck %s
// RUN: %target-swift-frontend %clang-importer-sdk %s -emit-ir -o - | FileCheck %s
// REQUIRES: OS=macosx
import cfuncs

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 -I %S/Inputs %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify -I %S/Inputs %s
import cfuncs

View File

@@ -1,7 +1,7 @@
// Note: this test intentionally uses a private module cache.
//
// RUN: rm -rf %t/clang-module-cache
// RUN: %target-build-swift -parse -Xfrontend -verify -module-cache-path %t/clang-module-cache -sdk %sdk -target %target-triple %s
// RUN: %target-swift-frontend -parse -verify -module-cache-path %t/clang-module-cache %s
// RUN: ls -lR %t/clang-module-cache | FileCheck %s
// CHECK: _Builtin_intrinsics{{.*}}.pcm
// REQUIRES: sdk

View File

@@ -2,7 +2,7 @@
//
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %swift %clang-importer-sdk -parse -verify -module-cache-path %t/clang-module-cache -target x86_64-apple-macosx10.9 -I %S/Inputs %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify -module-cache-path %t/clang-module-cache -I %S/Inputs %s
// RUN: ls -lR %t/clang-module-cache | FileCheck %s
// CHECK: cfuncs{{.*}}.pcm

View File

@@ -1,4 +1,6 @@
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 -emit-ir -o - -primary-file %s | FileCheck %s
// RUN: %target-swift-frontend %clang-importer-sdk -emit-ir -o - -primary-file %s | FileCheck %s
// REQUIRES: OS=macosx
import ctypes

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-parse-verify-swift %clang-importer-sdk
import ctypes
import CoreGraphics
@@ -22,7 +22,13 @@ func testTribool() {
func testAnonEnum() {
var a = AnonConst1
a = AnonConst2
#if arch(i386) || arch(arm)
var a2: CUnsignedLongLong = a
#elseif arch(x86_64) || arch(arm64)
var a2: CUnsignedLong = a
#else
__portMe()
#endif
}
func testAnonEnumSmall() {
@@ -137,13 +143,6 @@ func testImportMacTypes() {
var t9_qual : ctypes.Float32 = 0.0 // expected-error {{no type named 'Float32' in module 'ctypes'}}
var t10_qual : ctypes.Float64 = 0.0 // expected-error {{no type named 'Float64' in module 'ctypes'}}
// FIXME: this should work. We cannot map Float80 to 'long double' because
// 'long double' has size of 128 bits on SysV ABI, and 80 != 128. 'long
// double' is currently not handled by the importer, so it cannot be
// imported in normal way either.
var t11_unqual : Float80 = Float80_test // expected-error {{use of unresolved identifier 'Float80_test'}}
var t11_qual : ctypes.Float80 = 0.0 // expected-error {{no type named 'Float80' in module 'ctypes'}}
}
var word: Word = 0

View File

@@ -0,0 +1,15 @@
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify %s
// REQUIRES: OS=macosx
import ctypes
func testImportMacTypes() {
// FIXME: this should work. We cannot map Float80 to 'long double' because
// 'long double' has size of 128 bits on SysV ABI, and 80 != 128. 'long
// double' is currently not handled by the importer, so it cannot be
// imported in normal way either.
var t11_unqual : Float80 = Float80_test // expected-error {{use of unresolved identifier 'Float80_test'}}
var t11_qual : ctypes.Float80 = 0.0 // expected-error {{no type named 'Float80' in module 'ctypes'}}
}

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -enable-union-import -parse -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend %clang-importer-sdk -enable-union-import -parse -verify %s
import ctypes

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -I %S/Inputs/custom-modules %s -parse -verify
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/Inputs/custom-modules %s -parse -verify
import ExternIntX

View File

@@ -1,4 +1,6 @@
// RUN: %swift %clang-importer-sdk -target x86_64-apple-macosx10.9 %s -emit-ir -o - | FileCheck %s
// RUN: %target-swift-frontend %clang-importer-sdk %s -emit-ir -o - | FileCheck %s
// REQUIRES: OS=macosx
import cvars

View File

@@ -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 cvars

View File

@@ -1,4 +1,4 @@
// RUN: not %swift -parse %s -F %S/Inputs/frameworks -Xcc -D -Xcc FOO 2> %t.err.txt
// RUN: not %target-swift-frontend -parse %s -F %S/Inputs/frameworks -Xcc -D -Xcc FOO 2> %t.err.txt
// RUN: FileCheck -input-file=%t.err.txt %s
import Module
@@ -7,7 +7,7 @@ import Module
// CHECK: Sub2.h:2:9: error: could not build module 'Another'
// CHECK: diags_from_module.swift:[[@LINE-4]]:8: error: could not build Objective-C module 'Module'
// RUN: %swift -parse %s -F %S/Inputs/frameworks 2> %tw.err.txt
// RUN: %target-swift-frontend -parse %s -F %S/Inputs/frameworks 2> %tw.err.txt
// RUN: FileCheck -input-file=%tw.err.txt %s -check-prefix=CHECK-WARN
// CHECK-WARN: Sub2.h:7:2: warning: here is some warning about something

View File

@@ -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
@exported import macros

View File

@@ -1,6 +1,6 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: %S/../../utils/gyb %s -o %t/mapped-integers.swift
// RUN: %swift %clang-importer-sdk -parse -verify -target x86_64-apple-macosx10.9 %t/mapped-integers.swift
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify %t/mapped-integers.swift
import ctypes

View File

@@ -1,9 +1,9 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %swift -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -I %S/Inputs/custom-modules -module-name ClangModuleWithAdapter -o %t
// RUN: %swift %s -sdk %S/Inputs -I %S/Inputs/custom-modules -I %t -parse
// RUN: %swift %s -I %t -parse -show-diagnostics-after-fatal -verify
// RUN: %target-swift-frontend -emit-module %S/Inputs/adapter.swift -sdk %S/Inputs -I %S/Inputs/custom-modules -module-name ClangModuleWithAdapter -o %t
// RUN: %target-swift-frontend %s -sdk %S/Inputs -I %S/Inputs/custom-modules -I %t -parse
// RUN: %target-swift-frontend %s -I %t -parse -show-diagnostics-after-fatal -verify
// When run without the underlying SDK, we should get an error here.
import ClangModuleWithAdapter // expected-error{{cannot load underlying module for 'ClangModuleWithAdapter'}}

View File

@@ -1,5 +1,5 @@
// RUN: rm -rf %t
// RUN: %swift -parse -sdk "" -I %S/Inputs/custom-modules %s
// RUN: %target-swift-frontend -parse -sdk "" -I %S/Inputs/custom-modules %s
// Verify that we can still import modules even without an SDK.
import ExternIntX;

View File

@@ -1,5 +1,5 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: not %swift -parse %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | FileCheck %s
// RUN: not %target-swift-frontend -parse %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | FileCheck %s
// CHECK: {{.+}}/non-modular/Foo.framework/Headers/Foo.h:1:9: error: include of non-modular header inside framework module 'Foo'
// CHECK: error: could not build Objective-C module 'Foo'

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import nullability;

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -I %S/Inputs/custom-modules %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse -I %S/Inputs/custom-modules %s -verify
// Test the use of Objective-C categories on the value types that
// bridge to Objective-C class types.

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -parse-as-library -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -parse-as-library -verify %s
import Foundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift -sdk %S/../Inputs/objc-generics-sdk -I %S/../Inputs/objc-generics-sdk/swift-modules -enable-source-import -parse -parse-as-library -verify -target x86_64-apple-macosx10.9 %s
// RUN: %target-swift-frontend -sdk %S/../Inputs/objc-generics-sdk -I %S/../Inputs/objc-generics-sdk/swift-modules -enable-source-import -parse -parse-as-library -verify %s
// REQUIRES: objc_generics

View File

@@ -1,14 +1,7 @@
// RUN: not %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 %s -debug-constraints 2> %t.out
// RUN: FileCheck %s < %t.out
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import ObjectiveC
func instanceMethod(b: B) {
// CHECK: found solution
// CHECK: found solution
// CHECK: found solution
// CHECK: found solution
// CHECK: found solution
// FIXME: improve this diagnostic
b.method(1, 2.5)
b.method(1, 2.5) // expected-error {{cannot invoke 'method' with an argument list of type '(Int, Double)'}}
}

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import AppKit
import NotificationCenter

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import Foundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 -I %S/Inputs/custom-modules -enable-objc-implicit-properties %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse -I %S/Inputs/custom-modules -enable-objc-implicit-properties %s -verify
import ObjectiveC
import ObjCImplicitProperties

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import AppKit

View File

@@ -1,4 +1,7 @@
// RUN: %swift %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules %s -verify
// REQUIRES: OS=macosx
// FIXME: <rdar://problem/19452886> test/ClangModules/objc_init.swift should not require REQUIRES: OS=macosx
import AppKit
import objc_ext

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
// Note: this is in a separate file because -verify doesn't complain
// about diagnostics from other files.

View File

@@ -1,4 +1,6 @@
// RUN: %swift %clang-importer-sdk -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 -emit-ir -o - -primary-file %s | FileCheck %s
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s | FileCheck %s
// REQUIRES: OS=macosx
// CHECK: [[B:%CSo1B]] = type

View File

@@ -1,6 +1,6 @@
// RUN: %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
// -- Check that we can successfully round-trip.
// RUN: %swift %clang-importer-sdk -emit-ir -target x86_64-apple-macosx10.9 %s >/dev/null
// RUN: %target-swift-frontend %clang-importer-sdk -emit-ir %s >/dev/null
import Foundation
import user_objc

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
import Foundation

View File

@@ -1,6 +1,6 @@
// RUN: %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse %s -verify
// -- Check that we can successfully round-trip.
// RUN: %swift %clang-importer-sdk -emit-ir -target x86_64-apple-macosx10.9 %s >/dev/null
// RUN: %target-swift-frontend %clang-importer-sdk -emit-ir %s >/dev/null
import Foundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -I %S/Inputs/custom-modules -parse -parse-as-library -verify -target x86_64-apple-macosx10.9 %s %S/Inputs/objc_nsmanaged_other.swift
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/Inputs/custom-modules -parse -parse-as-library -verify %s %S/Inputs/objc_nsmanaged_other.swift
import CoreData

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules %s -verify
import Foundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules %s -verify
import AppKit
import AVFoundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 -split-objc-selectors %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -emit-sil -I %S/Inputs/custom-modules -split-objc-selectors %s -verify
import AppKit
import objc_ext

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -target x86_64-apple-macosx10.9 -I %S/Inputs/custom-modules %s -verify
// RUN: %target-swift-frontend %clang-importer-sdk -parse -I %S/Inputs/custom-modules %s -verify
import AppKit

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -I %S/Inputs/custom-modules -target x86_64-apple-macosx10.9 -emit-silgen -o - %s | FileCheck %s
// RUN: %target-swift-frontend %clang-importer-sdk -I %S/Inputs/custom-modules -emit-silgen -o - %s | FileCheck %s
import ObjectiveC
import Foundation

View File

@@ -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 -disable-objc-attr-requires-foundation-module
import ObjectiveC

View File

@@ -1,4 +1,4 @@
// RUN: %swift %clang-importer-sdk -parse -verify -I %S/Inputs/custom-modules %s
// RUN: %target-swift-frontend %clang-importer-sdk -parse -verify -I %S/Inputs/custom-modules %s
import script // Clang module

View File

@@ -1,9 +1,9 @@
// RUN: rm -rf %t
// RUN: %target-build-swift -parse %s
// RUN: %target-swift-frontend -parse %s
// RUN: %target-build-swift -parse %S/Inputs/sdk-protocol-class/os1.swift
// RUN: %target-build-swift -parse %S/Inputs/sdk-protocol-class/os2.swift
// RUN: %target-build-swift -parse %S/Inputs/sdk-protocol-class/os3.swift
// RUN: %target-swift-frontend -parse %S/Inputs/sdk-protocol-class/os1.swift
// RUN: %target-swift-frontend -parse %S/Inputs/sdk-protocol-class/os2.swift
// RUN: %target-swift-frontend -parse %S/Inputs/sdk-protocol-class/os3.swift
// REQUIRES: sdk

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -parse -verify %s
// RUN: %target-swift-frontend -parse -verify %s
import Foundation

View File

@@ -1,7 +1,7 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %swift -emit-module-path %t/SerializationHelper.swiftmodule -I %S/Inputs/custom-modules %S/Inputs/SerializationHelper.swift
// RUN: %swift -parse -I %t -I %S/Inputs/custom-modules %s -verify
// RUN: %target-swift-frontend -emit-module-path %t/SerializationHelper.swiftmodule -I %S/Inputs/custom-modules %S/Inputs/SerializationHelper.swift
// RUN: %target-swift-frontend -parse -I %t -I %S/Inputs/custom-modules %s -verify
import SerializationHelper

View File

@@ -1,3 +1,3 @@
// RUN: %swift -parse -parse-as-library -verify -target x86_64-apple-macosx10.9 %clang-importer-sdk %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// RUN: %swift -parse -parse-as-library -verify -target x86_64-apple-macosx10.9 %clang-importer-sdk %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift
// RUN: %target-swift-frontend -parse -parse-as-library -verify %clang-importer-sdk %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// RUN: %target-swift-frontend -parse -parse-as-library -verify %clang-importer-sdk %S/../Inputs/clang-importer-sdk/swift-modules/ObjectiveC.swift

View File

@@ -1,4 +1,9 @@
// RUN: %swift %clang-importer-sdk -parse -verify %s
// RUN: %target-swift-frontend -parse -verify %s
// REQUIRES: OS=ios
// FIXME: this test could use the %clang-importer-sdk, but swift tries to
// deserialize the real UIKit module and match it up with the mock SDK, and
// crashes. Another reason to stop using source imports.
import UIKit

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
struct IntList : ArrayLiteralConvertible {
typealias Element = Int

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
struct X { }
struct Y { }

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift
protocol P : CollectionType {
init()

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
protocol Runcible {
typealias Runcee

View File

@@ -1,5 +1,4 @@
// RUN: rm -rf %t && mkdir %t
// RUN: %target-swift-frontend %s -parse -verify
// RUN: %target-parse-verify-swift
import Foundation

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
class B {
init() {}

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
class A { }
class B : A { }

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
func myMap<T1, T2>(array: [T1], fn: (T1) -> T2) -> [T2] {}

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift
// Basic support for Bool
func simpleIf(b: Bool) {

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
struct X {
var i : Int, j : Int

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse -verify %s
// RUN: %target-parse-verify-swift
func acceptInt(inout _ : Int) {}
func acceptDouble(inout _ : Double) {}

View File

@@ -1,4 +1,4 @@
// RUN: %swift -parse %s -verify
// RUN: %target-parse-verify-swift
func f0(i: Int, d: Double) {} // expected-note{{found this candidate}}
func f0(d: Double, i: Int) {} // expected-note{{found this candidate}}

Some files were not shown because too many files have changed in this diff Show More