| 1 |
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s |
| 2 |
|
| 3 |
#define GEN_DECL_USR(mod_name, usr) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name, USR=usr, generated_declaration))) |
| 4 |
|
| 5 |
class GEN_DECL_USR("Module", "s:Class") Class { |
| 6 |
public: |
| 7 |
void method() GEN_DECL_USR("Module", "s:Class_method"); |
| 8 |
void method2() GEN_DECL_USR("Module", ""); |
| 9 |
|
| 10 |
static void staticMethod() GEN_DECL_USR("Module", "s:Class_staticMethod"); |
| 11 |
}; |
| 12 |
|
| 13 |
template<class T> |
| 14 |
class GEN_DECL_USR("Module", "s:TemplateClass") TemplateClass { |
| 15 |
public: |
| 16 |
void method() GEN_DECL_USR("Module", "s:TemplateClass_method"); |
| 17 |
}; |
| 18 |
|
| 19 |
void test() { |
| 20 |
Class c = Class(); |
| 21 |
// CHECK: [[@LINE-1]]:3 | class/Swift | Class | s:Class | |
| 22 |
// CHECK: [[@LINE-2]]:13 | class/Swift | Class | s:Class | |
| 23 |
c.method(); |
| 24 |
// CHECK: [[@LINE-1]]:5 | instance-method/Swift | method | s:Class_method | |
| 25 |
c.method2(); |
| 26 |
// CHECK: [[@LINE-1]]:5 | instance-method/Swift | method2 | c:@M@Module@S@Class@F@method2# | |
| 27 |
Class::staticMethod(); |
| 28 |
// CHECK: [[@LINE-1]]:10 | static-method/Swift | staticMethod | s:Class_staticMethod | |
| 29 |
// CHECK: [[@LINE-2]]:3 | class/Swift | Class | s:Class | |
| 30 |
TemplateClass<int> c2 = TemplateClass<int>(); |
| 31 |
// CHECK: [[@LINE-1]]:3 | class(Gen)/Swift | TemplateClass | s:TemplateClass | |
| 32 |
// CHECK: [[@LINE-2]]:27 | class(Gen)/Swift | TemplateClass | s:TemplateClass | |
| 33 |
c2.method(); |
| 34 |
// CHECK: [[@LINE-1]]:6 | instance-method/Swift | method | s:TemplateClass_method | |
| 35 |
} |