Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Index / Core / external-source-symbol-attr-cxx.cpp
blobb3fb31c54a74208b2631888b6b8c2279d4ebfc7a
1 // XFAIL: target={{.*}}-aix{{.*}}
2 // RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
4 #define GEN_DECL_USR(mod_name, usr) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name, USR=usr, generated_declaration)))
6 class GEN_DECL_USR("Module", "s:Class") Class {
7 public:
8 void method() GEN_DECL_USR("Module", "s:Class_method");
9 void method2() GEN_DECL_USR("Module", "");
11 static void staticMethod() GEN_DECL_USR("Module", "s:Class_staticMethod");
14 template<class T>
15 class GEN_DECL_USR("Module", "s:TemplateClass") TemplateClass {
16 public:
17 void method() GEN_DECL_USR("Module", "s:TemplateClass_method");
20 void test() {
21 Class c = Class();
22 // CHECK: [[@LINE-1]]:3 | class/Swift | Class | s:Class |
23 // CHECK: [[@LINE-2]]:13 | class/Swift | Class | s:Class |
24 c.method();
25 // CHECK: [[@LINE-1]]:5 | instance-method/Swift | method | s:Class_method |
26 c.method2();
27 // CHECK: [[@LINE-1]]:5 | instance-method/Swift | method2 | c:@M@Module@S@Class@F@method2# |
28 Class::staticMethod();
29 // CHECK: [[@LINE-1]]:10 | static-method/Swift | staticMethod | s:Class_staticMethod |
30 // CHECK: [[@LINE-2]]:3 | class/Swift | Class | s:Class |
31 TemplateClass<int> c2 = TemplateClass<int>();
32 // CHECK: [[@LINE-1]]:3 | class(Gen)/Swift | TemplateClass | s:TemplateClass |
33 // CHECK: [[@LINE-2]]:27 | class(Gen)/Swift | TemplateClass | s:TemplateClass |
34 c2.method();
35 // CHECK: [[@LINE-1]]:6 | instance-method/Swift | method | s:TemplateClass_method |