|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +// RUN: %target-swift-symbolgraph-extract -sdk %clang-importer-sdk -module-name HeaderCollision -F %t -output-dir %t -pretty-print -v |
| 5 | +// RUN: %FileCheck %s --input-file %t/HeaderCollision.symbols.json --check-prefix MODULE |
| 6 | +// RUN: %FileCheck %s --input-file %t/ [email protected] --check-prefix EXTENSION |
| 7 | + |
| 8 | +// REQUIRES: objc_interop |
| 9 | + |
| 10 | +// Ensure that extensions to a dependency's types, declared in a header with the same name as the |
| 11 | +// dependency's type's header, correctly get sorted into an extension header rather than the module |
| 12 | +// itself. |
| 13 | + |
| 14 | +// MODULE: "symbols": [] |
| 15 | +// EXTENSION: "precise": "c:objc(cs)DependencyClass(im)addNumber:to:" |
| 16 | + |
| 17 | +//--- Dependency.framework/Modules/module.modulemap |
| 18 | +framework module Dependency { |
| 19 | + umbrella header "Dependency.h" |
| 20 | + export * |
| 21 | + module * { export * } |
| 22 | +} |
| 23 | + |
| 24 | +//--- Dependency.framework/Headers/Dependency.h |
| 25 | +#import <Dependency/DependencyClass.h> |
| 26 | + |
| 27 | +//--- Dependency.framework/Headers/DependencyClass.h |
| 28 | +@import Foundation; |
| 29 | + |
| 30 | +@class DependencyClass; |
| 31 | + |
| 32 | +@interface DependencyClass : NSObject |
| 33 | + |
| 34 | +@end |
| 35 | +
|
| 36 | +//--- HeaderCollision.framework/Modules/module.modulemap |
| 37 | +framework module HeaderCollision { |
| 38 | + umbrella header "HeaderCollision.h" |
| 39 | + export * |
| 40 | + module * { export * } |
| 41 | +} |
| 42 | + |
| 43 | +//--- HeaderCollision.framework/Headers/HeaderCollision.h |
| 44 | +#import <HeaderCollision/DependencyClass.h> |
| 45 | + |
| 46 | +//--- HeaderCollision.framework/Headers/DependencyClass.h |
| 47 | +#import <Dependency/DependencyClass.h> |
| 48 | + |
| 49 | +@interface DependencyClass (HeaderCollisionClassAdditions) |
| 50 | + |
| 51 | +- (NSInteger)addNumber:(NSInteger)x to:(NSInteger)y; |
| 52 | + |
| 53 | +@end |
0 commit comments