Skip to content

Commit a67f3b9

Browse files
Merge pull request #23452 from aschwaighofer/add_test_optimize_none_implicit_dynamic
Add a test mode to exercise implicit dynamic
2 parents a169a95 + ddcfb10 commit a67f3b9

File tree

114 files changed

+370
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+370
-13
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ set(profdata_merge_worker
135135

136136
set(TEST_MODES
137137
optimize_none optimize optimize_unchecked optimize_size
138+
optimize_none_with_implicit_dynamic
138139
only_executable only_non_executable
139140
)
140141
set(TEST_SUBSETS

test/IRGen/report_dead_method_call.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// RUN: %target-run %t/report_dead_method_call
1212
// REQUIRES: executable_test
1313

14+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
15+
1416
private protocol PrivateProto {
1517
func abc()
1618
}

test/Interpreter/SDK/mapkit_header_static.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// REQUIRES: objc_interop
55
// UNSUPPORTED: OS=tvos
66

7+
// Requires swift-version 4
8+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
9+
710
import MapKit
811

912
let rect = MKMapRectMake(1.0, 2.0, 3.0, 4.0)

test/Interpreter/SDK/mixed_mode_class_with_missing_properties.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// REQUIRES: objc_interop
1212
// REQUIRES: executable_test
1313

14+
// Requires swift-version 4
15+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
16+
1417
import UsingObjCStuff
1518

1619
print("Let's go") // CHECK: Let's go

test/Interpreter/SDK/objc_factory_method.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// REQUIRES: executable_test
55
// REQUIRES: OS=macosx
66

7+
// Requires swift-version 4
8+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
9+
710
import AppKit
811

912
let image = NSImage(named: NSImage.Name.trashEmpty)

test/Interpreter/SDK/objc_swift3_deprecated_objc_inference.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
// REQUIRES: executable_test
1616
// REQUIRES: objc_interop
1717

18+
// Requires explicit swift-version 4.
19+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
20+
1821
import StdlibUnittest
1922
import Foundation
2023

2124
var DeprecatedObjCInferenceTestSuite = TestSuite("DeprecatedObjCInferenceTestSuite")
2225

2326
class MyClass : NSObject {
2427
// The line numbers of the next two methods are mentioned in the CHECK lines
25-
// below. Please keep them as 26 and 27.
28+
// below. Please keep them as 29 and 30.
2629
func foo() { }
2730
class func bar() { }
2831
}
@@ -42,15 +45,15 @@ DeprecatedObjCInferenceTestSuite.test("messagingObjCInference") {
4245
// CHECK_CRASH: ---Begin
4346
fputs("---Begin\n", stderr)
4447

45-
// CHECK_WARNINGS: .swift:26:3: implicit Objective-C entrypoint -[a.MyClass foo]
46-
// CHECK_CRASH: .swift:26:3: implicit Objective-C entrypoint -[a.MyClass foo]
48+
// CHECK_WARNINGS: .swift:29:3: implicit Objective-C entrypoint -[a.MyClass foo]
49+
// CHECK_CRASH: .swift:29:3: implicit Objective-C entrypoint -[a.MyClass foo]
4750
x.perform(Selector(fooSel))
48-
// CHECK_WARNINGS-NOT: .swift:26:3: implicit Objective-C entrypoint -[a.MyClass foo]
51+
// CHECK_WARNINGS-NOT: .swift:29:3: implicit Objective-C entrypoint -[a.MyClass foo]
4952
x.perform(Selector(fooSel))
5053

51-
// CHECK_WARNINGS: .swift:27:3: implicit Objective-C entrypoint +[a.MyClass bar]
54+
// CHECK_WARNINGS: .swift:30:3: implicit Objective-C entrypoint +[a.MyClass bar]
5255
type(of: x).perform(Selector(barSel))
53-
// CHECK_WARNINGS-NOT: .swift:27:3: implicit Objective-C entrypoint +[a.MyClass bar]
56+
// CHECK_WARNINGS-NOT: .swift:30:3: implicit Objective-C entrypoint +[a.MyClass bar]
5457
type(of: x).perform(Selector(barSel))
5558

5659
// CHECK_NOTHING-NEXT: ---End

test/Interpreter/SDK/object_literals.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// REQUIRES: executable_test
88
// REQUIRES: OS=macosx
99

10+
// Requires swift-version 4
11+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
12+
1013
import AppKit
1114
import StdlibUnittest
1215

test/Interpreter/dynamicReplacement_property_observer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
// REQUIRES: executable_test
99

10+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
11+
1012
@_private(sourceFile: "dynamic_replacement_property_observer_orig.swift") import TestDidWillSet
1113

1214
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)

test/Interpreter/dynamic_cast_optionals_to_nsobject.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// REQUIRES: executable_test
33
// REQUIRES: objc_interop
44

5+
// Requires swift-version 4.
6+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
7+
58
import Foundation
69

710
// rdar://problem/36477954

test/Interpreter/dynamic_replacement_chaining.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
// REQUIRES: executable_test
2020

21+
// This test flips the chaining flag.
22+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
23+
2124
import A
2225

2326
import StdlibUnittest

test/Interpreter/enforce_exclusive_access.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// RUN: %target-run %t/a.out
66
// REQUIRES: executable_test
77

8+
// Requires explicit swift-version 4.
9+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
10+
811
// Tests for traps at run time when enforcing exclusive access.
912

1013
import StdlibUnittest

test/Interpreter/fractal.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// REQUIRES: executable_test
99
// REQUIRES: swift_interpreter
1010

11+
// JIT runs in swift-version 4
12+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
13+
1114
import complex
1215

1316
func printDensity(_ d: Int) {

test/Interpreter/mandelbrot.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// REQUIRES: executable_test
99
// REQUIRES: swift_interpreter
1010

11+
// JIT runs in swift-version 4
12+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
13+
1114
import complex
1215

1316
func printDensity(_ d: Int) {

test/Interpreter/synthesized_extension_conformances.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
// REQUIRES: executable_test
77
// REQUIRES: objc_interop
88

9+
// Requires explicit swift-version 4.
10+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
11+
912
import Foundation
1013

1114
#if FOUNDATION_XCTEST

test/Profiler/pgo_foreach.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// REQUIRES: executable_test
2020
// REQUIRES: OS=macosx
2121

22+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
23+
2224
// SIL-LABEL: // pgo_foreach.guessForEach1
2325
// SIL-LABEL: sil @$s11pgo_foreach13guessForEach11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(42) {
2426
// IR-LABEL: define swiftcc i32 @$s9pgo_foreach10guessWhiles5Int32VAD1x_tF

test/Prototypes/BigInt.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// REQUIRES: executable_test
1717
// REQUIRES: CPU=x86_64
1818

19+
// Requires swift-version 4
20+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
1921
import StdlibUnittest
2022
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
2123
import Darwin

test/lit.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,14 @@ if swift_test_mode == 'optimize_none':
497497
# optimize mode for a cpu.
498498
config.available_features.add("swift_test_mode_optimize_none_" + run_cpu)
499499
swift_execution_tests_extra_flags = ''
500+
elif swift_test_mode == 'optimize_none_with_implicit_dynamic':
501+
config.available_features.add("executable_test")
502+
config.limit_to_features.add("executable_test")
503+
config.available_features.add("swift_test_mode_optimize_none_with_implicit_dynamic")
504+
# Add the cpu as a feature so we can selectively disable tests in an
505+
# optimize mode for a cpu.
506+
config.available_features.add("swift_test_mode_optimize_none_" + run_cpu)
507+
swift_execution_tests_extra_flags = '-Xfrontend -enable-implicit-dynamic -Xfrontend -enable-private-imports -Xfrontend -enable-dynamic-replacement-chaining -swift-version 5'
500508
elif swift_test_mode == 'optimize':
501509
config.available_features.add("executable_test")
502510
config.limit_to_features.add("executable_test")

test/stdlib/AVFoundation_Swift4.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// CoreMedia is not present on watchOS.
88
// UNSUPPORTED: OS=watchos
99

10+
// Requires swift-version 5
11+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
12+
1013
import AVFoundation
1114
import StdlibUnittest
1215

test/stdlib/ArrayBridge.swift.gyb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
// REQUIRES: executable_test
2222
// REQUIRES: objc_interop
2323

24+
// Requires swift-version 4
25+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
26+
2427
import Foundation
2528
import ArrayBridgeObjC
2629
import StdlibUnittest

test/stdlib/Filter.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// RUN: %target-run-simple-swift
1313
// REQUIRES: executable_test
1414

15+
// Requires swift-version 4
16+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
17+
1518
import StdlibUnittest
1619

1720

test/stdlib/Inputs/KeyPathMultiFile_b.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ struct A {
1111
}
1212

1313
func A_x_keypath() -> WritableKeyPath<A, Int> {
14-
return \A.x
14+
return \A.x as! WritableKeyPath<A, Int>
1515
}
1616

1717
func A_subscript_0_keypath() -> WritableKeyPath<A, Int> {
18-
return \A.[0]
18+
return \A.[0] as! WritableKeyPath<A, Int>
1919
}

test/stdlib/Integers.swift.gyb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
// FIXME: this test runs forever on iOS arm64
1919
// REQUIRES: OS=macosx
20+
21+
// Requires swift-version 4
22+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
2023
%{
2124
word_bits = int(WORD_BITS) / 2
2225
from SwiftIntTypes import all_integer_types

test/stdlib/Map.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// RUN: %target-run-simple-swift | %FileCheck %s
1313
// REQUIRES: executable_test
1414

15+
// Requires swift-version 4
16+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
17+
1518
// Check that the generic parameters are called 'Base' and 'Element'.
1619
protocol TestProtocol1 {}
1720

test/stdlib/MapFilterLayerFoldingCompatibilty.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// RUN: %target-build-swift %s -o %t/a.out5 -swift-version 5 && %target-codesign %t/a.out5 && %target-run %t/a.out5
44
// REQUIRES: executable_test
55

6+
// Requires swift-version 4
7+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
8+
69
import StdlibUnittest
710

811
#if swift(>=5)

test/stdlib/Metal.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
// REQUIRES: executable_test
77

8+
// Requires swift-version 4
9+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
10+
811
import StdlibUnittest
912

1013
import Metal

test/stdlib/MetalKit.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
// REQUIRES: executable_test
77

8+
// Requires swift-version 4
9+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
10+
811
import StdlibUnittest
912

1013
import Metal

test/stdlib/NSStringAPI+Substring.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
// REQUIRES: objc_interop
66

7+
// Requires swift-version 4
8+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
9+
710
//
811
// Tests for the NSString APIs on Substring
912
//

test/stdlib/Reflection_objc.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// REQUIRES: executable_test
1010
// REQUIRES: objc_interop
1111

12+
// Requires swift-version 4
13+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
14+
1215
//
1316
// DO NOT add more tests to this file. Add them to test/1_stdlib/Runtime.swift.
1417
//

test/stdlib/ReverseCompatibility.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// RUN: %target-build-swift %s -o %t/a.out5 -swift-version 5 && %target-codesign %t/a.out5 && %target-run %t/a.out5
44
// REQUIRES: executable_test
55

6+
// Requires swift-version 4
7+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
8+
69
import StdlibUnittest
710

811
#if swift(>=4.2)

test/stdlib/RuntimeObjC.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
// REQUIRES: executable_test
88
// REQUIRES: objc_interop
99

10+
// Requires swift-version 4
11+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
12+
1013
import Swift
1114
import StdlibUnittest
1215

test/stdlib/StringCompatibility.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -o %t/a.out4 -swift-version 4 && %target-codesign %t/a.out4 && %target-run %t/a.out4
33

4+
// Requires swift-version 4
5+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
6+
47
// REQUIRES: executable_test
58

69
import StdlibUnittest

test/stdlib/StringFlatMap.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
// REQUIRES: executable_test
55

6+
// Needs swift-version 4.
7+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
8+
69
import StdlibUnittest
710

811

test/stdlib/TestData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
// REQUIRES: executable_test
1818
// REQUIRES: objc_interop
1919

20+
// Requires swift-version 4
21+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
22+
2023
import Foundation
2124
import Dispatch
2225
import ObjectiveC

test/stdlib/TestIndexSet.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: executable_test
1111
// REQUIRES: objc_interop
1212

13+
// Requires swift-version 4
14+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
15+
1316
import Foundation
1417

1518
#if FOUNDATION_XCTEST

test/stdlib/TestMeasurement.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// REQUIRES: executable_test
1111
// REQUIRES: objc_interop
1212

13+
// Requires swift-version 4
14+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
15+
1316
import Foundation
1417

1518
#if FOUNDATION_XCTEST

test/stdlib/UnsafePointer.swift.gyb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: %target-run-simple-swiftgyb
22
// REQUIRES: executable_test
33

4+
// Requires swift-version 4
5+
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
6+
47
import StdlibUnittest
58

69

0 commit comments

Comments
 (0)