| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Name: SomeOtherKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "methodB" | ||
| MethodKind: Instance | ||
| Availability: none | ||
| AvailabilityMsg: "anything but this" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Name: SomeBrokenLib | ||
| Functions: | ||
| - Name: do_something_with_pointers | ||
| Nu llabilityOfRet: O | ||
| # the space is intentional, to make sure we don't crash on malformed API Notes |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #ifndef SOME_BROKEN_LIB_H | ||
| #define SOME_BROKEN_LIB_H | ||
|
|
||
| void do_something_with_pointers(int *ptr1, int *ptr2); | ||
|
|
||
| #endif // SOME_BROKEN_LIB_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Name: SomeBrokenLib | ||
| Functions: | ||
| - Name: do_something_with_pointers | ||
| NullabilityOfRet: O | ||
| - Name: do_something_with_pointers | ||
| NullabilityOfRet: O | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #ifndef SOME_BROKEN_LIB_H | ||
| #define SOME_BROKEN_LIB_H | ||
|
|
||
| void do_something_with_pointers(int *ptr1, int *ptr2); | ||
|
|
||
| #endif // SOME_BROKEN_LIB_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int FrameworkWithActualPrivateModule; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module FrameworkWithActualPrivateModule { | ||
| umbrella header "FrameworkWithActualPrivateModule.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module FrameworkWithActualPrivateModule_Private { | ||
| umbrella header "FrameworkWithActualPrivateModule_Private.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Name: FrameworkWithActualPrivateModule_Private |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #include <FrameworkWithActualPrivateModule/FrameworkWithActualPrivateModule.h> | ||
| extern int FrameworkWithActualPrivateModule_Private; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int FrameworkWithWrongCase; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module FrameworkWithWrongCase { | ||
| umbrella header "FrameworkWithWrongCase.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Name: FrameworkWithWrongCase |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int FrameworkWithWrongCasePrivate; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module FrameworkWithWrongCasePrivate { | ||
| umbrella header "FrameworkWithWrongCasePrivate.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module FrameworkWithWrongCasePrivate.Inner {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Name: FrameworkWithWrongCasePrivate |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| @import LayeredKitImpl; | ||
|
|
||
| // @interface declarations already don't inherit attributes from forward | ||
| // declarations, so in order to test this properly we have to /not/ define | ||
| // UpwardClass anywhere. | ||
|
|
||
| // @interface UpwardClass | ||
| // @end | ||
|
|
||
| @protocol UpwardProto | ||
| @end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module LayeredKit { | ||
| umbrella header "LayeredKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Name: LayeredKitImpl | ||
| Classes: | ||
| - Name: PerfectlyNormalClass | ||
| Availability: none | ||
| - Name: UpwardClass | ||
| Availability: none | ||
| Protocols: | ||
| - Name: UpwardProto | ||
| Availability: none |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| @protocol UpwardProto; | ||
| @class UpwardClass; | ||
|
|
||
| @interface PerfectlyNormalClass | ||
| @end | ||
|
|
||
| void doImplementationThings(UpwardClass *first, id <UpwardProto> second) __attribute((unavailable)); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module LayeredKitImpl { | ||
| umbrella header "LayeredKitImpl.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module SimpleKit { | ||
| umbrella header "SimpleKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| Name: SomeKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "transform:" | ||
| MethodKind: Instance | ||
| Availability: none | ||
| AvailabilityMsg: "anything but this" | ||
| - Selector: "transform:integer:" | ||
| MethodKind: Instance | ||
| NullabilityOfRet: N | ||
| Nullability: [ N, S ] | ||
| Properties: | ||
| - Name: intValue | ||
| PropertyKind: Instance | ||
| Availability: none | ||
| AvailabilityMsg: "wouldn't work anyway" | ||
| - Name: nonnullAInstance | ||
| PropertyKind: Instance | ||
| Nullability: N | ||
| - Name: nonnullAClass | ||
| PropertyKind: Class | ||
| Nullability: N | ||
| - Name: nonnullABoth | ||
| Nullability: N | ||
| - Name: B | ||
| Availability: none | ||
| AvailabilityMsg: "just don't" | ||
| - Name: C | ||
| Methods: | ||
| - Selector: "initWithA:" | ||
| MethodKind: Instance | ||
| DesignatedInit: true | ||
| - Name: OverriddenTypes | ||
| Methods: | ||
| - Selector: "methodToMangle:second:" | ||
| MethodKind: Instance | ||
| ResultType: 'char *' | ||
| Parameters: | ||
| - Position: 0 | ||
| Type: 'SOMEKIT_DOUBLE *' | ||
| - Position: 1 | ||
| Type: 'float *' | ||
| Properties: | ||
| - Name: intPropertyToMangle | ||
| PropertyKind: Instance | ||
| Type: 'double *' | ||
| Functions: | ||
| - Name: global_int_fun | ||
| ResultType: 'char *' | ||
| Parameters: | ||
| - Position: 0 | ||
| Type: 'double *' | ||
| - Position: 1 | ||
| Type: 'float *' | ||
| Globals: | ||
| - Name: global_int_ptr | ||
| Type: 'double *' | ||
| SwiftVersions: | ||
| - Version: 3.0 | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "transform:integer:" | ||
| MethodKind: Instance | ||
| NullabilityOfRet: O | ||
| Nullability: [ O, S ] | ||
| Properties: | ||
| - Name: explicitNonnullInstance | ||
| PropertyKind: Instance | ||
| Nullability: O | ||
| - Name: explicitNullableInstance | ||
| PropertyKind: Instance | ||
| Nullability: N |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Name: SomeKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "privateTransform:input:" | ||
| MethodKind: Instance | ||
| NullabilityOfRet: N | ||
| Nullability: [ N, S ] | ||
| Properties: | ||
| - Name: internalProperty | ||
| Nullability: N | ||
| Protocols: | ||
| - Name: InternalProtocol | ||
| Availability: none | ||
| AvailabilityMsg: "not for you" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #ifndef SOMEKIT_H | ||
| #define SOMEKIT_H | ||
|
|
||
| #define ROOT_CLASS __attribute__((objc_root_class)) | ||
|
|
||
| ROOT_CLASS | ||
| @interface A | ||
| -(A*)transform:(A*)input; | ||
| -(A*)transform:(A*)input integer:(int)integer; | ||
|
|
||
| @property (nonatomic, readonly, retain) A* someA; | ||
| @property (nonatomic, retain) A* someOtherA; | ||
|
|
||
| @property (nonatomic) int intValue; | ||
| @end | ||
|
|
||
| @interface B : A | ||
| @end | ||
|
|
||
| @interface C : A | ||
| - (instancetype)init; | ||
| - (instancetype)initWithA:(A*)a; | ||
| @end | ||
|
|
||
|
|
||
| @interface MyClass : A | ||
| - Inst; | ||
| + Clas; | ||
| @end | ||
|
|
||
| struct CGRect { | ||
| float origin; | ||
| float size; | ||
| }; | ||
| typedef struct CGRect NSRect; | ||
|
|
||
| @interface I | ||
| - (void) Meth : (NSRect[4])exposedRects; | ||
| - (void) Meth1 : (const I*)exposedRects; | ||
| - (void) Meth2 : (const I*)exposedRects; | ||
| - (void) Meth3 : (I*)exposedRects; | ||
| - (const I*) Meth4; | ||
| - (const I*) Meth5 : (int) Arg1 : (const I*)Arg2 : (double)Arg3 : (const I*) Arg4 :(const volatile id) Arg5; | ||
| - (volatile const I*) Meth6 : (const char *)Arg1 : (const char *)Arg2 : (double)Arg3 : (const I*) Arg4 :(const volatile id) Arg5; | ||
| @end | ||
|
|
||
| @class NSURL, NSArray, NSError; | ||
| @interface INTF_BLOCKS | ||
| + (void)getNonLocalVersionsOfItemAtURL:(NSURL *)url completionHandler:(void (^)(NSArray *nonLocalFileVersions, NSError *error))completionHandler; | ||
| + (void *)getNonLocalVersionsOfItemAtURL2:(NSURL *)url completionHandler:(void (^)(NSArray *nonLocalFileVersions, NSError *error))completionHandler; | ||
| + (NSError **)getNonLocalVersionsOfItemAtURL3:(int)url completionHandler:(void (^)(NSArray *nonLocalFileVersions, NSError *error))completionHandler; | ||
| + (id)getNonLocalVersionsOfItemAtURL4:(NSURL *)url completionHandler:(void (^)(int nonLocalFileVersions, NSError *error, NSURL*))completionHandler; | ||
| @end | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module SomeKit { | ||
| umbrella header "SomeKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| module SomeKit.Private { | ||
| header "SomeKit_Private.h" | ||
| export * | ||
|
|
||
| explicit module NullAnnotation { | ||
| header "SomeKit_PrivateForNullAnnotation.h" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| explicit framework module SomeKit.Private { | ||
| header "SomeKit_Private.h" | ||
| explicit NullAnnotation { header "SomeKit_PrivateForNullAnnotation.h" } | ||
| export * | ||
| module * { export * } | ||
| syntax error | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #ifndef SOMEKIT_PRIVATE_H | ||
| #define SOMEKIT_PRIVATE_H | ||
|
|
||
| #import <SomeKit/SomeKit.h> | ||
|
|
||
| @interface A(Private) | ||
| -(A*)privateTransform:(A*)input; | ||
|
|
||
| @property (nonatomic) A* internalProperty; | ||
| @end | ||
|
|
||
| @protocol InternalProtocol | ||
| @end | ||
|
|
||
| #endif | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #ifndef SOMEKIT_PRIVATE_H | ||
| #define SOMEKIT_PRIVATE_H | ||
|
|
||
| #import <SomeKit/SomeKitForNullAnnotation.h> | ||
|
|
||
| @interface A(Private) | ||
| -(A*)privateTransform:(A*)input; | ||
|
|
||
| @property (nonatomic) A* internalProperty; | ||
| @end | ||
|
|
||
| @protocol InternalProtocol | ||
| - (id) MomeMethod; | ||
| @end | ||
|
|
||
| #endif | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Name: SomeKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "privateTransform:input:" | ||
| MethodKind: Instance | ||
| NullabilityOfRet: N | ||
| Nullability: [ N, S ] | ||
| Properties: | ||
| - Name: internalProperty | ||
| Nullability: N | ||
| Protocols: | ||
| - Name: InternalProtocol | ||
| Availability: none | ||
| AvailabilityMsg: "not for you" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Name: SomeOtherKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "methodA" | ||
| MethodKind: Instance | ||
| Availability: none | ||
| AvailabilityMsg: "anything but this" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Name: SomeOtherKit | ||
| Classes: | ||
| - Name: A | ||
| Methods: | ||
| - Selector: "methodA" | ||
| MethodKind: Instance | ||
| Availability: none | ||
| AvailabilityMsg: "anything but this" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #ifndef SOME_OTHER_KIT_H | ||
|
|
||
| __attribute__((objc_root_class)) | ||
| @interface A | ||
| -(void)methodA; | ||
| -(void)methodB; | ||
| @end | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module SomeOtherKit { | ||
| umbrella header "SomeOtherKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int TopLevelPrivateKit_Public; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| garbage here because this file shouldn't get read |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module TopLevelPrivateKit { | ||
| umbrella header "TopLevelPrivateKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module TopLevelPrivateKit_Private { | ||
| umbrella header "TopLevelPrivateKit_Private.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| garbage here because this file shouldn't get read |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Name: TopLevelPrivateKit_Private | ||
| Globals: | ||
| - Name: TopLevelPrivateKit_Private | ||
| Type: float |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int TopLevelPrivateKit_Private; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| garbage here because this file shouldn't get read |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| Name: VersionedKit | ||
| Classes: | ||
| - Name: TestProperties | ||
| SwiftObjCMembers: true | ||
| Properties: | ||
| - Name: accessorsOnly | ||
| PropertyKind: Instance | ||
| SwiftImportAsAccessors: true | ||
| - Name: accessorsOnlyForClass | ||
| PropertyKind: Class | ||
| SwiftImportAsAccessors: true | ||
| - Name: accessorsOnlyExceptInVersion3 | ||
| PropertyKind: Instance | ||
| SwiftImportAsAccessors: true | ||
| - Name: accessorsOnlyForClassExceptInVersion3 | ||
| PropertyKind: Class | ||
| SwiftImportAsAccessors: true | ||
| Functions: | ||
| - Name: unversionedRenameDUMP | ||
| SwiftName: 'unversionedRename_NOTES()' | ||
| Tags: | ||
| - Name: APINotedFlagEnum | ||
| FlagEnum: true | ||
| - Name: APINotedOpenEnum | ||
| EnumExtensibility: open | ||
| - Name: APINotedClosedEnum | ||
| EnumExtensibility: closed | ||
| - Name: SoonToBeCFEnum | ||
| EnumKind: CFEnum | ||
| - Name: SoonToBeNSEnum | ||
| EnumKind: NSEnum | ||
| - Name: SoonToBeCFOptions | ||
| EnumKind: CFOptions | ||
| - Name: SoonToBeNSOptions | ||
| EnumKind: NSOptions | ||
| - Name: SoonToBeCFClosedEnum | ||
| EnumKind: CFClosedEnum | ||
| - Name: SoonToBeNSClosedEnum | ||
| EnumKind: NSClosedEnum | ||
| - Name: UndoAllThatHasBeenDoneToMe | ||
| EnumKind: none | ||
| Typedefs: | ||
| - Name: MultiVersionedTypedef34Notes | ||
| SwiftName: MultiVersionedTypedef34Notes_NEW | ||
| - Name: MultiVersionedTypedef345Notes | ||
| SwiftName: MultiVersionedTypedef345Notes_NEW | ||
| - Name: MultiVersionedTypedef4Notes | ||
| SwiftName: MultiVersionedTypedef4Notes_NEW | ||
| - Name: MultiVersionedTypedef45Notes | ||
| SwiftName: MultiVersionedTypedef45Notes_NEW | ||
| SwiftVersions: | ||
| - Version: 3.0 | ||
| Classes: | ||
| - Name: MyReferenceType | ||
| SwiftBridge: '' | ||
| - Name: TestGenericDUMP | ||
| SwiftImportAsNonGeneric: true | ||
| - Name: TestProperties | ||
| SwiftObjCMembers: false | ||
| Properties: | ||
| - Name: accessorsOnlyInVersion3 | ||
| PropertyKind: Instance | ||
| SwiftImportAsAccessors: true | ||
| - Name: accessorsOnlyForClassInVersion3 | ||
| PropertyKind: Class | ||
| SwiftImportAsAccessors: true | ||
| - Name: accessorsOnlyExceptInVersion3 | ||
| PropertyKind: Instance | ||
| SwiftImportAsAccessors: false | ||
| - Name: accessorsOnlyForClassExceptInVersion3 | ||
| PropertyKind: Class | ||
| SwiftImportAsAccessors: false | ||
| - Name: Swift3RenamedOnlyDUMP | ||
| SwiftName: SpecialSwift3Name | ||
| - Name: Swift3RenamedAlsoDUMP | ||
| SwiftName: SpecialSwift3Also | ||
| Functions: | ||
| - Name: moveToPointDUMP | ||
| SwiftName: 'moveTo(a:b:)' | ||
| - Name: acceptClosure | ||
| Parameters: | ||
| - Position: 0 | ||
| NoEscape: false | ||
| - Name: privateFunc | ||
| SwiftPrivate: false | ||
| Tags: | ||
| - Name: MyErrorCode | ||
| NSErrorDomain: '' | ||
| - Name: NewlyFlagEnum | ||
| FlagEnum: false | ||
| - Name: OpenToClosedEnum | ||
| EnumExtensibility: open | ||
| - Name: ClosedToOpenEnum | ||
| EnumExtensibility: closed | ||
| - Name: NewlyClosedEnum | ||
| EnumExtensibility: none | ||
| - Name: NewlyOpenEnum | ||
| EnumExtensibility: none | ||
| Typedefs: | ||
| - Name: MyDoubleWrapper | ||
| SwiftWrapper: none | ||
| - Name: MultiVersionedTypedef34 | ||
| SwiftName: MultiVersionedTypedef34_3 | ||
| - Name: MultiVersionedTypedef34Header | ||
| SwiftName: MultiVersionedTypedef34Header_3 | ||
| - Name: MultiVersionedTypedef34Notes | ||
| SwiftName: MultiVersionedTypedef34Notes_3 | ||
| - Name: MultiVersionedTypedef345 | ||
| SwiftName: MultiVersionedTypedef345_3 | ||
| - Name: MultiVersionedTypedef345Header | ||
| SwiftName: MultiVersionedTypedef345Header_3 | ||
| - Name: MultiVersionedTypedef345Notes | ||
| SwiftName: MultiVersionedTypedef345Notes_3 | ||
| - Version: 5 | ||
| Typedefs: | ||
| - Name: MultiVersionedTypedef345 | ||
| SwiftName: MultiVersionedTypedef345_5 | ||
| - Name: MultiVersionedTypedef345Header | ||
| SwiftName: MultiVersionedTypedef345Header_5 | ||
| - Name: MultiVersionedTypedef345Notes | ||
| SwiftName: MultiVersionedTypedef345Notes_5 | ||
| - Name: MultiVersionedTypedef45 | ||
| SwiftName: MultiVersionedTypedef45_5 | ||
| - Name: MultiVersionedTypedef45Header | ||
| SwiftName: MultiVersionedTypedef45Header_5 | ||
| - Name: MultiVersionedTypedef45Notes | ||
| SwiftName: MultiVersionedTypedef45Notes_5 | ||
| - Version: 4 # Versions are deliberately ordered as "3, 5, 4" to catch bugs. | ||
| Classes: | ||
| - Name: Swift4RenamedDUMP | ||
| SwiftName: SpecialSwift4Name | ||
| Typedefs: | ||
| - Name: MultiVersionedTypedef34 | ||
| SwiftName: MultiVersionedTypedef34_4 | ||
| - Name: MultiVersionedTypedef34Header | ||
| SwiftName: MultiVersionedTypedef34Header_4 | ||
| - Name: MultiVersionedTypedef34Notes | ||
| SwiftName: MultiVersionedTypedef34Notes_4 | ||
| - Name: MultiVersionedTypedef345 | ||
| SwiftName: MultiVersionedTypedef345_4 | ||
| - Name: MultiVersionedTypedef345Header | ||
| SwiftName: MultiVersionedTypedef345Header_4 | ||
| - Name: MultiVersionedTypedef345Notes | ||
| SwiftName: MultiVersionedTypedef345Notes_4 | ||
| - Name: MultiVersionedTypedef4 | ||
| SwiftName: MultiVersionedTypedef4_4 | ||
| - Name: MultiVersionedTypedef4Header | ||
| SwiftName: MultiVersionedTypedef4Header_4 | ||
| - Name: MultiVersionedTypedef4Notes | ||
| SwiftName: MultiVersionedTypedef4Notes_4 | ||
| - Name: MultiVersionedTypedef45 | ||
| SwiftName: MultiVersionedTypedef45_4 | ||
| - Name: MultiVersionedTypedef45Header | ||
| SwiftName: MultiVersionedTypedef45Header_4 | ||
| - Name: MultiVersionedTypedef45Notes | ||
| SwiftName: MultiVersionedTypedef45Notes_4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| void moveToPointDUMP(double x, double y) __attribute__((swift_name("moveTo(x:y:)"))); | ||
|
|
||
| void unversionedRenameDUMP(void) __attribute__((swift_name("unversionedRename_HEADER()"))); | ||
|
|
||
| void acceptClosure(void (^ __attribute__((noescape)) block)(void)); | ||
|
|
||
| void privateFunc(void) __attribute__((swift_private)); | ||
|
|
||
| typedef double MyDoubleWrapper __attribute__((swift_wrapper(struct))); | ||
|
|
||
| #if __OBJC__ | ||
| @class NSString; | ||
|
|
||
| extern NSString *MyErrorDomain; | ||
|
|
||
| enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorCode { | ||
| MyErrorCodeFailed = 1 | ||
| }; | ||
|
|
||
| __attribute__((swift_bridge("MyValueType"))) | ||
| @interface MyReferenceType | ||
| @end | ||
|
|
||
| @interface TestProperties | ||
| @property (nonatomic, readwrite, retain) id accessorsOnly; | ||
| @property (nonatomic, readwrite, retain, class) id accessorsOnlyForClass; | ||
|
|
||
| @property (nonatomic, readwrite, retain) id accessorsOnlyInVersion3; | ||
| @property (nonatomic, readwrite, retain, class) id accessorsOnlyForClassInVersion3; | ||
|
|
||
| @property (nonatomic, readwrite, retain) id accessorsOnlyExceptInVersion3; | ||
| @property (nonatomic, readwrite, retain, class) id accessorsOnlyForClassExceptInVersion3; | ||
| @end | ||
|
|
||
| @interface Base | ||
| @end | ||
|
|
||
| @interface TestGenericDUMP<Element> : Base | ||
| - (Element)element; | ||
| @end | ||
|
|
||
| @interface Swift3RenamedOnlyDUMP | ||
| @end | ||
|
|
||
| __attribute__((swift_name("Swift4Name"))) | ||
| @interface Swift3RenamedAlsoDUMP | ||
| @end | ||
|
|
||
| @interface Swift4RenamedDUMP | ||
| @end | ||
|
|
||
| #endif | ||
|
|
||
|
|
||
| enum __attribute__((flag_enum)) FlagEnum { | ||
| FlagEnumA = 1, | ||
| FlagEnumB = 2 | ||
| }; | ||
|
|
||
| enum __attribute__((flag_enum)) NewlyFlagEnum { | ||
| NewlyFlagEnumA = 1, | ||
| NewlyFlagEnumB = 2 | ||
| }; | ||
|
|
||
| enum APINotedFlagEnum { | ||
| APINotedFlagEnumA = 1, | ||
| APINotedFlagEnumB = 2 | ||
| }; | ||
|
|
||
|
|
||
| enum __attribute__((enum_extensibility(open))) OpenEnum { | ||
| OpenEnumA = 1, | ||
| }; | ||
|
|
||
| enum __attribute__((enum_extensibility(open))) NewlyOpenEnum { | ||
| NewlyOpenEnumA = 1, | ||
| }; | ||
|
|
||
| enum __attribute__((enum_extensibility(closed))) NewlyClosedEnum { | ||
| NewlyClosedEnumA = 1, | ||
| }; | ||
|
|
||
| enum __attribute__((enum_extensibility(open))) ClosedToOpenEnum { | ||
| ClosedToOpenEnumA = 1, | ||
| }; | ||
|
|
||
| enum __attribute__((enum_extensibility(closed))) OpenToClosedEnum { | ||
| OpenToClosedEnumA = 1, | ||
| }; | ||
|
|
||
| enum APINotedOpenEnum { | ||
| APINotedOpenEnumA = 1, | ||
| }; | ||
|
|
||
| enum APINotedClosedEnum { | ||
| APINotedClosedEnumA = 1, | ||
| }; | ||
|
|
||
|
|
||
| enum SoonToBeCFEnum { | ||
| SoonToBeCFEnumA = 1 | ||
| }; | ||
| enum SoonToBeNSEnum { | ||
| SoonToBeNSEnumA = 1 | ||
| }; | ||
| enum SoonToBeCFOptions { | ||
| SoonToBeCFOptionsA = 1 | ||
| }; | ||
| enum SoonToBeNSOptions { | ||
| SoonToBeNSOptionsA = 1 | ||
| }; | ||
| enum SoonToBeCFClosedEnum { | ||
| SoonToBeCFClosedEnumA = 1 | ||
| }; | ||
| enum SoonToBeNSClosedEnum { | ||
| SoonToBeNSClosedEnumA = 1 | ||
| }; | ||
| enum UndoAllThatHasBeenDoneToMe { | ||
| UndoAllThatHasBeenDoneToMeA = 1 | ||
| } __attribute__((flag_enum)) __attribute__((enum_extensibility(closed))); | ||
|
|
||
|
|
||
| typedef int MultiVersionedTypedef4; | ||
| typedef int MultiVersionedTypedef4Notes; | ||
| typedef int MultiVersionedTypedef4Header __attribute__((swift_name("MultiVersionedTypedef4Header_NEW"))); | ||
|
|
||
| typedef int MultiVersionedTypedef34; | ||
| typedef int MultiVersionedTypedef34Notes; | ||
| typedef int MultiVersionedTypedef34Header __attribute__((swift_name("MultiVersionedTypedef34Header_NEW"))); | ||
|
|
||
| typedef int MultiVersionedTypedef45; | ||
| typedef int MultiVersionedTypedef45Notes; | ||
| typedef int MultiVersionedTypedef45Header __attribute__((swift_name("MultiVersionedTypedef45Header_NEW"))); | ||
|
|
||
| typedef int MultiVersionedTypedef345; | ||
| typedef int MultiVersionedTypedef345Notes; | ||
| typedef int MultiVersionedTypedef345Header __attribute__((swift_name("MultiVersionedTypedef345Header_NEW"))); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| framework module VersionedKit { | ||
| umbrella header "VersionedKit.h" | ||
| export * | ||
| module * { export * } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| Name: HeaderLib | ||
| SwiftInferImportAsMember: true | ||
| Functions: | ||
| - Name: custom_realloc | ||
| NullabilityOfRet: N | ||
| Nullability: [ N, S ] | ||
| - Name: unavailable_function | ||
| Availability: none | ||
| AvailabilityMsg: "I beg you not to use this" | ||
| - Name: do_something_with_pointers | ||
| NullabilityOfRet: O | ||
| Nullability: [ N, O ] | ||
|
|
||
| Globals: | ||
| - Name: global_int | ||
| Nullability: N | ||
| - Name: unavailable_global_int | ||
| Availability: none |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Name: BrokenTypes | ||
| Functions: | ||
| - Name: break_me_function | ||
| ResultType: 'int * with extra junk' | ||
| Parameters: | ||
| - Position: 0 | ||
| Type: 'not_a_type' | ||
| Globals: | ||
| - Name: break_me_variable | ||
| Type: 'double' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #ifndef BROKEN_TYPES_H | ||
| #define BROKEN_TYPES_H | ||
|
|
||
| char break_me_function(void *ptr); | ||
|
|
||
| extern char break_me_variable; | ||
|
|
||
| #endif // BROKEN_TYPES_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Name: ExternCtx | ||
| Globals: | ||
| - Name: globalInExternC | ||
| Availability: none | ||
| AvailabilityMsg: "oh no" | ||
| - Name: globalInExternCXX | ||
| Availability: none | ||
| AvailabilityMsg: "oh no #2" | ||
| Functions: | ||
| - Name: globalFuncInExternC | ||
| Availability: none | ||
| AvailabilityMsg: "oh no #3" | ||
| - Name: globalFuncInExternCXX | ||
| Availability: none | ||
| AvailabilityMsg: "oh no #4" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| extern "C" { | ||
| static int globalInExternC = 1; | ||
|
|
||
| static void globalFuncInExternC() {} | ||
| } | ||
|
|
||
| extern "C++" { | ||
| static int globalInExternCXX = 2; | ||
|
|
||
| static void globalFuncInExternCXX() {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| Name: HeaderLib | ||
| SwiftInferImportAsMember: true | ||
| Functions: | ||
| - Name: custom_realloc | ||
| NullabilityOfRet: N | ||
| Nullability: [ N, S ] | ||
| - Name: unavailable_function | ||
| Availability: none | ||
| AvailabilityMsg: "I beg you not to use this" | ||
| - Name: do_something_with_pointers | ||
| NullabilityOfRet: O | ||
| Nullability: [ N, O ] | ||
| - Name: do_something_with_arrays | ||
| Parameters: | ||
| - Position: 0 | ||
| Nullability: N | ||
| - Position: 1 | ||
| Nullability: N | ||
| - Name: take_pointer_and_int | ||
| Parameters: | ||
| - Position: 0 | ||
| Nullability: N | ||
| NoEscape: true | ||
| - Position: 1 | ||
| NoEscape: true | ||
| Globals: | ||
| - Name: global_int | ||
| Nullability: N | ||
| - Name: unavailable_global_int | ||
| Availability: none | ||
| Tags: | ||
| - Name: unavailable_struct | ||
| Availability: none | ||
|
|
||
| Typedefs: | ||
| - Name: unavailable_typedef | ||
| Availability: none |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #ifndef HEADER_LIB_H | ||
| #define HEADER_LIB_H | ||
|
|
||
| void *custom_realloc(void *member, unsigned size); | ||
|
|
||
| int *global_int; | ||
|
|
||
| int unavailable_function(void); | ||
| int unavailable_global_int; | ||
|
|
||
| void do_something_with_pointers(int *ptr1, int *ptr2); | ||
| void do_something_with_arrays(int simple[], int nested[][2]); | ||
|
|
||
| typedef int unavailable_typedef; | ||
| struct unavailable_struct { int x, y, z; }; | ||
|
|
||
| void take_pointer_and_int(int *ptr1, int value); | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Name: InstancetypeModule | ||
| Classes: | ||
| - Name: SomeBaseClass | ||
| Methods: | ||
| - Selector: instancetypeFactoryMethod | ||
| MethodKind: Class | ||
| ResultType: SomeBaseClass * _Nonnull | ||
| - Selector: staticFactoryMethod | ||
| MethodKind: Class | ||
| ResultType: SomeBaseClass * _Nonnull |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| @interface Object | ||
| @end | ||
|
|
||
| @interface SomeBaseClass : Object | ||
| + (nullable instancetype)instancetypeFactoryMethod; | ||
| + (nullable SomeBaseClass *)staticFactoryMethod; | ||
| @end | ||
|
|
||
| @interface SomeSubclass : SomeBaseClass | ||
| @end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int ModuleWithWrongCase; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int ModuleWithWrongCasePrivate; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Name: ModuleWithWrongCasePrivate |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Name: ModuleWithWrongCasePrivate |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
| Name: Namespaces | ||
| Globals: | ||
| - Name: varInInlineNamespace | ||
| SwiftName: swiftVarInInlineNamespace | ||
| Functions: | ||
| - Name: funcInNamespace | ||
| SwiftName: inWrongContext() | ||
| - Name: funcInInlineNamespace | ||
| SwiftName: swiftFuncInInlineNamespace() | ||
| Tags: | ||
| - Name: char_box | ||
| SwiftName: InWrongContext | ||
| Namespaces: | ||
| - Name: Namespace1 | ||
| Typedefs: | ||
| - Name: my_typedef | ||
| SwiftName: SwiftTypedef | ||
| - Name: my_using_decl | ||
| SwiftName: SwiftUsingDecl | ||
| Globals: | ||
| - Name: varInNamespace | ||
| SwiftName: swiftVarInNamespace | ||
| Functions: | ||
| - Name: funcInNamespace | ||
| SwiftName: swiftFuncInNamespace() | ||
| Tags: | ||
| - Name: char_box | ||
| SwiftName: CharBox | ||
| Namespaces: | ||
| - Name: Nested1 | ||
| Globals: | ||
| - Name: varInNestedNamespace | ||
| SwiftName: swiftVarInNestedNamespace | ||
| Functions: | ||
| - Name: funcInNestedNamespace | ||
| SwiftName: swiftFuncInNestedNamespace(_:) | ||
| Tags: | ||
| - Name: char_box | ||
| SwiftName: NestedCharBox | ||
| Namespaces: | ||
| - Name: Namespace1 | ||
| Tags: | ||
| - Name: char_box | ||
| SwiftName: DeepNestedCharBox | ||
| - Name: Nested2 | ||
| Globals: | ||
| - Name: varInNestedNamespace | ||
| SwiftName: swiftAnotherVarInNestedNamespace | ||
| - Name: InlineNamespace1 | ||
| Functions: | ||
| - Name: funcInInlineNamespace | ||
| SwiftName: shouldNotSpellOutInlineNamespaces() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| namespace Namespace1 { namespace Nested1 {} } | ||
|
|
||
| namespace Namespace1 { | ||
| static int varInNamespace = 1; | ||
| struct char_box { char c; }; | ||
| void funcInNamespace(); | ||
|
|
||
| namespace Nested1 { | ||
| void funcInNestedNamespace(int i); | ||
| struct char_box { | ||
| char c; | ||
| }; | ||
| } | ||
|
|
||
| namespace Nested1 { | ||
| static int varInNestedNamespace = 1; | ||
| void funcInNestedNamespace(int i); | ||
|
|
||
| namespace Namespace1 { | ||
| struct char_box { char c; }; | ||
| } // namespace Namespace1 | ||
| } // namespace Nested1 | ||
|
|
||
| namespace Nested2 { | ||
| static int varInNestedNamespace = 2; | ||
| } // namespace Nested2 | ||
|
|
||
| namespace Nested1 { namespace Namespace1 {} } | ||
| } // namespace Namespace1 | ||
|
|
||
| namespace Namespace1 { | ||
| typedef int my_typedef; | ||
| using my_using_decl = int; | ||
| } | ||
|
|
||
| inline namespace InlineNamespace1 { | ||
| static int varInInlineNamespace = 3; | ||
| void funcInInlineNamespace(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Name: HeaderLib | ||
| Globals: | ||
| - Name: PrivateLib | ||
| Type: float |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int PrivateLib; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| garbage here because this file shouldn't get read |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| Name: SwiftImportAs | ||
| Tags: | ||
| - Name: ImmortalRefType | ||
| SwiftImportAs: reference | ||
| - Name: RefCountedType | ||
| SwiftImportAs: reference | ||
| SwiftReleaseOp: RCRelease | ||
| SwiftRetainOp: RCRetain |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| struct ImmortalRefType {}; | ||
|
|
||
| struct RefCountedType { int value; }; | ||
|
|
||
| inline void RCRetain(RefCountedType *x) { x->value++; } | ||
| inline void RCRelease(RefCountedType *x) { x->value--; } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| module ExternCtx { | ||
| header "ExternCtx.h" | ||
| } | ||
|
|
||
| module HeaderLib { | ||
| header "HeaderLib.h" | ||
| } | ||
|
|
||
| module InstancetypeModule { | ||
| header "InstancetypeModule.h" | ||
| } | ||
|
|
||
| module BrokenTypes { | ||
| header "BrokenTypes.h" | ||
| } | ||
|
|
||
| module ModuleWithWrongCase { | ||
| header "ModuleWithWrongCase.h" | ||
| } | ||
|
|
||
| module ModuleWithWrongCasePrivate { | ||
| header "ModuleWithWrongCasePrivate.h" | ||
| } | ||
|
|
||
| module Namespaces { | ||
| header "Namespaces.h" | ||
| } | ||
|
|
||
| module SwiftImportAs { | ||
| header "SwiftImportAs.h" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module PrivateLib { | ||
| header "PrivateLib.h" | ||
| } | ||
|
|
||
| module ModuleWithWrongCasePrivate.Inner {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| Name: UIKit | ||
| Classes: | ||
| - Name: UIFont | ||
| Methods: | ||
| - Selector: 'fontWithName:size:' | ||
| MethodKind: Instance | ||
| Nullability: [ N ] | ||
| NullabilityOfRet: O | ||
| DesignatedInit: true | ||
| # CHECK: duplicate definition of method '-[UIFont fontWithName:size:]' | ||
| - Selector: 'fontWithName:size:' | ||
| MethodKind: Instance | ||
| Nullability: [ N ] | ||
| NullabilityOfRet: O | ||
| DesignatedInit: true | ||
| Properties: | ||
| - Name: familyName | ||
| Nullability: N | ||
| - Name: fontName | ||
| Nullability: N | ||
| # CHECK: duplicate definition of instance property 'UIFont.familyName' | ||
| - Name: familyName | ||
| Nullability: N | ||
| # CHECK: multiple definitions of class 'UIFont' | ||
| - Name: UIFont | ||
| Protocols: | ||
| - Name: MyProto | ||
| AuditedForNullability: true | ||
| # CHECK: multiple definitions of protocol 'MyProto' | ||
| - Name: MyProto | ||
| AuditedForNullability: true | ||
| Functions: | ||
| - Name: 'globalFoo' | ||
| Nullability: [ N, N, O, S ] | ||
| NullabilityOfRet: O | ||
| - Name: 'globalFoo2' | ||
| Nullability: [ N, N, O, S ] | ||
| NullabilityOfRet: O | ||
| Globals: | ||
| - Name: globalVar | ||
| Nullability: O | ||
| - Name: globalVar2 | ||
| Nullability: O | ||
| Tags: | ||
| # CHECK: cannot mix EnumKind and FlagEnum (for FlagAndEnumKind) | ||
| - Name: FlagAndEnumKind | ||
| FlagEnum: true | ||
| EnumKind: CFOptions | ||
| # CHECK: cannot mix EnumKind and FlagEnum (for FlagAndEnumKind2) | ||
| - Name: FlagAndEnumKind2 | ||
| EnumKind: CFOptions | ||
| FlagEnum: false | ||
| # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind) | ||
| - Name: ExtensibilityAndEnumKind | ||
| EnumExtensibility: open | ||
| EnumKind: CFOptions | ||
| # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind2) | ||
| - Name: ExtensibilityAndEnumKind2 | ||
| EnumKind: CFOptions | ||
| EnumExtensibility: closed | ||
| # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind3) | ||
| - Name: ExtensibilityAndEnumKind3 | ||
| EnumKind: none | ||
| EnumExtensibility: none |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| extern int yesOfCourseThisIsWhatUIKitLooksLike; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module UIKit { | ||
| header "UIKit.h" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // RUN: rm -rf %t | ||
| // RUN: %clang_cc1 -fmodules -Wno-private-module -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| #include "HeaderLib.h" | ||
| #import <SomeKit/SomeKit.h> | ||
| #import <SomeKit/SomeKit_Private.h> | ||
|
|
||
| int main() { | ||
| int i; | ||
| i = unavailable_function(); // expected-error{{'unavailable_function' is unavailable: I beg you not to use this}} | ||
| // expected-note@HeaderLib.h:8{{'unavailable_function' has been explicitly marked unavailable here}} | ||
| i = unavailable_global_int; // expected-error{{'unavailable_global_int' is unavailable}} | ||
| // expected-note@HeaderLib.h:9{{'unavailable_global_int' has been explicitly marked unavailable here}} | ||
|
|
||
| unavailable_typedef t; // expected-error{{'unavailable_typedef' is unavailable}} | ||
| // expected-note@HeaderLib.h:14{{'unavailable_typedef' has been explicitly marked unavailable here}} | ||
|
|
||
| struct unavailable_struct s; // expected-error{{'unavailable_struct' is unavailable}} | ||
| // expected-note@HeaderLib.h:15{{'unavailable_struct' has been explicitly marked unavailable here}} | ||
|
|
||
| B *b = 0; // expected-error{{'B' is unavailable: just don't}} | ||
| // expected-note@SomeKit/SomeKit.h:15{{'B' has been explicitly marked unavailable here}} | ||
|
|
||
| id<InternalProtocol> proto = 0; // expected-error{{'InternalProtocol' is unavailable: not for you}} | ||
| // expected-note@SomeKit/SomeKit_Private.h:12{{'InternalProtocol' has been explicitly marked unavailable here}} | ||
|
|
||
| A *a = 0; | ||
| i = a.intValue; // expected-error{{intValue' is unavailable: wouldn't work anyway}} | ||
| // expected-note@SomeKit/SomeKit.h:12{{'intValue' has been explicitly marked unavailable here}} | ||
|
|
||
| [a transform:a]; // expected-error{{'transform:' is unavailable: anything but this}} | ||
| // expected-note@SomeKit/SomeKit.h:6{{'transform:' has been explicitly marked unavailable here}} | ||
|
|
||
| [a implicitGetOnlyInstance]; // expected-error{{'implicitGetOnlyInstance' is unavailable: getter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:53{{'implicitGetOnlyInstance' has been explicitly marked unavailable here}} | ||
| [A implicitGetOnlyClass]; // expected-error{{'implicitGetOnlyClass' is unavailable: getter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:54{{'implicitGetOnlyClass' has been explicitly marked unavailable here}} | ||
| [a implicitGetSetInstance]; // expected-error{{'implicitGetSetInstance' is unavailable: getter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:56{{'implicitGetSetInstance' has been explicitly marked unavailable here}} | ||
| [a setImplicitGetSetInstance: a]; // expected-error{{'setImplicitGetSetInstance:' is unavailable: setter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:56{{'setImplicitGetSetInstance:' has been explicitly marked unavailable here}} | ||
| [A implicitGetSetClass]; // expected-error{{'implicitGetSetClass' is unavailable: getter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:57{{'implicitGetSetClass' has been explicitly marked unavailable here}} | ||
| [A setImplicitGetSetClass: a]; // expected-error{{'setImplicitGetSetClass:' is unavailable: setter gone}} | ||
| // expected-note@SomeKit/SomeKit.h:57{{'setImplicitGetSetClass:' has been explicitly marked unavailable here}} | ||
| return 0; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s 2> %t.err | ||
| // RUN: FileCheck %s < %t.err | ||
|
|
||
| #include "BrokenTypes.h" | ||
|
|
||
| // CHECK: <API Notes>:1:1: error: unknown type name 'not_a_type' | ||
| // CHECK-NEXT: not_a_type | ||
| // CHECK-NEXT: ^ | ||
|
|
||
| // CHECK: <API Notes>:1:7: error: unparsed tokens following type | ||
| // CHECK-NEXT: int * with extra junk | ||
| // CHECK-NEXT: ^ | ||
|
|
||
| // CHECK: BrokenTypes.h:4:6: error: API notes replacement type 'int *' has a different size from original type 'char' | ||
|
|
||
| // CHECK: BrokenTypes.h:6:13: error: API notes replacement type 'double' has a different size from original type 'char' | ||
|
|
||
| // CHECK: 5 errors generated. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // REQUIRES: case-insensitive-filesystem | ||
|
|
||
| // RUN: rm -rf %t | ||
| // RUN: %clang_cc1 -fsyntax-only -fmodules -fapinotes-modules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s 2>&1 | FileCheck %s | ||
|
|
||
| // RUN: rm -rf %t | ||
| // RUN: %clang_cc1 -fsyntax-only -fmodules -fapinotes-modules -fimplicit-module-maps -fmodules-cache-path=%t -iframework %S/Inputs/Frameworks -isystem %S/Inputs/Headers %s -Werror | ||
|
|
||
| // RUN: rm -rf %t | ||
| // RUN: %clang_cc1 -fsyntax-only -fmodules -fapinotes-modules -fimplicit-module-maps -fmodules-cache-path=%t -iframework %S/Inputs/Frameworks -isystem %S/Inputs/Headers %s -Wnonportable-private-system-apinotes-path 2>&1 | FileCheck %s | ||
|
|
||
| #include <ModuleWithWrongCase.h> | ||
| #include <ModuleWithWrongCasePrivate.h> | ||
| #include <FrameworkWithWrongCase/FrameworkWithWrongCase.h> | ||
| #include <FrameworkWithWrongCasePrivate/FrameworkWithWrongCasePrivate.h> | ||
| #include <FrameworkWithActualPrivateModule/FrameworkWithActualPrivateModule_Private.h> | ||
|
|
||
| // CHECK-NOT: warning: | ||
| // CHECK: warning: private API notes file for module 'ModuleWithWrongCasePrivate' should be named 'ModuleWithWrongCasePrivate_private.apinotes', not 'ModuleWithWrongCasePrivate_Private.apinotes' | ||
| // CHECK-NOT: warning: | ||
| // CHECK: warning: private API notes file for module 'FrameworkWithWrongCasePrivate' should be named 'FrameworkWithWrongCasePrivate_private.apinotes', not 'FrameworkWithWrongCasePrivate_Private.apinotes' | ||
| // CHECK-NOT: warning: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -ast-dump -ast-dump-filter globalInExternC -x c++ | FileCheck -check-prefix=CHECK-EXTERN-C %s | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -ast-dump -ast-dump-filter globalInExternCXX -x c++ | FileCheck -check-prefix=CHECK-EXTERN-CXX %s | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -ast-dump -ast-dump-filter globalFuncInExternC -x c++ | FileCheck -check-prefix=CHECK-FUNC-EXTERN-C %s | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -ast-dump -ast-dump-filter globalFuncInExternCXX -x c++ | FileCheck -check-prefix=CHECK-FUNC-EXTERN-CXX %s | ||
|
|
||
| #include "ExternCtx.h" | ||
|
|
||
| // CHECK-EXTERN-C: Dumping globalInExternC: | ||
| // CHECK-EXTERN-C: VarDecl {{.+}} imported in ExternCtx globalInExternC 'int' | ||
| // CHECK-EXTERN-C: UnavailableAttr {{.+}} <<invalid sloc>> "oh no" | ||
|
|
||
| // CHECK-EXTERN-CXX: Dumping globalInExternCXX: | ||
| // CHECK-EXTERN-CXX: VarDecl {{.+}} imported in ExternCtx globalInExternCXX 'int' | ||
| // CHECK-EXTERN-CXX: UnavailableAttr {{.+}} <<invalid sloc>> "oh no #2" | ||
|
|
||
| // CHECK-FUNC-EXTERN-C: Dumping globalFuncInExternC: | ||
| // CHECK-FUNC-EXTERN-C: FunctionDecl {{.+}} imported in ExternCtx globalFuncInExternC 'void ()' | ||
| // CHECK-FUNC-EXTERN-C: UnavailableAttr {{.+}} <<invalid sloc>> "oh no #3" | ||
|
|
||
| // CHECK-FUNC-EXTERN-CXX: Dumping globalFuncInExternCXX: | ||
| // CHECK-FUNC-EXTERN-CXX: FunctionDecl {{.+}} imported in ExternCtx globalFuncInExternCXX 'void ()' | ||
| // CHECK-FUNC-EXTERN-CXX: UnavailableAttr {{.+}} <<invalid sloc>> "oh no #4" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -verify %s | ||
|
|
||
| @import InstancetypeModule; | ||
|
|
||
| void test() { | ||
| // The nullability is here to verify that the API notes were applied. | ||
| int good = [SomeSubclass instancetypeFactoryMethod]; // expected-error {{initializing 'int' with an expression of type 'SomeSubclass * _Nonnull'}} | ||
| int bad = [SomeSubclass staticFactoryMethod]; // expected-error {{initializing 'int' with an expression of type 'SomeBaseClass * _Nonnull'}} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // RUN: rm -rf %t | ||
|
|
||
| // Set up directories | ||
| // RUN: mkdir -p %t/APINotes | ||
| // RUN: cp %S/Inputs/APINotes/SomeOtherKit.apinotes %t/APINotes/SomeOtherKit.apinotes | ||
| // RUN: mkdir -p %t/Frameworks | ||
| // RUN: cp -r %S/Inputs/Frameworks/SomeOtherKit.framework %t/Frameworks | ||
|
|
||
| // First build: check that 'methodB' is unavailable but 'methodA' is available. | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/APINotes -F %t/Frameworks %s > %t/before.log 2>&1 | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-REBUILD %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-ONE-ERROR %s < %t/before.log | ||
|
|
||
| // Do it again; now we're using caches. | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/APINotes -F %t/Frameworks %s > %t/before.log 2>&1 | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-WITHOUT-REBUILD %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-ONE-ERROR %s < %t/before.log | ||
|
|
||
| // Add a blank line to the header to force the module to rebuild, without | ||
| // (yet) changing API notes. | ||
| // RUN: echo >> %t/Frameworks/SomeOtherKit.framework/Headers/SomeOtherKit.h | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/APINotes -F %t/Frameworks %s > %t/before.log 2>&1 | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-REBUILD %s < %t/before.log | ||
| // RUN: FileCheck -check-prefix=CHECK-ONE-ERROR %s < %t/before.log | ||
|
|
||
| // Change the API notes file, after the module has rebuilt once. | ||
| // RUN: echo ' - Selector: "methodA"' >> %t/APINotes/SomeOtherKit.apinotes | ||
| // RUN: echo ' MethodKind: Instance' >> %t/APINotes/SomeOtherKit.apinotes | ||
| // RUN: echo ' Availability: none' >> %t/APINotes/SomeOtherKit.apinotes | ||
| // RUN: echo ' AvailabilityMsg: "not here either"' >> %t/APINotes/SomeOtherKit.apinotes | ||
|
|
||
| // Build again: check that both methods are now unavailable and that the module rebuilt. | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/APINotes -F %t/Frameworks %s > %t/after.log 2>&1 | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODA %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-REBUILD %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-TWO-ERRORS %s < %t/after.log | ||
|
|
||
| // Run the build again: check that both methods are now unavailable | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/APINotes -F %t/Frameworks %s > %t/after.log 2>&1 | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODA %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-WITHOUT-REBUILD %s < %t/after.log | ||
| // RUN: FileCheck -check-prefix=CHECK-TWO-ERRORS %s < %t/after.log | ||
|
|
||
| @import SomeOtherKit; | ||
|
|
||
| void test(A *a) { | ||
| // CHECK-METHODA: error: 'methodA' is unavailable: not here either | ||
| [a methodA]; | ||
|
|
||
| // CHECK-METHODB: error: 'methodB' is unavailable: anything but this | ||
| [a methodB]; | ||
| } | ||
|
|
||
| // CHECK-REBUILD: remark: building module{{.*}}SomeOtherKit | ||
|
|
||
| // CHECK-WITHOUT-REBUILD-NOT: remark: building module{{.*}}SomeOtherKit | ||
|
|
||
| // CHECK-ONE-ERROR: 1 error generated. | ||
| // CHECK-TWO-ERRORS: 2 errors generated. | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -x objective-c++ | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::my_typedef -x objective-c++ | FileCheck -check-prefix=CHECK-TYPEDEF-IN-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::my_using_decl -x objective-c++ | FileCheck -check-prefix=CHECK-USING-DECL-IN-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::varInNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-GLOBAL-IN-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::funcInNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-FUNC-IN-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::char_box -x objective-c++ | FileCheck -check-prefix=CHECK-STRUCT-IN-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::varInNestedNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-GLOBAL-IN-NESTED-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested2::varInNestedNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-ANOTHER-GLOBAL-IN-NESTED-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::char_box -x objective-c++ | FileCheck -check-prefix=CHECK-STRUCT-IN-NESTED-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::funcInNestedNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-FUNC-IN-NESTED-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::Namespace1::char_box -x objective-c++ | FileCheck -check-prefix=CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter varInInlineNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-GLOBAL-IN-INLINE-NAMESPACE %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter funcInInlineNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-FUNC-IN-INLINE-NAMESPACE %s | ||
|
|
||
| #import <Namespaces.h> | ||
|
|
||
| // CHECK-TYPEDEF-IN-NAMESPACE: Dumping Namespace1::my_typedef: | ||
| // CHECK-TYPEDEF-IN-NAMESPACE-NEXT: TypedefDecl {{.+}} imported in Namespaces my_typedef 'int' | ||
| // CHECK-TYPEDEF-IN-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "SwiftTypedef" | ||
|
|
||
| // CHECK-USING-DECL-IN-NAMESPACE: Dumping Namespace1::my_using_decl: | ||
| // CHECK-USING-DECL-IN-NAMESPACE-NEXT: TypeAliasDecl {{.+}} imported in Namespaces my_using_decl 'int' | ||
| // CHECK-USING-DECL-IN-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "SwiftUsingDecl" | ||
|
|
||
| // CHECK-GLOBAL-IN-NAMESPACE: Dumping Namespace1::varInNamespace: | ||
| // CHECK-GLOBAL-IN-NAMESPACE-NEXT: VarDecl {{.+}} imported in Namespaces varInNamespace 'int' static cinit | ||
| // CHECK-GLOBAL-IN-NAMESPACE-NEXT: IntegerLiteral {{.+}} 'int' 1 | ||
| // CHECK-GLOBAL-IN-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftVarInNamespace" | ||
|
|
||
| // CHECK-FUNC-IN-NAMESPACE: Dumping Namespace1::funcInNamespace: | ||
| // CHECK-FUNC-IN-NAMESPACE-NEXT: FunctionDecl {{.+}} imported in Namespaces funcInNamespace 'void ()' | ||
| // CHECK-FUNC-IN-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftFuncInNamespace()" | ||
|
|
||
| // CHECK-STRUCT-IN-NAMESPACE: Dumping Namespace1::char_box: | ||
| // CHECK-STRUCT-IN-NAMESPACE-NEXT: CXXRecordDecl {{.+}} imported in Namespaces <undeserialized declarations> struct char_box | ||
| // CHECK-STRUCT-IN-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "CharBox" | ||
|
|
||
| // CHECK-GLOBAL-IN-NESTED-NAMESPACE: Dumping Namespace1::Nested1::varInNestedNamespace: | ||
| // CHECK-GLOBAL-IN-NESTED-NAMESPACE-NEXT: VarDecl {{.+}} imported in Namespaces varInNestedNamespace 'int' static cinit | ||
| // CHECK-GLOBAL-IN-NESTED-NAMESPACE-NEXT: IntegerLiteral {{.+}} 'int' 1 | ||
| // CHECK-GLOBAL-IN-NESTED-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftVarInNestedNamespace" | ||
|
|
||
| // CHECK-ANOTHER-GLOBAL-IN-NESTED-NAMESPACE: Dumping Namespace1::Nested2::varInNestedNamespace: | ||
| // CHECK-ANOTHER-GLOBAL-IN-NESTED-NAMESPACE-NEXT: VarDecl {{.+}} imported in Namespaces varInNestedNamespace 'int' static cinit | ||
| // CHECK-ANOTHER-GLOBAL-IN-NESTED-NAMESPACE-NEXT: IntegerLiteral {{.+}} 'int' 2 | ||
| // CHECK-ANOTHER-GLOBAL-IN-NESTED-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftAnotherVarInNestedNamespace" | ||
|
|
||
| // CHECK-FUNC-IN-NESTED-NAMESPACE: Dumping Namespace1::Nested1::funcInNestedNamespace: | ||
| // CHECK-FUNC-IN-NESTED-NAMESPACE-NEXT: FunctionDecl {{.+}} imported in Namespaces funcInNestedNamespace 'void (int)' | ||
| // CHECK-FUNC-IN-NESTED-NAMESPACE-NEXT: ParmVarDecl {{.+}} i 'int' | ||
| // CHECK-FUNC-IN-NESTED-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftFuncInNestedNamespace(_:)" | ||
|
|
||
| // CHECK-STRUCT-IN-NESTED-NAMESPACE: Dumping Namespace1::Nested1::char_box: | ||
| // CHECK-STRUCT-IN-NESTED-NAMESPACE-NEXT: CXXRecordDecl {{.+}} imported in Namespaces <undeserialized declarations> struct char_box | ||
| // CHECK-STRUCT-IN-NESTED-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "NestedCharBox" | ||
|
|
||
| // CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE: Dumping Namespace1::Nested1::Namespace1::char_box: | ||
| // CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE-NEXT: CXXRecordDecl {{.+}} imported in Namespaces <undeserialized declarations> struct char_box | ||
| // CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "DeepNestedCharBox" | ||
|
|
||
| // CHECK-GLOBAL-IN-INLINE-NAMESPACE: Dumping varInInlineNamespace: | ||
| // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: VarDecl {{.+}} imported in Namespaces varInInlineNamespace 'int' static cinit | ||
| // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: IntegerLiteral {{.+}} 'int' 3 | ||
| // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftVarInInlineNamespace" | ||
|
|
||
| // CHECK-FUNC-IN-INLINE-NAMESPACE: Dumping funcInInlineNamespace: | ||
| // CHECK-FUNC-IN-INLINE-NAMESPACE-NEXT: FunctionDecl {{.+}} imported in Namespaces funcInInlineNamespace 'void ()' | ||
| // CHECK-FUNC-IN-INLINE-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftFuncInInlineNamespace()" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| #include "HeaderLib.h" | ||
|
|
||
| int main() { | ||
| custom_realloc(0, 0); // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| int i = 0; | ||
| do_something_with_pointers(&i, 0); | ||
| do_something_with_pointers(0, &i); // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| extern void *p; | ||
| do_something_with_arrays(0, p); // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| do_something_with_arrays(p, 0); // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| take_pointer_and_int(0, 0); // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| float *fp = global_int; // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'int * _Nonnull'}} | ||
| return 0; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| // Test with Swift version 3.0. This should only affect the few APIs that have an entry in the 3.0 tables. | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fapinotes-swift-version=3.0 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify -DSWIFT_VERSION_3_0 -fmodules-ignore-macro=SWIFT_VERSION_3_0 | ||
|
|
||
| #import <SomeKit/SomeKit.h> | ||
|
|
||
| int main() { | ||
| A *a; | ||
|
|
||
| #if SWIFT_VERSION_3_0 | ||
| float *fp = // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'A * _Nullable'}} | ||
| [a transform: 0 integer: 0]; | ||
| #else | ||
| float *fp = // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'A *'}} | ||
| [a transform: 0 integer: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| #endif | ||
|
|
||
| [a setNonnullAInstance: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| [A setNonnullAInstance: 0]; // no warning | ||
| a.nonnullAInstance = 0; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| A* _Nonnull aPtr = a.nonnullAInstance; // no warning | ||
|
|
||
| [a setNonnullAClass: 0]; // no warning | ||
| [A setNonnullAClass: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| [a setNonnullABoth: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| [A setNonnullABoth: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| [a setInternalProperty: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
|
|
||
| #if SWIFT_VERSION_3_0 | ||
| // Version 3 information overrides header information. | ||
| [a setExplicitNonnullInstance: 0]; // okay | ||
| [a setExplicitNullableInstance: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| #else | ||
| // Header information overrides unversioned information. | ||
| [a setExplicitNonnullInstance: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}} | ||
| [a setExplicitNullableInstance: 0]; // okay | ||
| #endif | ||
|
|
||
| return 0; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| @import LayeredKit; | ||
|
|
||
| void test( | ||
| UpwardClass *okayClass, | ||
| id <UpwardProto> okayProto, | ||
| PerfectlyNormalClass *badClass // expected-error {{'PerfectlyNormalClass' is unavailable}} | ||
| ) { | ||
| // expected-note@LayeredKitImpl/LayeredKitImpl.h:4 {{'PerfectlyNormalClass' has been explicitly marked unavailable here}} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| #include "HeaderLib.h" | ||
| #import <SomeKit/SomeKit.h> | ||
|
|
||
| @interface CSub : C | ||
| -(instancetype)initWithA:(A*)a; | ||
| @end | ||
|
|
||
| @implementation CSub | ||
| -(instancetype)initWithA:(A*)a { // expected-warning{{designated initializer missing a 'super' call to a designated initializer of the super class}} | ||
| // expected-note@SomeKit/SomeKit.h:20 2{{method marked as designated initializer of the class here}} | ||
| self = [super init]; // expected-warning{{designated initializer invoked a non-designated initializer}} | ||
| return self; | ||
| } | ||
| @end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fblocks -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'TestProperties::' | FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fblocks -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'TestProperties::' -fapinotes-swift-version=3 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-3 %s | ||
|
|
||
| @import VersionedKit; | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnly 'id' | ||
| // CHECK-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnlyForClass 'id' | ||
| // CHECK-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnlyInVersion3 'id' | ||
| // CHECK-3-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftVersionedAdditionAttr {{.+}} 3.0{{$}} | ||
| // CHECK-4-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnlyForClassInVersion3 'id' | ||
| // CHECK-3-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftVersionedAdditionAttr {{.+}} 3.0{{$}} | ||
| // CHECK-4-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnlyExceptInVersion3 'id' | ||
| // CHECK-3-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}} | ||
| // CHECK-3-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 3.0 {{[0-9]+}} | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: ObjCPropertyDecl {{.+}} accessorsOnlyForClassExceptInVersion3 'id' | ||
| // CHECK-3-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}} | ||
| // CHECK-3-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftImportPropertyAsAccessorsAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-4-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 3.0 {{[0-9]+}} | ||
| // CHECK-NOT: Attr | ||
|
|
||
| // CHECK-LABEL: Decl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fdisable-module-hash -fsyntax-only -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/SimpleKit.pcm | FileCheck %s | ||
| // RUN: %clang_cc1 -ast-dump -ast-dump-filter 'DUMP' %t/ModulesCache/SimpleKit.pcm | FileCheck -check-prefix CHECK-DUMP %s | ||
|
|
||
| #import <SimpleKit/SimpleKit.h> | ||
|
|
||
| // CHECK: void *getCFOwnedToUnowned(void) __attribute__((cf_returns_not_retained)); | ||
| // CHECK: void *getCFUnownedToOwned(void) __attribute__((cf_returns_retained)); | ||
| // CHECK: void *getCFOwnedToNone(void) __attribute__((cf_unknown_transfer)); | ||
| // CHECK: id getObjCOwnedToUnowned(void) __attribute__((ns_returns_not_retained)); | ||
| // CHECK: id getObjCUnownedToOwned(void) __attribute__((ns_returns_retained)); | ||
| // CHECK: int indirectGetCFOwnedToUnowned(void * _Nullable *out __attribute__((cf_returns_not_retained))); | ||
| // CHECK: int indirectGetCFUnownedToOwned(void * _Nullable *out __attribute__((cf_returns_retained))); | ||
| // CHECK: int indirectGetCFOwnedToNone(void * _Nullable *out); | ||
| // CHECK: int indirectGetCFNoneToOwned(void **out __attribute__((cf_returns_not_retained))); | ||
|
|
||
| // CHECK-LABEL: @interface MethodTest | ||
| // CHECK: - (id)getOwnedToUnowned __attribute__((ns_returns_not_retained)); | ||
| // CHECK: - (id)getUnownedToOwned __attribute__((ns_returns_retained)); | ||
| // CHECK: @end | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping getCFAuditedToUnowned_DUMP: | ||
| // CHECK-DUMP-NEXT: FunctionDecl | ||
| // CHECK-DUMP-NEXT: CFReturnsNotRetainedAttr | ||
| // CHECK-DUMP-NEXT: CFAuditedTransferAttr | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping getCFAuditedToOwned_DUMP: | ||
| // CHECK-DUMP-NEXT: FunctionDecl | ||
| // CHECK-DUMP-NEXT: CFReturnsRetainedAttr | ||
| // CHECK-DUMP-NEXT: CFAuditedTransferAttr | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping getCFAuditedToNone_DUMP: | ||
| // CHECK-DUMP-NEXT: FunctionDecl | ||
| // CHECK-DUMP-NEXT: CFUnknownTransferAttr | ||
| // CHECK-DUMP-NOT: Attr |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_FRAMEWORK=1 -verify | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %S/Inputs/APINotes -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_SEARCH_PATH=1 -verify | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -iapinotes-modules %S/Inputs/APINotes -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_FRAMEWORK=1 -verify | ||
|
|
||
| @import SomeOtherKit; | ||
|
|
||
| void test(A *a) { | ||
| #if FROM_FRAMEWORK | ||
| [a methodA]; // expected-error{{unavailable}} | ||
| [a methodB]; | ||
|
|
||
| // expected-note@SomeOtherKit/SomeOtherKit.h:5{{'methodA' has been explicitly marked unavailable here}} | ||
| #elif FROM_SEARCH_PATH | ||
| [a methodA]; | ||
| [a methodB]; // expected-error{{unavailable}} | ||
|
|
||
| // expected-note@SomeOtherKit/SomeOtherKit.h:6{{'methodB' has been explicitly marked unavailable here}} | ||
| #else | ||
| # error Not something we need to test | ||
| #endif | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -x c++ | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -x c++ -ast-dump -ast-dump-filter ImmortalRefType | FileCheck -check-prefix=CHECK-IMMORTAL %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers %s -x c++ -ast-dump -ast-dump-filter RefCountedType | FileCheck -check-prefix=CHECK-REF-COUNTED %s | ||
|
|
||
| #include <SwiftImportAs.h> | ||
|
|
||
| // CHECK-IMMORTAL: Dumping ImmortalRefType: | ||
| // CHECK-IMMORTAL-NEXT: CXXRecordDecl {{.+}} imported in SwiftImportAs {{.+}} struct ImmortalRefType | ||
| // CHECK-IMMORTAL: SwiftAttrAttr {{.+}} <<invalid sloc>> "import_reference" | ||
|
|
||
| // CHECK-REF-COUNTED: Dumping RefCountedType: | ||
| // CHECK-REF-COUNTED-NEXT: CXXRecordDecl {{.+}} imported in SwiftImportAs {{.+}} struct RefCountedType | ||
| // CHECK-REF-COUNTED: SwiftAttrAttr {{.+}} <<invalid sloc>> "import_reference" | ||
| // CHECK-REF-COUNTED: SwiftAttrAttr {{.+}} <<invalid sloc>> "retain:RCRetain" | ||
| // CHECK-REF-COUNTED: SwiftAttrAttr {{.+}} <<invalid sloc>> "release:RCRelease" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
|
|
||
| #include <PrivateLib.h> | ||
| #include <TopLevelPrivateKit/TopLevelPrivateKit_Private.h> | ||
|
|
||
| void *testPlain = PrivateLib; // expected-error {{initializing 'void *' with an expression of incompatible type 'float'}} | ||
| void *testFramework = TopLevelPrivateKit_Private; // expected-error {{initializing 'void *' with an expression of incompatible type 'float'}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
| // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -Wno-private-module -fdisable-module-hash -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -verify | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/SimpleKit.pcm | FileCheck %s | ||
|
|
||
| #import <SomeKit/SomeKit.h> | ||
| #import <SimpleKit/SimpleKit.h> | ||
|
|
||
| // CHECK: struct __attribute__((swift_name("SuccessfullyRenamedA"))) RenamedAgainInAPINotesA { | ||
| // CHECK: struct __attribute__((swift_name("SuccessfullyRenamedB"))) RenamedAgainInAPINotesB { | ||
|
|
||
| void test(OverriddenTypes *overridden) { | ||
| int *ip1 = global_int_ptr; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double (*)(int, int)'}} | ||
|
|
||
| int *ip2 = global_int_fun( // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}} | ||
| ip2, // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'double *'}} | ||
| ip2); // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'float *'}} | ||
|
|
||
| int *ip3 = [overridden // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}} | ||
| methodToMangle: ip3 // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'double *'}} | ||
| second: ip3]; // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'float *'}} | ||
|
|
||
| int *ip4 = overridden.intPropertyToMangle; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double *'}} | ||
| } | ||
|
|
||
| // expected-note@SomeKit/SomeKit.h:42{{passing argument to parameter 'ptr' here}} | ||
| // expected-note@SomeKit/SomeKit.h:42{{passing argument to parameter 'ptr2' here}} | ||
| // expected-note@SomeKit/SomeKit.h:48{{passing argument to parameter 'ptr1' here}} | ||
| // expected-note@SomeKit/SomeKit.h:48{{passing argument to parameter 'ptr2' here}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
|
|
||
| // Build and check the unversioned module file. | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Unversioned -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Unversioned/VersionedKit.pcm | FileCheck -check-prefix=CHECK-UNVERSIONED %s | ||
|
|
||
| // Build and check the various versions. | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned3 -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=3 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Versioned3/VersionedKit.pcm | FileCheck -check-prefix=CHECK-VERSIONED-3 %s | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned4 -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=4 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Versioned4/VersionedKit.pcm | FileCheck -check-prefix=CHECK-VERSIONED-4 %s | ||
|
|
||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned5 -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=5 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Versioned5/VersionedKit.pcm | FileCheck -check-prefix=CHECK-VERSIONED-5 %s | ||
|
|
||
| #import <VersionedKit/VersionedKit.h> | ||
|
|
||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef4; | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef4Notes __attribute__((swift_name("MultiVersionedTypedef4Notes_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef4Header __attribute__((swift_name("MultiVersionedTypedef4Header_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef34; | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef34Notes __attribute__((swift_name("MultiVersionedTypedef34Notes_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef34Header __attribute__((swift_name("MultiVersionedTypedef34Header_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef45; | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef45Notes __attribute__((swift_name("MultiVersionedTypedef45Notes_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef45Header __attribute__((swift_name("MultiVersionedTypedef45Header_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef345; | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef345Notes __attribute__((swift_name("MultiVersionedTypedef345Notes_NEW"))); | ||
| // CHECK-UNVERSIONED: typedef int MultiVersionedTypedef345Header __attribute__((swift_name("MultiVersionedTypedef345Header_NEW"))); | ||
|
|
||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef4 __attribute__((swift_name("MultiVersionedTypedef4_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef4Notes __attribute__((swift_name("MultiVersionedTypedef4Notes_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef4Header __attribute__((swift_name("MultiVersionedTypedef4Header_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef34 __attribute__((swift_name("MultiVersionedTypedef34_3"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef34Notes __attribute__((swift_name("MultiVersionedTypedef34Notes_3"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef34Header __attribute__((swift_name("MultiVersionedTypedef34Header_3"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef45 __attribute__((swift_name("MultiVersionedTypedef45_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef45Notes __attribute__((swift_name("MultiVersionedTypedef45Notes_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef45Header __attribute__((swift_name("MultiVersionedTypedef45Header_4"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef345 __attribute__((swift_name("MultiVersionedTypedef345_3"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef345Notes __attribute__((swift_name("MultiVersionedTypedef345Notes_3"))); | ||
| // CHECK-VERSIONED-3: typedef int MultiVersionedTypedef345Header __attribute__((swift_name("MultiVersionedTypedef345Header_3"))); | ||
|
|
||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef4 __attribute__((swift_name("MultiVersionedTypedef4_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef4Notes __attribute__((swift_name("MultiVersionedTypedef4Notes_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef4Header __attribute__((swift_name("MultiVersionedTypedef4Header_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef34 __attribute__((swift_name("MultiVersionedTypedef34_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef34Notes __attribute__((swift_name("MultiVersionedTypedef34Notes_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef34Header __attribute__((swift_name("MultiVersionedTypedef34Header_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef45 __attribute__((swift_name("MultiVersionedTypedef45_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef45Notes __attribute__((swift_name("MultiVersionedTypedef45Notes_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef45Header __attribute__((swift_name("MultiVersionedTypedef45Header_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef345 __attribute__((swift_name("MultiVersionedTypedef345_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef345Notes __attribute__((swift_name("MultiVersionedTypedef345Notes_4"))); | ||
| // CHECK-VERSIONED-4: typedef int MultiVersionedTypedef345Header __attribute__((swift_name("MultiVersionedTypedef345Header_4"))); | ||
|
|
||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef4; | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef4Notes __attribute__((swift_name("MultiVersionedTypedef4Notes_NEW"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef4Header __attribute__((swift_name("MultiVersionedTypedef4Header_NEW"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef34; | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef34Notes __attribute__((swift_name("MultiVersionedTypedef34Notes_NEW"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef34Header __attribute__((swift_name("MultiVersionedTypedef34Header_NEW"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef45 __attribute__((swift_name("MultiVersionedTypedef45_5"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef45Notes __attribute__((swift_name("MultiVersionedTypedef45Notes_5"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef45Header __attribute__((swift_name("MultiVersionedTypedef45Header_5"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef345 __attribute__((swift_name("MultiVersionedTypedef345_5"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef345Notes __attribute__((swift_name("MultiVersionedTypedef345Notes_5"))); | ||
| // CHECK-VERSIONED-5: typedef int MultiVersionedTypedef345Header __attribute__((swift_name("MultiVersionedTypedef345Header_5"))); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| // RUN: rm -rf %t && mkdir -p %t | ||
|
|
||
| // Build and check the unversioned module file. | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Unversioned -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Unversioned/VersionedKit.pcm | FileCheck -check-prefix=CHECK-UNVERSIONED %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Unversioned -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'DUMP' | FileCheck -check-prefix=CHECK-DUMP -check-prefix=CHECK-UNVERSIONED-DUMP %s | ||
|
|
||
| // Build and check the versioned module file. | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=3 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s | ||
| // RUN: %clang_cc1 -ast-print %t/ModulesCache/Versioned/VersionedKit.pcm | FileCheck -check-prefix=CHECK-VERSIONED %s | ||
| // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=3 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'DUMP' | FileCheck -check-prefix=CHECK-DUMP -check-prefix=CHECK-VERSIONED-DUMP %s | ||
|
|
||
| #import <VersionedKit/VersionedKit.h> | ||
|
|
||
| // CHECK-UNVERSIONED: void moveToPointDUMP(double x, double y) __attribute__((swift_name("moveTo(x:y:)"))); | ||
| // CHECK-VERSIONED: void moveToPointDUMP(double x, double y) __attribute__((swift_name("moveTo(a:b:)"))); | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping moveToPointDUMP | ||
| // CHECK-VERSIONED-DUMP: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}} | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "moveTo(x:y:)" | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "moveTo(a:b:)" | ||
| // CHECK-UNVERSIONED-DUMP: SwiftNameAttr {{.+}} "moveTo(x:y:)" | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}} | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "moveTo(a:b:)" | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping unversionedRenameDUMP | ||
| // CHECK-DUMP: in VersionedKit unversionedRenameDUMP | ||
| // CHECK-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 0 IsReplacedByActive{{$}} | ||
| // CHECK-DUMP-NEXT: SwiftNameAttr {{.+}} "unversionedRename_HEADER()" | ||
| // CHECK-DUMP-NEXT: SwiftNameAttr {{.+}} "unversionedRename_NOTES()" | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping TestGenericDUMP | ||
| // CHECK-VERSIONED-DUMP: SwiftImportAsNonGenericAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-UNVERSIONED-DUMP: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}} | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftImportAsNonGenericAttr {{.+}} <<invalid sloc>> | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping Swift3RenamedOnlyDUMP | ||
| // CHECK-DUMP: in VersionedKit Swift3RenamedOnlyDUMP | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 3.0 {{[0-9]+}} IsReplacedByActive{{$}} | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift3Name" | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}} | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift3Name" | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping Swift3RenamedAlsoDUMP | ||
| // CHECK-DUMP: in VersionedKit Swift3RenamedAlsoDUMP | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}} | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <line:{{.+}}, col:{{.+}}> "Swift4Name" | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift3Also" | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <line:{{.+}}, col:{{.+}}> "Swift4Name" | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}} | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift3Also" | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-LABEL: Dumping Swift4RenamedDUMP | ||
| // CHECK-DUMP: in VersionedKit Swift4RenamedDUMP | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 4 {{[0-9]+}} IsReplacedByActive{{$}} | ||
| // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift4Name" | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 4{{$}} | ||
| // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift4Name" | ||
| // CHECK-DUMP-NOT: Attr | ||
|
|
||
| // CHECK-DUMP-NOT: Dumping | ||
|
|
||
| // CHECK-UNVERSIONED: void acceptClosure(void (^block)(void) __attribute__((noescape))); | ||
| // CHECK-VERSIONED: void acceptClosure(void (^block)(void)); | ||
|
|
||
| // CHECK-UNVERSIONED: void privateFunc(void) __attribute__((swift_private)); | ||
|
|
||
| // CHECK-UNVERSIONED: typedef double MyDoubleWrapper __attribute__((swift_wrapper("struct"))); | ||
|
|
||
| // CHECK-UNVERSIONED: enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorCode { | ||
| // CHECK-UNVERSIONED-NEXT: MyErrorCodeFailed = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
|
|
||
| // CHECK-UNVERSIONED: __attribute__((swift_bridge("MyValueType"))) | ||
| // CHECK-UNVERSIONED: @interface MyReferenceType | ||
|
|
||
| // CHECK-VERSIONED: void privateFunc(void); | ||
|
|
||
| // CHECK-VERSIONED: typedef double MyDoubleWrapper; | ||
|
|
||
| // CHECK-VERSIONED: enum MyErrorCode { | ||
| // CHECK-VERSIONED-NEXT: MyErrorCodeFailed = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
|
|
||
| // CHECK-VERSIONED-NOT: __attribute__((swift_bridge("MyValueType"))) | ||
| // CHECK-VERSIONED: @interface MyReferenceType | ||
|
|
||
| // CHECK-UNVERSIONED: __attribute__((swift_objc_members) | ||
| // CHECK-UNVERSIONED-NEXT: @interface TestProperties | ||
| // CHECK-VERSIONED-NOT: __attribute__((swift_objc_members) | ||
| // CHECK-VERSIONED: @interface TestProperties | ||
|
|
||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) FlagEnum { | ||
| // CHECK-UNVERSIONED-NEXT: FlagEnumA = 1, | ||
| // CHECK-UNVERSIONED-NEXT: FlagEnumB = 2 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) NewlyFlagEnum { | ||
| // CHECK-UNVERSIONED-NEXT: NewlyFlagEnumA = 1, | ||
| // CHECK-UNVERSIONED-NEXT: NewlyFlagEnumB = 2 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) APINotedFlagEnum { | ||
| // CHECK-UNVERSIONED-NEXT: APINotedFlagEnumA = 1, | ||
| // CHECK-UNVERSIONED-NEXT: APINotedFlagEnumB = 2 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) OpenEnum { | ||
| // CHECK-UNVERSIONED-NEXT: OpenEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) NewlyOpenEnum { | ||
| // CHECK-UNVERSIONED-NEXT: NewlyOpenEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) NewlyClosedEnum { | ||
| // CHECK-UNVERSIONED-NEXT: NewlyClosedEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) ClosedToOpenEnum { | ||
| // CHECK-UNVERSIONED-NEXT: ClosedToOpenEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) OpenToClosedEnum { | ||
| // CHECK-UNVERSIONED-NEXT: OpenToClosedEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) APINotedOpenEnum { | ||
| // CHECK-UNVERSIONED-NEXT: APINotedOpenEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) APINotedClosedEnum { | ||
| // CHECK-UNVERSIONED-NEXT: APINotedClosedEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
|
|
||
| // CHECK-VERSIONED-LABEL: enum __attribute__((flag_enum)) FlagEnum { | ||
| // CHECK-VERSIONED-NEXT: FlagEnumA = 1, | ||
| // CHECK-VERSIONED-NEXT: FlagEnumB = 2 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum NewlyFlagEnum { | ||
| // CHECK-VERSIONED-NEXT: NewlyFlagEnumA = 1, | ||
| // CHECK-VERSIONED-NEXT: NewlyFlagEnumB = 2 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((flag_enum)) APINotedFlagEnum { | ||
| // CHECK-VERSIONED-NEXT: APINotedFlagEnumA = 1, | ||
| // CHECK-VERSIONED-NEXT: APINotedFlagEnumB = 2 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) OpenEnum { | ||
| // CHECK-VERSIONED-NEXT: OpenEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum NewlyOpenEnum { | ||
| // CHECK-VERSIONED-NEXT: NewlyOpenEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum NewlyClosedEnum { | ||
| // CHECK-VERSIONED-NEXT: NewlyClosedEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) ClosedToOpenEnum { | ||
| // CHECK-VERSIONED-NEXT: ClosedToOpenEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) OpenToClosedEnum { | ||
| // CHECK-VERSIONED-NEXT: OpenToClosedEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) APINotedOpenEnum { | ||
| // CHECK-VERSIONED-NEXT: APINotedOpenEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
| // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) APINotedClosedEnum { | ||
| // CHECK-VERSIONED-NEXT: APINotedClosedEnumA = 1 | ||
| // CHECK-VERSIONED-NEXT: }; | ||
|
|
||
| // These don't actually have versioned information, so we just check them once. | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) SoonToBeCFEnum { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeCFEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) SoonToBeNSEnum { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeNSEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) __attribute__((flag_enum)) SoonToBeCFOptions { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeCFOptionsA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) __attribute__((flag_enum)) SoonToBeNSOptions { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeNSOptionsA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) SoonToBeCFClosedEnum { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeCFClosedEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) SoonToBeNSClosedEnum { | ||
| // CHECK-UNVERSIONED-NEXT: SoonToBeNSClosedEnumA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; | ||
| // CHECK-UNVERSIONED-LABEL: enum UndoAllThatHasBeenDoneToMe { | ||
| // CHECK-UNVERSIONED-NEXT: UndoAllThatHasBeenDoneToMeA = 1 | ||
| // CHECK-UNVERSIONED-NEXT: }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // RUN: rm -rf %t | ||
| // RUN: not %clang_cc1 -fsyntax-only -fapinotes %s -I %S/Inputs/BrokenHeaders2 2>&1 | FileCheck %s | ||
|
|
||
| #include "SomeBrokenLib.h" | ||
|
|
||
| // CHECK: error: multiple definitions of global function 'do_something_with_pointers' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // RUN: rm -rf %t | ||
| // RUN: %clang_cc1 -fsyntax-only -fapinotes %s -I %S/Inputs/BrokenHeaders -verify | ||
|
|
||
| #include "SomeBrokenLib.h" | ||
|
|
||
| // expected-error@APINotes.apinotes:4{{unknown key 'Nu llabilityOfRet'}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // RUN: rm -rf %t | ||
| // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fapinotes -fapinotes-modules -fmodules-cache-path=%t -I %S/Inputs/yaml-reader-errors/ -fsyntax-only %s > %t.err 2>&1 | ||
| // RUN: FileCheck %S/Inputs/yaml-reader-errors/UIKit.apinotes < %t.err | ||
|
|
||
| @import UIKit; |