mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[NamedLazyMemberLoading] Add testcase for categories.
This commit is contained in:
@@ -51,6 +51,28 @@
|
||||
@end
|
||||
|
||||
|
||||
// Don't conform to the protocol; that loads all protocol members.
|
||||
@interface SimpleDoer (Category)
|
||||
- (void)categoricallyDoSomeWork;
|
||||
- (void)categoricallyDoSomeWorkWithSpeed:(int)s;
|
||||
- (void)categoricallyDoSomeWorkWithSpeed:(int)s thoroughness:(int)t
|
||||
NS_SWIFT_NAME(categoricallyDoVeryImportantWork(speed:thoroughness:));
|
||||
- (void)categoricallyDoSomeWorkWithSpeed:(int)s alacrity:(int)a
|
||||
NS_SWIFT_NAME(categoricallyDoSomeWorkWithSpeed(speed:levelOfAlacrity:));
|
||||
|
||||
// These we are generally trying to not-import, via laziness.
|
||||
- (void)categoricallyGoForWalk;
|
||||
- (void)categoricallyTakeNap;
|
||||
- (void)categoricallyEatMeal;
|
||||
- (void)categoricallyTidyHome;
|
||||
- (void)categoricallyCallFamily;
|
||||
- (void)categoricallySingSong;
|
||||
- (void)categoricallyReadBook;
|
||||
- (void)categoricallyAttendLecture;
|
||||
- (void)categoricallyWriteLetter;
|
||||
@end
|
||||
|
||||
|
||||
@protocol MirroredBase
|
||||
+ (void)mirroredBaseClassMethod;
|
||||
- (void)mirroredBaseInstanceMethod;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// REQUIRES: objc_interop
|
||||
// REQUIRES: OS=macosx
|
||||
// RUN: rm -rf %t && mkdir -p %t/stats-pre && mkdir -p %t/stats-post
|
||||
//
|
||||
// Prime module cache
|
||||
// RUN: %target-swift-frontend -typecheck -I %S/Inputs/NamedLazyMembers -typecheck %s
|
||||
//
|
||||
// Check that named-lazy-member-loading reduces the number of Decls deserialized
|
||||
// RUN: %target-swift-frontend -typecheck -I %S/Inputs/NamedLazyMembers -disable-named-lazy-member-loading -stats-output-dir %t/stats-pre %s
|
||||
// RUN: %target-swift-frontend -typecheck -I %S/Inputs/NamedLazyMembers -stats-output-dir %t/stats-post %s
|
||||
// RUN: %utils/process-stats-dir.py --evaluate-delta 'NumTotalClangImportedEntities < -10' %t/stats-pre %t/stats-post
|
||||
|
||||
import NamedLazyMembers
|
||||
|
||||
public func foo(d: SimpleDoer) {
|
||||
let _ = d.categoricallyDoSomeWork()
|
||||
let _ = d.categoricallyDoSomeWork(withSpeed:10)
|
||||
let _ = d.categoricallyDoVeryImportantWork(speed:10, thoroughness:12)
|
||||
let _ = d.categoricallyDoSomeWorkWithSpeed(speed:10, levelOfAlacrity:12)
|
||||
}
|
||||
Reference in New Issue
Block a user