diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Index/Core/external-source-symbol-attr.m | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/clang/test/Index/Core/external-source-symbol-attr.m b/clang/test/Index/Core/external-source-symbol-attr.m index 800a03e4740..b0e9c159cd8 100644 --- a/clang/test/Index/Core/external-source-symbol-attr.m +++ b/clang/test/Index/Core/external-source-symbol-attr.m @@ -2,6 +2,7 @@ #define EXT_DECL(mod_name) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name))) #define GEN_DECL(mod_name) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name, generated_declaration))) +#define PUSH_GEN_DECL(mod_name) push(GEN_DECL(mod_name), apply_to=any(enum, objc_interface, objc_category, objc_protocol)) // This should not be indexed. GEN_DECL("some_module") @@ -37,14 +38,14 @@ EXT_DECL("some_module") EXT_DECL("cat_module") @interface I1(cat2) -// CHECK: [[@LINE-1]]:15 | extension/ObjC | cat2 | c:@M@cat_module-some_module@objc(cy)I1@cat2 | +// CHECK: [[@LINE-1]]:15 | extension/ObjC | cat2 | c:@CM@cat_module@some_module@objc(cy)I1@cat2 | -(void)cat_method2; -// CHECK: [[@LINE-1]]:8 | instance-method/ObjC | cat_method2 | c:@M@some_module@objc(cs)I1(im)cat_method2 +// CHECK: [[@LINE-1]]:8 | instance-method/ObjC | cat_method2 | c:@CM@cat_module@some_module@objc(cs)I1(im)cat_method2 @end #define NS_ENUM(_name, _type) enum _name:_type _name; enum _name : _type -#pragma clang attribute push(GEN_DECL("modname"), apply_to=any(enum, objc_interface, objc_category, objc_protocol)) +#pragma clang attribute PUSH_GEN_DECL("modname") @interface I3 // CHECK-NOT: [[@LINE-1]]:12 | @@ -80,9 +81,20 @@ void test2(I3 *i3, id<ExtProt2> prot2, SomeEnum some) { [i3 meth]; // CHECK: [[@LINE-1]]:7 | instance-method/ObjC | meth | c:@M@modname@objc(cs)I3(im)meth | [i3 meth2]; - // CHECK: [[@LINE-1]]:7 | instance-method/ObjC | meth2 | c:@M@modname@objc(cs)I3(im)meth2 | + // CHECK: [[@LINE-1]]:7 | instance-method/ObjC | meth2 | c:@CM@modname@objc(cs)I3(im)meth2 | [prot2 meth]; // CHECK: [[@LINE-1]]:10 | instance-method/ObjC | meth | c:@M@modname@objc(pl)ExtProt2(im)meth | some = SomeEnumFirst; // CHECK: [[@LINE-1]]:10 | enumerator/C | SomeEnumFirst | c:@M@modname@E@SomeEnum@SomeEnumFirst | } + +#pragma clang attribute PUSH_GEN_DECL("other_mod_for_cat") +@interface I3(cat_other_mod) +-(void)meth_other_mod; +@end +#pragma clang attribute pop + +void test3(I3 *i3) { + [i3 meth_other_mod]; + // CHECK: [[@LINE-1]]:7 | instance-method/ObjC | meth_other_mod | c:@CM@other_mod_for_cat@modname@objc(cs)I3(im)meth_other_mod | +} |

