Skip to content

Commit

Permalink
SILGen: enable additional tests globally
Browse files Browse the repository at this point in the history
Enable a number of SILGen tests to run on all targets.  This improves
coverage on non-Darwin targets.
  • Loading branch information
compnerd committed Jun 11, 2018
1 parent a330db6 commit 8b21fde
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 83 deletions.
1 change: 1 addition & 0 deletions test/IDE/print_clang_decls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@

// FOUNDATION-LABEL: {{^}}/// Aaa. NSArray. Bbb.{{$}}
// FOUNDATION-NEXT: {{^}}class NSArray : NSObject {{{$}}
// FOUNDATION-NEXT: init!(objects: UnsafePointer<AnyObject>?, count cnt: Int)
// FOUNDATION-NEXT: subscript(idx: Int) -> Any { get }

// FOUNDATION-LABEL: {{^}}/// Aaa. NSRuncingMode. Bbb.{{$}}
Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/c_materializeForSet_linkage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import AppKit

Expand Down
5 changes: 1 addition & 4 deletions test/SILGen/cf.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

// RUN: %target-swift-emit-silgen -module-name cf -import-cf-types -sdk %S/Inputs %s -o - | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -module-name cf -enable-objc-interop -import-cf-types -sdk %S/Inputs %s -o - | %FileCheck %s

import CoreCooling

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/cf_members.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -enable-sil-ownership -I %S/../IDE/Inputs/custom-modules %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-sil-ownership -I %S/../IDE/Inputs/custom-modules %s -enable-objc-interop -I %S/Inputs/usr/include | %FileCheck %s

import ImportAsMember

Expand Down
7 changes: 2 additions & 5 deletions test/SILGen/dynamic_lookup.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

// RUN: %target-swift-emit-silgen -module-name dynamic_lookup -parse-as-library -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
// RUN: %target-swift-emit-silgen -module-name dynamic_lookup -parse-as-library -disable-objc-attr-requires-foundation-module %s | %FileCheck %s --check-prefix=GUARANTEED

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -module-name dynamic_lookup -enable-objc-interop -parse-as-library -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
// RUN: %target-swift-emit-silgen -module-name dynamic_lookup -enable-objc-interop -parse-as-library -disable-objc-attr-requires-foundation-module %s | %FileCheck %s --check-prefix=GUARANTEED

class X {
@objc func f() { }
Expand Down
5 changes: 1 addition & 4 deletions test/SILGen/external_definitions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import ansible

Expand Down
5 changes: 1 addition & 4 deletions test/SILGen/function_conversion_objc.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

// RUN: %target-swift-emit-silgen -module-name function_conversion_objc -sdk %S/Inputs %s -I %S/Inputs -enable-sil-ownership -enable-source-import -verify | %FileCheck %s
// RUN: %target-swift-emit-silgen -module-name function_conversion_objc -sdk %S/Inputs %s -I %S/Inputs -enable-sil-ownership -enable-source-import -enable-objc-interop -verify | %FileCheck %s

import Foundation

// REQUIRES: objc_interop

// ==== Metatype to object conversions

// CHECK-LABEL: sil hidden @$S24function_conversion_objc20convMetatypeToObjectyySo8NSObjectCmADcF
Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/generic_objc_block_bridge.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop | %FileCheck %s

import Foundation

Expand Down
3 changes: 1 addition & 2 deletions test/SILGen/import_as_member_cf.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %target-swift-emit-silgen -enable-sil-ownership -I %S/../IDE/Inputs/custom-modules %s 2>&1 | %FileCheck --check-prefix=SIL %s
// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-sil-ownership -I %S/../IDE/Inputs/custom-modules %s -enable-objc-interop -sdk %S/Inputs 2>&1 | %FileCheck --check-prefix=SIL %s

import ImportAsMember.C

Expand Down
6 changes: 3 additions & 3 deletions test/SILGen/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
config.substitutions = list(config.substitutions)

config.substitutions.insert(0, ('%build-silgen-test-overlays',
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -o %t %S/Inputs/ObjectiveC.swift && '
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -o %t %S/Inputs/Dispatch.swift && '
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -o %t %S/Inputs/Foundation.swift'))
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -enable-objc-interop -o %t %S/Inputs/ObjectiveC.swift && '
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -enable-objc-interop -o %t %S/Inputs/Dispatch.swift && '
'%target-swift-frontend(mock-sdk: -sdk %S/Inputs -I %t) -emit-module -enable-objc-interop -o %t %S/Inputs/Foundation.swift'))
3 changes: 1 addition & 2 deletions test/SILGen/lying_about_optional_return_objc.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/block_property_in_objc_class.h -enable-sil-ownership %s | %FileCheck %s
// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) -enable-objc-interop -import-objc-header %S/Inputs/block_property_in_objc_class.h -enable-sil-ownership %s | %FileCheck %s

// CHECK-LABEL: sil hidden @$S32lying_about_optional_return_objc0C37ChainingForeignFunctionTypeProperties{{[_0-9a-zA-Z]*}}F
func optionalChainingForeignFunctionTypeProperties(b: BlockProperty?) {
Expand Down
5 changes: 4 additions & 1 deletion test/SILGen/metatype_in_init_delegation.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: %target-swift-emit-silgen -verify %s
// RUN: %empty-directory(%t)
// RUN: %build-silgen-test-overlays
// RUN: %target-swift-emit-silgen(mock-sdk: -sdk %S/Inputs -I %t) -verify %s -sdk %S/Inputs -enable-objc-interop

// REQUIRES: objc_interop

import Foundation
Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/metatype_object_conversion.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import -enable-objc-interop %s | %FileCheck %s

import Foundation

Expand Down
4 changes: 2 additions & 2 deletions test/SILGen/objc_bridged_block_optionality_diff.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) %s -import-objc-header %S/Inputs/objc_bridged_block_optionality_diff.h -verify
// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) -enable-objc-interop -import-objc-header %S/Inputs/objc_bridged_block_optionality_diff.h -verify %s

import Foundation

TheHandlerBlock = { x in () }
Expand Down
3 changes: 1 addition & 2 deletions test/SILGen/objc_bridged_generic_conformance.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) %s -import-objc-header %S/Inputs/objc_bridged_generic_conformance.h -verify -enable-sil-ownership
// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen(mock-sdk: %clang-importer-sdk) %s -enable-objc-interop -import-objc-header %S/Inputs/objc_bridged_generic_conformance.h -verify -enable-sil-ownership

protocol P { func test() }

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_dealloc.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
7 changes: 2 additions & 5 deletions test/SILGen/objc_deprecated_objc_thunks.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -I %S/Inputs -enable-source-import -enable-swift3-objc-inference -swift-version 4 -enable-sil-ownership | %FileCheck -check-prefix CHECK-SWIFT4 %s

// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -enable-sil-ownership -I %S/Inputs -enable-source-import -swift-version 3 | %FileCheck -check-prefix CHECK-SWIFT3 %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -I %S/Inputs -enable-source-import -enable-swift3-objc-inference -swift-version 4 -enable-sil-ownership -enable-objc-interop | %FileCheck -check-prefix CHECK-SWIFT4 %s
// RUN: %target-swift-emit-silgen -sdk %S/Inputs %s -enable-sil-ownership -I %S/Inputs -enable-source-import -swift-version 3 -enable-objc-interop | %FileCheck -check-prefix CHECK-SWIFT3 %s

import Foundation

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_enum_unused_witnesses.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_imported_init.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -verify -sdk %S/Inputs -I %S/Inputs -enable-source-import -enable-sil-ownership %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -verify -sdk %S/Inputs -I %S/Inputs -enable-source-import -enable-sil-ownership %s -enable-objc-interop | %FileCheck %s

import Foundation

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_init_ref_delegation.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_metatypes.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -disable-objc-attr-requires-foundation-module -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -disable-objc-attr-requires-foundation-module -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
5 changes: 1 addition & 4 deletions test/SILGen/objc_ownership_conventions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

// RUN: %target-swift-emit-silgen -module-name objc_ownership_conventions -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -module-name objc_ownership_conventions -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-sil-ownership -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_selector.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-sil -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-sil -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop | %FileCheck %s

import ObjectiveC
import Foundation
Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_subscript.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -enable-sil-ownership %s -emit-verbose-sil -disable-objc-attr-requires-foundation-module | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-sil-ownership %s -emit-verbose-sil -enable-objc-interop -disable-objc-attr-requires-foundation-module | %FileCheck %s

@objc class ObjCClass {}

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/objc_super.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-sil-ownership -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop | %FileCheck %s

import gizmo

Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/protocol_cast_toplevel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen %s -disable-objc-attr-requires-foundation-module -enable-sil-ownership

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen %s -enable-objc-interop -disable-objc-attr-requires-foundation-module -enable-sil-ownership

@objc protocol Unrelated {}

Expand Down
3 changes: 1 addition & 2 deletions test/SILGen/protocol_resilience_objc.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %target-swift-emit-silgen -disable-objc-attr-requires-foundation-module -enable-sil-ownership -enable-resilience %s | %FileCheck %s --check-prefix=CHECK
// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -enable-objc-interop -disable-objc-attr-requires-foundation-module -enable-sil-ownership -enable-resilience %s | %FileCheck %s --check-prefix=CHECK

// @objc protocols don't need default witness tables
@objc public protocol ObjCProtocol {
Expand Down
4 changes: 1 addition & 3 deletions test/SILGen/super_objc_class_method.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s

// REQUIRES: objc_interop
// RUN: %target-swift-emit-silgen -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -enable-objc-interop | %FileCheck %s

import Foundation
class MyFunkyDictionary: NSDictionary {
Expand Down
4 changes: 3 additions & 1 deletion test/SILGen/without_actually_escaping_block.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// RUN: %target-swift-emit-silgen -module-name without_actually_escaping -enable-sil-ownership %s | %FileCheck %s
// RUN: %empty-directory(%t)
// RUN: %build-silgen-test-overlays
// RUN: %target-swift-emit-silgen(mock-sdk: -sdk %S/Inputs -I %t) -module-name without_actually_escaping -enable-sil-ownership %s -sdk %S/Inputs -enable-objc-interop | %FileCheck %s

// REQUIRES: objc_interop

Expand Down

0 comments on commit 8b21fde

Please sign in to comment.