Skip to content

Commit 83ed2dc

Browse files
committed
ModuleInterface: Adopt swiftinterface verification lit substitutions in skip-override-keyword.swift and skip-override-spi.swift. Add CHECK lines to these tests to make their expectations a bit more explicit.
1 parent 454689a commit 83ed2dc

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -typecheck -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface %s
3-
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.swiftinterface -o %t/Foo.swiftmodule
2+
// RUN: %target-swift-emit-module-interface(%t/Foo.swiftinterface) %s -module-name Foo
3+
// RUN: %target-swift-typecheck-module-from-interface(%t/Foo.swiftinterface) -module-name Foo
4+
// RUN: %FileCheck %s < %t/Foo.swiftinterface
45

5-
// RUN: %target-swift-frontend -typecheck -enable-testing -module-name FooWithTesting -emit-module-interface-path %t/FooWithTesting.swiftinterface %s
6-
// RUN: %target-swift-frontend -compile-module-from-interface %t/FooWithTesting.swiftinterface -o %t/FooWithTesting.swiftmodule
6+
// RUN: %target-swift-emit-module-interface(%t/FooWithTesting.swiftinterface) %s -module-name FooWithTesting -enable-testing
7+
// RUN: %target-swift-typecheck-module-from-interface(%t/FooWithTesting.swiftinterface) -module-name FooWithTesting
8+
// RUN: %FileCheck %s < %t/FooWithTesting.swiftinterface
79

10+
// CHECK: @_hasMissingDesignatedInitializers public class BaseClass
811
public class BaseClass {
912
init() { }
1013
var property: Int { return 1 }
1114
func doSomething() { }
1215
subscript(index: Int) -> Int { get { return 0 } set(newValue) {} }
16+
// CHECK: @usableFromInline
17+
// CHECK-NEXT: internal func doSomethingInline()
1318
@usableFromInline func doSomethingInline() {}
19+
// CHECK: @usableFromInline
20+
// CHECK-NEXT: internal func doSomethingUsableFromInline()
1421
@usableFromInline func doSomethingUsableFromInline() {}
1522
}
1623

24+
// CHECK: @_inheritsConvenienceInitializers public class DerivedClass : {{Foo|FooWithTesting}}.BaseClass
1725
public class DerivedClass: BaseClass {
26+
// CHECK: public init()
1827
public override init() { super.init() }
28+
// CHECK: public var property: Swift.Int
1929
public override var property : Int { return 0 }
30+
// CHECK: public func doSomething()
2031
public override func doSomething() { }
32+
// CHECK: public subscript(index: Swift.Int) -> Swift.Int
2133
public override subscript(index: Int) -> Int { get {return 0} set(newValue) {} }
34+
// CHECK: @inlinable override public func doSomethingInline() { super.doSomethingInline() }
2235
@inlinable public override func doSomethingInline() { super.doSomethingInline() }
36+
// CHECK: @usableFromInline
37+
// CHECK-NEXT: override internal func doSomethingUsableFromInline()
2338
@usableFromInline override func doSomethingUsableFromInline() { super.doSomethingUsableFromInline() }
2439
}
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %empty-directory(%t/inputs)
3-
// RUN: %empty-directory(%t/modulecache)
4-
// RUN: echo "public class HideyHole { @_spi(Private) public init() {} }" > %t/Foo.swift
5-
// RUN: echo "public class StashyCache: HideyHole {}" >> %t/Foo.swift
2+
// RUN: %target-swift-emit-module-interface(%t/Foo.swiftinterface) %s -module-name Foo
3+
// RUN: %target-swift-typecheck-module-from-interface(%t/Foo.swiftinterface) -module-name Foo
4+
// RUN: %FileCheck %s < %t/Foo.swiftinterface
65

7-
// RUN: %target-swift-frontend -emit-module -emit-module-interface-path %t/inputs/Foo.swiftinterface %t/Foo.swift -module-name Foo
6+
// CHECK: public class HideyHole
7+
public class HideyHole {
8+
// CHECK-NOT: public init()
9+
@_spi(Private) public init() {}
10+
}
811

9-
// RUN: %target-swift-frontend -emit-module-path %t/Bar.swiftmodule -enable-library-evolution -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name Bar %s -I %t/inputs -disable-availability-checking -module-cache-path %t/modulecache
10-
11-
import Foo
12+
// CHECK: @_inheritsConvenienceInitializers public class StashyCache : Foo.HideyHole
13+
public class StashyCache: HideyHole {
14+
// CHECK: public init()
15+
}

0 commit comments

Comments
 (0)