[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / clang / test / Index / Core / external-source-symbol-attr-cxx.cpp
blob8ccf3c7d69496bd37e1350e9801dfc9e2554c6d0
1 // RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
3 #define GEN_DECL_USR(mod_name, usr) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name, USR=usr, generated_declaration)))
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", "");
10 static void staticMethod() GEN_DECL_USR("Module", "s:Class_staticMethod");
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");
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 |