diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Index | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/Index')
217 files changed, 15652 insertions, 0 deletions
diff --git a/clang/test/Index/IBOutletCollection.m b/clang/test/Index/IBOutletCollection.m new file mode 100644 index 0000000..a95df86 --- /dev/null +++ b/clang/test/Index/IBOutletCollection.m @@ -0,0 +1,18 @@ +#define IBOutletCollection(ClassName) __attribute__((iboutletcollection(ClassName))) + +@interface Test { + IBOutletCollection(Test) Test *anOutletCollection; +} +@end + +// RUN: c-index-test -cursor-at=%s:4:24 %s | FileCheck -check-prefix=CHECK-CURSOR %s +// CHECK-CURSOR: ObjCClassRef=Test:3:12 + +// RUN: c-index-test -test-annotate-tokens=%s:4:1:5:1 %s | FileCheck -check-prefix=CHECK-TOK %s +// CHECK-TOK: Identifier: "IBOutletCollection" [4:3 - 4:21] macro expansion=IBOutletCollection:1:9 +// CHECK-TOK: Punctuation: "(" [4:21 - 4:22] ObjCInterfaceDecl=Test:3:12 +// CHECK-TOK: Identifier: "Test" [4:22 - 4:26] ObjCClassRef=Test:3:12 +// CHECK-TOK: Punctuation: ")" [4:26 - 4:27] ObjCIvarDecl=anOutletCollection:4:34 (Definition) +// CHECK-TOK: Identifier: "Test" [4:28 - 4:32] ObjCClassRef=Test:3:12 +// CHECK-TOK: Punctuation: "*" [4:33 - 4:34] ObjCIvarDecl=anOutletCollection:4:34 (Definition) +// CHECK-TOK: Identifier: "anOutletCollection" [4:34 - 4:52] ObjCIvarDecl=anOutletCollection:4:34 (Definition) diff --git a/clang/test/Index/Inputs/Frameworks/Framework.framework/Headers/Framework.h b/clang/test/Index/Inputs/Frameworks/Framework.framework/Headers/Framework.h new file mode 100644 index 0000000..3e3830a --- /dev/null +++ b/clang/test/Index/Inputs/Frameworks/Framework.framework/Headers/Framework.h @@ -0,0 +1,2 @@ +int *getFrameworkVersion(); + diff --git a/clang/test/Index/Inputs/Headers/a.h b/clang/test/Index/Inputs/Headers/a.h new file mode 100644 index 0000000..33c3417 --- /dev/null +++ b/clang/test/Index/Inputs/Headers/a.h @@ -0,0 +1,2 @@ +int *getA(); + diff --git a/clang/test/Index/Inputs/Headers/a_extensions.h b/clang/test/Index/Inputs/Headers/a_extensions.h new file mode 100644 index 0000000..2155787 --- /dev/null +++ b/clang/test/Index/Inputs/Headers/a_extensions.h @@ -0,0 +1 @@ +int *getAExtensions(); diff --git a/clang/test/Index/Inputs/Headers/crash.h b/clang/test/Index/Inputs/Headers/crash.h new file mode 100644 index 0000000..238359a --- /dev/null +++ b/clang/test/Index/Inputs/Headers/crash.h @@ -0,0 +1,6 @@ +// Produce a crash if CRASH is defined. +#ifdef CRASH +# pragma clang __debug crash +#endif + +const char *getCrashString(); diff --git a/clang/test/Index/Inputs/Headers/module.map b/clang/test/Index/Inputs/Headers/module.map new file mode 100644 index 0000000..55f8eb7 --- /dev/null +++ b/clang/test/Index/Inputs/Headers/module.map @@ -0,0 +1,10 @@ +module LibA { + header "a.h" + module Extensions { + header "a_extensions.h" + } +} + +module Crash { + header "crash.h" +} diff --git a/clang/test/Index/Inputs/Headers/nested/module.map b/clang/test/Index/Inputs/Headers/nested/module.map new file mode 100644 index 0000000..bd239f1 --- /dev/null +++ b/clang/test/Index/Inputs/Headers/nested/module.map @@ -0,0 +1,4 @@ +module nested { + header "nested.h" +} + diff --git a/clang/test/Index/Inputs/Headers/nested/nested.h b/clang/test/Index/Inputs/Headers/nested/nested.h new file mode 100644 index 0000000..01716d1 --- /dev/null +++ b/clang/test/Index/Inputs/Headers/nested/nested.h @@ -0,0 +1 @@ +int *getNested(); diff --git a/clang/test/Index/Inputs/a.h b/clang/test/Index/Inputs/a.h new file mode 100644 index 0000000..70ace8c --- /dev/null +++ b/clang/test/Index/Inputs/a.h @@ -0,0 +1,4 @@ +#ifndef A_H +#define A_H +typedef int A; +#endif diff --git a/clang/test/Index/Inputs/b.h b/clang/test/Index/Inputs/b.h new file mode 100644 index 0000000..02591d2 --- /dev/null +++ b/clang/test/Index/Inputs/b.h @@ -0,0 +1 @@ +typedef float B; diff --git a/clang/test/Index/Inputs/c-index-pch.h b/clang/test/Index/Inputs/c-index-pch.h new file mode 100644 index 0000000..6dda180 --- /dev/null +++ b/clang/test/Index/Inputs/c-index-pch.h @@ -0,0 +1,7 @@ +#ifndef C_INDEX_PCH_H +#define C_INDEX_PCH_H + +void foo(int i, float f); +extern int bar; + +#endif // C_INDEX_PCH_H diff --git a/clang/test/Index/Inputs/cindex-from-source.h b/clang/test/Index/Inputs/cindex-from-source.h new file mode 100644 index 0000000..d13d397 --- /dev/null +++ b/clang/test/Index/Inputs/cindex-from-source.h @@ -0,0 +1 @@ +typedef int t0; diff --git a/clang/test/Index/Inputs/complete-pch.h b/clang/test/Index/Inputs/complete-pch.h new file mode 100644 index 0000000..ddf5253 --- /dev/null +++ b/clang/test/Index/Inputs/complete-pch.h @@ -0,0 +1,10 @@ +@interface A +- (int)instanceMethod1:(int)x; ++ (int)classMethod1:(double)d; +@end + +@interface B +- (int)instanceMethod2:(int)x; ++ (int)classMethod2:(float)f; +@end + diff --git a/clang/test/Index/Inputs/crash-recovery-code-complete-remap.c b/clang/test/Index/Inputs/crash-recovery-code-complete-remap.c new file mode 100644 index 0000000..50a8658 --- /dev/null +++ b/clang/test/Index/Inputs/crash-recovery-code-complete-remap.c @@ -0,0 +1,12 @@ +// RUN: echo env CINDEXTEST_EDITING=1 \ +// RUN: not c-index-test -test-load-source-reparse 1 local \ +// RUN: -remap-file="%s;%S/Inputs/crash-recovery-code-complete-remap.c" \ +// RUN: %s 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-CODE-COMPLETE-CRASH %s +// CHECK-CODE-COMPLETE-CRASH: Unable to reparse translation unit +// +// XFAIL: win32 + +#warning parsing original file + +#pragma clang __debug crash diff --git a/clang/test/Index/Inputs/crash-recovery-reparse-remap.c b/clang/test/Index/Inputs/crash-recovery-reparse-remap.c new file mode 100644 index 0000000..0357dbe --- /dev/null +++ b/clang/test/Index/Inputs/crash-recovery-reparse-remap.c @@ -0,0 +1,11 @@ + +#warning parsing remapped file + + + +int x; + +#pragma clang __debug crash + +int x; + diff --git a/clang/test/Index/Inputs/foo.h b/clang/test/Index/Inputs/foo.h new file mode 100644 index 0000000..7670c00 --- /dev/null +++ b/clang/test/Index/Inputs/foo.h @@ -0,0 +1,8 @@ +extern int global_var; + +void foo_func(int param1); +void bar_func(void); + +struct MyStruct { + int field_var; +}; diff --git a/clang/test/Index/Inputs/get-cursor-includes-1.h b/clang/test/Index/Inputs/get-cursor-includes-1.h new file mode 100644 index 0000000..48439d2 --- /dev/null +++ b/clang/test/Index/Inputs/get-cursor-includes-1.h @@ -0,0 +1,6 @@ +#ifndef GET_CURSOR_INCLUDES_1_H +#define GET_CURSOR_INCLUDES_1_H + +extern int blah; + +#endif // GET_CURSOR_INCLUDES_1_H diff --git a/clang/test/Index/Inputs/get-cursor-includes-2.h b/clang/test/Index/Inputs/get-cursor-includes-2.h new file mode 100644 index 0000000..cf95c18 --- /dev/null +++ b/clang/test/Index/Inputs/get-cursor-includes-2.h @@ -0,0 +1,2 @@ +#include "get-cursor-includes-1.h" +#include "get-cursor-includes-1.h" diff --git a/clang/test/Index/Inputs/guarded.h b/clang/test/Index/Inputs/guarded.h new file mode 100644 index 0000000..0a1a6ac --- /dev/null +++ b/clang/test/Index/Inputs/guarded.h @@ -0,0 +1,6 @@ +#ifndef GUARDED_HEADER_H +#define GUARDED_HEADER_H + +int y; + +#endif // GUARDED_HEADER_H diff --git a/clang/test/Index/Inputs/lit.local.cfg b/clang/test/Index/Inputs/lit.local.cfg new file mode 100644 index 0000000..e6f55ee --- /dev/null +++ b/clang/test/Index/Inputs/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = [] diff --git a/clang/test/Index/Inputs/objc.h b/clang/test/Index/Inputs/objc.h new file mode 100644 index 0000000..c671add --- /dev/null +++ b/clang/test/Index/Inputs/objc.h @@ -0,0 +1,11 @@ +@interface Base { + int my_var; +} +-(int) my_var; +-(void) my_method: (int)param; ++(void) my_method: (int)param; +@end + +@interface Sub : Base +-(void) my_method: (int)param; +@end diff --git a/clang/test/Index/Inputs/pragma-once.h b/clang/test/Index/Inputs/pragma-once.h new file mode 100644 index 0000000..503cb3f --- /dev/null +++ b/clang/test/Index/Inputs/pragma-once.h @@ -0,0 +1,3 @@ +#pragma once +int i; + diff --git a/clang/test/Index/Inputs/pragma_disable_warning.h b/clang/test/Index/Inputs/pragma_disable_warning.h new file mode 100644 index 0000000..b40e9e7 --- /dev/null +++ b/clang/test/Index/Inputs/pragma_disable_warning.h @@ -0,0 +1 @@ +#pragma clang diagnostic ignored "-Wunused-parameter" diff --git a/clang/test/Index/Inputs/preamble-reparse-1.c b/clang/test/Index/Inputs/preamble-reparse-1.c new file mode 100644 index 0000000..139597f --- /dev/null +++ b/clang/test/Index/Inputs/preamble-reparse-1.c @@ -0,0 +1,2 @@ + + diff --git a/clang/test/Index/Inputs/preamble-reparse-2.c b/clang/test/Index/Inputs/preamble-reparse-2.c new file mode 100644 index 0000000..6d1a0d4 --- /dev/null +++ b/clang/test/Index/Inputs/preamble-reparse-2.c @@ -0,0 +1 @@ +int x; diff --git a/clang/test/Index/Inputs/preamble.h b/clang/test/Index/Inputs/preamble.h new file mode 100644 index 0000000..b59c234 --- /dev/null +++ b/clang/test/Index/Inputs/preamble.h @@ -0,0 +1,6 @@ +inline int bar(int i) { + int *ptr = 0; + float *ptr1; + ptr = ptr1; + return 0; +} diff --git a/clang/test/Index/Inputs/preamble_macro_template.h b/clang/test/Index/Inputs/preamble_macro_template.h new file mode 100644 index 0000000..18b076d --- /dev/null +++ b/clang/test/Index/Inputs/preamble_macro_template.h @@ -0,0 +1,6 @@ +#define STATIC_CAST static_cast + +template<typename T> +void foo(T *p) { + (void)STATIC_CAST<T*>(0); +} diff --git a/clang/test/Index/Inputs/prefix.h b/clang/test/Index/Inputs/prefix.h new file mode 100644 index 0000000..82ba2da --- /dev/null +++ b/clang/test/Index/Inputs/prefix.h @@ -0,0 +1,4 @@ +#ifndef PREFIX_H +#define PREFIX_H +int foo(int); +#endif diff --git a/clang/test/Index/Inputs/redeclarations.h b/clang/test/Index/Inputs/redeclarations.h new file mode 100644 index 0000000..7f0d7ae --- /dev/null +++ b/clang/test/Index/Inputs/redeclarations.h @@ -0,0 +1,21 @@ +class X +{ + friend class A; +}; + + +template <typename T1, typename T2> +class B +{ +}; + +template <class T> +struct C +{ +}; + +class D +{ + B<D, class A> x; + friend struct C<A>; +}; diff --git a/clang/test/Index/Inputs/remap-complete-to.c b/clang/test/Index/Inputs/remap-complete-to.c new file mode 100644 index 0000000..30199db --- /dev/null +++ b/clang/test/Index/Inputs/remap-complete-to.c @@ -0,0 +1,6 @@ +int f0(int *pointer1, float *pointer2) { + return pointer2 - pointer1; +} + +void g() { + diff --git a/clang/test/Index/Inputs/remap-load-to.c b/clang/test/Index/Inputs/remap-load-to.c new file mode 100644 index 0000000..8f9e1eb --- /dev/null +++ b/clang/test/Index/Inputs/remap-load-to.c @@ -0,0 +1,3 @@ +int foo(int parm1, float parm2) { + return parm1 + parm2; +} diff --git a/clang/test/Index/Inputs/reparse-instantiate.h b/clang/test/Index/Inputs/reparse-instantiate.h new file mode 100644 index 0000000..df90a6d --- /dev/null +++ b/clang/test/Index/Inputs/reparse-instantiate.h @@ -0,0 +1,14 @@ +template <typename T> struct S; + +template<typename T> void c(T) +{ +} + +template <> struct S <int> +{ + void a() + { + c(&S<int>::b); + } + void b() {} +}; diff --git a/clang/test/Index/Inputs/t1.c b/clang/test/Index/Inputs/t1.c new file mode 100644 index 0000000..ceaad4c --- /dev/null +++ b/clang/test/Index/Inputs/t1.c @@ -0,0 +1,28 @@ +#include "foo.h" + +void foo_func(int param1) { + int local_var = global_var; + for (int for_var = 100; for_var < 500; ++for_var) { + local_var = param1 + for_var; + } + bar_func(); +} + +struct S1 { + int x; +}; + +struct S2 { + int x; +}; + +void field_test(void) { + struct S1 s1; + s1.x = 0; + ((struct S2 *)0)->x = 0; + + struct MyStruct ms; + ms.field_var = 10; +} + +int (^CP)(int) = ^(int x) { return x * global_var; }; diff --git a/clang/test/Index/Inputs/t1.m b/clang/test/Index/Inputs/t1.m new file mode 100644 index 0000000..b7c86cd --- /dev/null +++ b/clang/test/Index/Inputs/t1.m @@ -0,0 +1,20 @@ +#include "objc.h" + +static void foo() { + Base *base; + int x = [base my_var]; + [base my_method:x]; + [Base my_method:x]; +} + +@implementation Base +-(int) my_var { + return my_var; +} + +-(void) my_method: (int)param { +} + ++(void) my_method: (int)param { +} +@end diff --git a/clang/test/Index/Inputs/t2.c b/clang/test/Index/Inputs/t2.c new file mode 100644 index 0000000..76d5d6c --- /dev/null +++ b/clang/test/Index/Inputs/t2.c @@ -0,0 +1,11 @@ +#include "foo.h" + +int global_var = 10; + +void bar_func(void) { + global_var += 100; + foo_func(global_var); + + struct MyStruct *ms; + ms->field_var = 10; +} diff --git a/clang/test/Index/Inputs/t2.m b/clang/test/Index/Inputs/t2.m new file mode 100644 index 0000000..3f103ee --- /dev/null +++ b/clang/test/Index/Inputs/t2.m @@ -0,0 +1,13 @@ +#include "objc.h" + +static void foo() { + Sub *sub; + int x = [sub my_var]; + [sub my_method:x]; + [Sub my_method:x]; +} + +@implementation Sub +-(void) my_method: (int)param { +} +@end diff --git a/clang/test/Index/TestClassDecl.m b/clang/test/Index/TestClassDecl.m new file mode 100644 index 0000000..038353b --- /dev/null +++ b/clang/test/Index/TestClassDecl.m @@ -0,0 +1,33 @@ +// RUN: c-index-test -write-pch %t.ast -fobjc-nonfragile-abi -fblocks -x objective-c %s +// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s +// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s + +// This test checks how the @class resolves as a cursor when there is a real definition +// that follows. <rdar://problem/7383421> + +@class Foo; + +@interface Foo +@end + +void function(Foo * arg) +{ + // nothing here. +} + +// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8 +// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12 +// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12 +// CHECK-scan: [11:5 - 13:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [13:1 - 13:15] FunctionDecl=function:13:6 (Definition) +// CHECK-scan: [13:15 - 13:18] ObjCClassRef=Foo:10:12 +// CHECK-scan: [13:18 - 13:24] ParmDecl=arg:13:21 (Definition) +// CHECK-scan: [13:24 - 14:1] FunctionDecl=function:13:6 (Definition) +// CHECK-scan: [14:1 - 16:2] CompoundStmt= + +// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 Extent=[10:1 - 11:5] +// CHECK-load: TestClassDecl.m:13:6: FunctionDecl=function:13:6 (Definition) Extent=[13:1 - 16:2] +// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 (Definition) Extent=[13:15 - 13:24] + diff --git a/clang/test/Index/TestClassForwardDecl.m b/clang/test/Index/TestClassForwardDecl.m new file mode 100644 index 0000000..2f32d33 --- /dev/null +++ b/clang/test/Index/TestClassForwardDecl.m @@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast +// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s +// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s + +// This test checks how the @class resolves as a cursor when the @interface is implicitly defined. +// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>) + +@class Foo; + +void function(Foo * arg) +{ + // nothing here. +} + +// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8 +// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8 +// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition) +// CHECK-scan: [10:15 - 10:18] ObjCClassRef=Foo:8:8 +// CHECK-scan: [10:18 - 10:24] ParmDecl=arg:10:21 (Definition) +// CHECK-scan: [10:24 - 11:1] FunctionDecl=function:10:6 (Definition) +// CHECK: [11:1 - 13:2] CompundStmt= + + + + + + + + + + + + + + + +// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition) +// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 + diff --git a/clang/test/Index/annotate-attribute.cpp b/clang/test/Index/annotate-attribute.cpp new file mode 100644 index 0000000..d822210 --- /dev/null +++ b/clang/test/Index/annotate-attribute.cpp @@ -0,0 +1,33 @@ +// RUN: c-index-test -test-load-source all %s | FileCheck %s + +class Test { +public: + __attribute__((annotate("spiffy_method"))) void aMethod(); + +public __attribute__((annotate("works"))): + void anotherMethod(); // annotation attribute should be propagated. + +private __attribute__((annotate("investigations"))): + //propagated annotation should have changed from "works" to "investigations" + void inlineMethod() {} + +protected: + // attribute propagation should have stopped here + void methodWithoutAttribute(); +}; + +// CHECK: ClassDecl=Test:3:7 (Definition) Extent=[3:1 - 17:2] +// CHECK-NEXT: CXXAccessSpecifier=:4:1 (Definition) Extent=[4:1 - 4:8] +// CHECK-NEXT: CXXMethod=aMethod:5:51 Extent=[5:3 - 5:60] +// CHECK-NEXT: attribute(annotate)=spiffy_method Extent=[5:18 - 5:43] +// CHECK-NEXT: CXXAccessSpecifier=:7:1 (Definition) Extent=[7:1 - 7:43] +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK-NEXT: CXXMethod=anotherMethod:8:8 Extent=[8:3 - 8:23] +// CHECK-NEXT: attribute(annotate)=works Extent=[7:23 - 7:40] +// CHECK-NEXT: CXXAccessSpecifier=:10:1 (Definition) Extent=[10:1 - 10:53] +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK-NEXT: CXXMethod=inlineMethod:12:8 (Definition) Extent=[12:3 - 12:25] +// CHECK-NEXT: attribute(annotate)=investigations Extent=[10:24 - 10:50] +// CHECK-NEXT: CompoundStmt= Extent=[12:23 - 12:25] +// CHECK-NEXT: CXXAccessSpecifier=:14:1 (Definition) Extent=[14:1 - 14:11] +// CHECK-NEXT: CXXMethod=methodWithoutAttribute:16:8 Extent=[16:3 - 16:32] diff --git a/clang/test/Index/annotate-context-sensitive.cpp b/clang/test/Index/annotate-context-sensitive.cpp new file mode 100644 index 0000000..34e67a2 --- /dev/null +++ b/clang/test/Index/annotate-context-sensitive.cpp @@ -0,0 +1,42 @@ +class Base { +public: + virtual void f(); +}; + +class Derived final : public Base { + virtual void f() override final; + + struct final { }; +}; + +typedef int override; +struct Base2 { + virtual int override(); +}; + +struct Derived2 : Base2 { + ::override override() override; +}; + +// RUN: c-index-test -test-annotate-tokens=%s:6:1:19:1 %s | FileCheck -check-prefix=CHECK-OVERRIDE-FINAL %s + +// CHECK-OVERRIDE-FINAL: Keyword: "class" [6:1 - 6:6] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Identifier: "Derived" [6:7 - 6:14] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "final" [6:15 - 6:20] attribute(final)= +// CHECK-OVERRIDE-FINAL: Punctuation: ":" [6:21 - 6:22] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "public" [6:23 - 6:29] C++ base class specifier=class Base:1:7 [access=public isVirtual=false] +// CHECK-OVERRIDE-FINAL: Identifier: "Base" [6:30 - 6:34] TypeRef=class Base:1:7 +// CHECK-OVERRIDE-FINAL: Punctuation: "{" [6:35 - 6:36] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "virtual" [7:3 - 7:10] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "void" [7:11 - 7:15] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Identifier: "f" [7:16 - 7:17] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Punctuation: "(" [7:17 - 7:18] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Punctuation: ")" [7:18 - 7:19] CXXMethod=f:7:16 (virtual) [Overrides @3:16] +// CHECK-OVERRIDE-FINAL: Keyword: "override" [7:20 - 7:28] attribute(override)= +// CHECK-OVERRIDE-FINAL: Keyword: "final" [7:29 - 7:34] attribute(final)= +// CHECK-OVERRIDE-FINAL: Punctuation: ";" [7:34 - 7:35] ClassDecl=Derived:6:7 (Definition) +// CHECK-OVERRIDE-FINAL: Keyword: "struct" [9:3 - 9:9] StructDecl=final:9:10 (Definition) +// CHECK-OVERRIDE-FINAL: Identifier: "final" [9:10 - 9:15] StructDecl=final:9:10 (Definition) +// CHECK-OVERRIDE-FINAL: Punctuation: "{" [9:16 - 9:17] StructDecl=final:9:10 (Definition) +// CHECK-OVERRIDE-FINAL: Punctuation: "}" [9:18 - 9:19] StructDecl=final:9:10 (Definition) +// CHECK-OVERRIDE-FINAL: Punctuation: ";" [9:19 - 9:20] ClassDecl=Derived:6:7 (Definition) diff --git a/clang/test/Index/annotate-literals.m b/clang/test/Index/annotate-literals.m new file mode 100644 index 0000000..20bfd2c --- /dev/null +++ b/clang/test/Index/annotate-literals.m @@ -0,0 +1,72 @@ +typedef unsigned char BOOL; + +@interface NSNumber @end + +@interface NSNumber (NSNumberCreation) ++ (NSNumber *)numberWithChar:(char)value; ++ (NSNumber *)numberWithUnsignedChar:(unsigned char)value; ++ (NSNumber *)numberWithShort:(short)value; ++ (NSNumber *)numberWithUnsignedShort:(unsigned short)value; ++ (NSNumber *)numberWithInt:(int)value; ++ (NSNumber *)numberWithUnsignedInt:(unsigned int)value; ++ (NSNumber *)numberWithLong:(long)value; ++ (NSNumber *)numberWithUnsignedLong:(unsigned long)value; ++ (NSNumber *)numberWithLongLong:(long long)value; ++ (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value; ++ (NSNumber *)numberWithFloat:(float)value; ++ (NSNumber *)numberWithDouble:(double)value; ++ (NSNumber *)numberWithBool:(BOOL)value; +@end + +@interface NSArray +@end + +@interface NSArray (NSArrayCreation) ++ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; +@end + +@interface NSDictionary ++ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt; +@end + +void test_literals(id k1, id o1, id k2, id o2, id k3) { + id objects = @[ o1, o2 ]; + id dict = @{ k1 : o1, + k2 : o2, + k3 : @17 }; +} + + +// RUN: c-index-test -test-annotate-tokens=%s:33:1:37:1 %s | FileCheck -check-prefix=CHECK-LITERALS %s + +// CHECK-LITERALS: Identifier: "id" [33:3 - 33:5] TypeRef=id:0:0 +// CHECK-LITERALS: Identifier: "objects" [33:6 - 33:13] VarDecl=objects:33:6 (Definition) +// CHECK-LITERALS: Punctuation: "=" [33:14 - 33:15] VarDecl=objects:33:6 (Definition) +// CHECK-LITERALS: Punctuation: "@" [33:16 - 33:17] UnexposedExpr= +// CHECK-LITERALS: Punctuation: "[" [33:17 - 33:18] UnexposedExpr= +// CHECK-LITERALS: Identifier: "o1" [33:19 - 33:21] DeclRefExpr=o1:32:30 +// CHECK-LITERALS: Punctuation: "," [33:21 - 33:22] UnexposedExpr= +// CHECK-LITERALS: Identifier: "o2" [33:23 - 33:25] DeclRefExpr=o2:32:44 +// CHECK-LITERALS: Punctuation: "]" [33:26 - 33:27] UnexposedExpr= +// CHECK-LITERALS: Punctuation: ";" [33:27 - 33:28] DeclStmt= +// CHECK-LITERALS: Identifier: "id" [34:3 - 34:5] TypeRef=id:0:0 +// CHECK-LITERALS: Identifier: "dict" [34:6 - 34:10] VarDecl=dict:34:6 (Definition) +// CHECK-LITERALS: Punctuation: "=" [34:11 - 34:12] VarDecl=dict:34:6 (Definition) +// CHECK-LITERALS: Punctuation: "@" [34:13 - 34:14] UnexposedExpr= +// CHECK-LITERALS: Punctuation: "{" [34:14 - 34:15] UnexposedExpr= +// CHECK-LITERALS: Identifier: "k1" [34:16 - 34:18] DeclRefExpr=k1:32:23 +// CHECK-LITERALS: Punctuation: ":" [34:19 - 34:20] UnexposedExpr= +// CHECK-LITERALS: Identifier: "o1" [34:21 - 34:23] DeclRefExpr=o1:32:30 +// CHECK-LITERALS: Punctuation: "," [34:23 - 34:24] UnexposedExpr= +// CHECK-LITERALS: Identifier: "k2" [35:16 - 35:18] DeclRefExpr=k2:32:37 +// CHECK-LITERALS: Punctuation: ":" [35:19 - 35:20] UnexposedExpr= +// CHECK-LITERALS: Identifier: "o2" [35:21 - 35:23] DeclRefExpr=o2:32:44 +// CHECK-LITERALS: Punctuation: "," [35:23 - 35:24] UnexposedExpr= +// CHECK-LITERALS: Identifier: "k3" [36:16 - 36:18] DeclRefExpr=k3:32:51 +// CHECK-LITERALS: Punctuation: ":" [36:19 - 36:20] UnexposedExpr= +// CHECK-LITERALS: Punctuation: "@" [36:21 - 36:22] UnexposedExpr= +// CHECK-LITERALS: Literal: "17" [36:22 - 36:24] IntegerLiteral= +// CHECK-LITERALS: Punctuation: "}" [36:25 - 36:26] UnexposedExpr= +// CHECK-LITERALS: Punctuation: ";" [36:26 - 36:27] DeclStmt= +// CHECK-LITERALS: Punctuation: "}" [37:1 - 37:2] CompoundStmt= + diff --git a/clang/test/Index/annotate-macro-args.h b/clang/test/Index/annotate-macro-args.h new file mode 100644 index 0000000..40ec8dc --- /dev/null +++ b/clang/test/Index/annotate-macro-args.h @@ -0,0 +1,16 @@ +@interface MyClass ++(void)meth; +@end + +#define MACRO2(x) x +#define MACRO(x) MACRO2(x) + +void test() { + MACRO([MyClass meth]); +} + +#define INVOKE(METHOD, CLASS) [CLASS METHOD] + +void test2() { + INVOKE(meth, MyClass); +} diff --git a/clang/test/Index/annotate-macro-args.m b/clang/test/Index/annotate-macro-args.m new file mode 100644 index 0000000..b92c0b2 --- /dev/null +++ b/clang/test/Index/annotate-macro-args.m @@ -0,0 +1,23 @@ +// Test without PCH +// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:9:1:10:1 %s -include annotate-macro-args.h | FileCheck -check-prefix=CHECK1 %s +// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:15:1:16:1 %s -include annotate-macro-args.h | FileCheck -check-prefix=CHECK2 %s + +// Test with PCH +// RUN: c-index-test -write-pch %t.pch -x objective-c-header %S/annotate-macro-args.h -Xclang -detailed-preprocessing-record +// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:9:1:10:1 %s -include-pch %t.pch | FileCheck -check-prefix=CHECK1 %s +// RUN: c-index-test -test-annotate-tokens=%S/annotate-macro-args.h:15:1:16:1 %s -include-pch %t.pch | FileCheck -check-prefix=CHECK2 %s + +// CHECK1: Identifier: "MACRO" [9:3 - 9:8] macro expansion=MACRO:6:9 +// CHECK1: Punctuation: "(" [9:8 - 9:9] +// CHECK1: Punctuation: "[" [9:9 - 9:10] ObjCMessageExpr=meth:2:8 +// CHECK1: Identifier: "MyClass" [9:10 - 9:17] ObjCClassRef=MyClass:1:12 +// CHECK1: Identifier: "meth" [9:18 - 9:22] ObjCMessageExpr=meth:2:8 +// CHECK1: Punctuation: "]" [9:22 - 9:23] ObjCMessageExpr=meth:2:8 +// CHECK1: Punctuation: ")" [9:23 - 9:24] + +// CHECK2: Identifier: "INVOKE" [15:3 - 15:9] macro expansion=INVOKE:12:9 +// CHECK2: Punctuation: "(" [15:9 - 15:10] +// CHECK2: Identifier: "meth" [15:10 - 15:14] ObjCMessageExpr=meth:2:8 +// CHECK2: Punctuation: "," [15:14 - 15:15] +// CHECK2: Identifier: "MyClass" [15:16 - 15:23] ObjCClassRef=MyClass:1:12 +// CHECK2: Punctuation: ")" [15:23 - 15:24] diff --git a/clang/test/Index/annotate-nested-name-specifier.cpp b/clang/test/Index/annotate-nested-name-specifier.cpp new file mode 100644 index 0000000..c4f60e3 --- /dev/null +++ b/clang/test/Index/annotate-nested-name-specifier.cpp @@ -0,0 +1,466 @@ +namespace outer { + namespace inner { + template<typename T> + struct vector { + typedef T* iterator; + }; + } +} + +namespace outer_alias = outer; + +struct X { }; + +using outer_alias::inner::vector; + +struct X_vector : outer_alias::inner::vector<X> { + using outer_alias::inner::vector<X>::iterator; +}; + +namespace outer { + namespace inner { + template<typename T, unsigned N> + struct array { + void foo(); + static int max_size; + }; + } +} + +template<typename T, unsigned N> +void outer::inner::array<T, N>::foo() { +} + +template<typename T, unsigned N> +int outer::inner::array<T, N>::max_size = 17; + +template<typename T> +struct X2 : outer::inner::vector<T> { + typedef T type; + using typename outer::inner::vector<type>::iterator; + using outer::inner::vector<type>::push_back; +}; + +namespace outer { + namespace inner { + namespace secret { + } + } +} + +using namespace outer_alias::inner::secret; +namespace super_secret = outer_alias::inner::secret; + +template<typename T> +struct X3 { + void f(T *t) { + t->::outer_alias::inner::template vector<T>::~vector<T>(); + } +}; + +namespace outer { + namespace inner { + void f(int); + void f(double); + } +} + +template<typename T> +struct X4 { + typedef T type; + void g(int); + void g(float); + + void h(T t) { + ::outer_alias::inner::f(t); + ::X4<type>::g(t); + this->::X4<type>::g(t); + } +}; + +typedef int Integer; +template<> +struct X4<Integer> { + typedef Integer type; + + void g(int); + void g(float); + + void h(type t) { + ::outer_alias::inner::f(t); + ::X4<type>::g(t); + this->::X4<type>::g(t); + } +}; + + +template<typename T> +struct X5 { + typedef T type; + typedef typename outer_alias::inner::vector<type>::iterator iter_type; + typedef typename outer_alias::inner::vector<int>::iterator int_ptr_type; +}; + +template<typename T> +struct X6 { + typedef T* type; + typedef typename outer_alias::inner::vector<type>::template rebind<type> type1; + typedef typename outer_alias::inner::vector<type>::template rebind<type>::other type2; + typedef class outer_alias::inner::vector<type>::template rebind<type> type3; + typedef class outer_alias::inner::vector<type>::template rebind<type>::other type4; +}; + +namespace outer { + namespace inner { + template<typename T, template<class> class TT> + struct apply_meta { + typedef typename TT<T>::type type; + }; + } +} + +template<typename T, typename U> +struct X7 { + typedef T T_type; + typedef U U_type; + typedef outer_alias::inner::apply_meta<T_type, U_type::template apply> type; +}; + +struct X8 { + void f(); +}; + +struct X9 : X8 { + typedef X8 inherited; + void f() { + inherited::f(); + } +}; + +// RUN: c-index-test -test-annotate-tokens=%s:13:1:137:1 -fno-delayed-template-parsing %s | FileCheck %s + +// CHECK: Keyword: "using" [14:1 - 14:6] UsingDeclaration=vector[4:12] +// CHECK: Identifier: "outer_alias" [14:7 - 14:18] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [14:18 - 14:20] UsingDeclaration=vector[4:12] +// CHECK: Identifier: "inner" [14:20 - 14:25] NamespaceRef=inner:2:13 +// CHECK: Punctuation: "::" [14:25 - 14:27] UsingDeclaration=vector[4:12] +// CHECK: Identifier: "vector" [14:27 - 14:33] OverloadedDeclRef=vector[4:12] +// CHECK: Punctuation: ";" [14:33 - 14:34] + +// Base specifiers +// CHECK: Identifier: "outer_alias" [16:19 - 16:30] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [16:30 - 16:32] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false] +// CHECK: Identifier: "inner" [16:32 - 16:37] NamespaceRef=inner:2:13 +// CHECK: Punctuation: "::" [16:37 - 16:39] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false] +// CHECK: Identifier: "vector" [16:39 - 16:45] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [16:45 - 16:46] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false] +// CHECK: Identifier: "X" [16:46 - 16:47] TypeRef=struct X:12:8 +// CHECK: Punctuation: ">" [16:47 - 16:48] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false] + + +// CHECK: Keyword: "using" [17:3 - 17:8] UsingDeclaration=iterator[5:18] +// CHECK: Identifier: "outer_alias" [17:9 - 17:20] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [17:20 - 17:22] UsingDeclaration=iterator[5:18] +// CHECK: Identifier: "inner" [17:22 - 17:27] NamespaceRef=inner:2:13 +// CHECK: Punctuation: "::" [17:27 - 17:29] UsingDeclaration=iterator[5:18] +// CHECK: Identifier: "vector" [17:29 - 17:35] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [17:35 - 17:36] UsingDeclaration=iterator[5:18] +// CHECK: Identifier: "X" [17:36 - 17:37] TypeRef=struct X:12:8 +// CHECK: Punctuation: ">" [17:37 - 17:38] UsingDeclaration=iterator[5:18] +// CHECK: Punctuation: "::" [17:38 - 17:40] UsingDeclaration=iterator[5:18] +// CHECK: Identifier: "iterator" [17:40 - 17:48] OverloadedDeclRef=iterator[5:18] + +// CHECK: Keyword: "void" [31:1 - 31:5] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "outer" [31:6 - 31:11] NamespaceRef=outer:20:11 +// CHECK: Punctuation: "::" [31:11 - 31:13] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "inner" [31:13 - 31:18] NamespaceRef=inner:21:13 +// CHECK: Punctuation: "::" [31:18 - 31:20] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "array" [31:20 - 31:25] TemplateRef=array:23:12 +// CHECK: Punctuation: "<" [31:25 - 31:26] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "T" [31:26 - 31:27] TypeRef=T:30:19 +// CHECK: Punctuation: "," [31:27 - 31:28] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "N" [31:29 - 31:30] DeclRefExpr=N:30:31 +// CHECK: Punctuation: ">" [31:30 - 31:31] CXXMethod=foo:31:33 (Definition) +// CHECK: Punctuation: "::" [31:31 - 31:33] CXXMethod=foo:31:33 (Definition) +// CHECK: Identifier: "foo" [31:33 - 31:36] CXXMethod=foo:31:33 (Definition) +// CHECK: Punctuation: "(" [31:36 - 31:37] CXXMethod=foo:31:33 (Definition) +// CHECK: Punctuation: ")" [31:37 - 31:38] CXXMethod=foo:31:33 (Definition) + +// CHECK: Keyword: "int" [35:1 - 35:4] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "outer" [35:5 - 35:10] NamespaceRef=outer:20:11 +// CHECK: Punctuation: "::" [35:10 - 35:12] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "inner" [35:12 - 35:17] NamespaceRef=inner:21:13 +// CHECK: Punctuation: "::" [35:17 - 35:19] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "array" [35:19 - 35:24] TemplateRef=array:23:12 +// CHECK: Punctuation: "<" [35:24 - 35:25] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "T" [35:25 - 35:26] TypeRef=T:34:19 +// CHECK: Punctuation: "," [35:26 - 35:27] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "N" [35:28 - 35:29] DeclRefExpr=N:34:31 +// CHECK: Punctuation: ">" [35:29 - 35:30] VarDecl=max_size:35:32 (Definition) +// CHECK: Punctuation: "::" [35:30 - 35:32] VarDecl=max_size:35:32 (Definition) +// CHECK: Identifier: "max_size" [35:32 - 35:40] VarDecl=max_size:35:32 (Definition) +// CHECK: Punctuation: "=" [35:41 - 35:42] VarDecl=max_size:35:32 (Definition) +// CHECK: Literal: "17" [35:43 - 35:45] IntegerLiteral= +// CHECK: Punctuation: ";" [35:45 - 35:46] + +// CHECK: Keyword: "using" [40:3 - 40:8] UsingDeclaration=iterator:40:46 +// CHECK: Keyword: "typename" [40:9 - 40:17] UsingDeclaration=iterator:40:46 +// CHECK: Identifier: "outer" [40:18 - 40:23] NamespaceRef=outer:20:11 +// CHECK: Punctuation: "::" [40:23 - 40:25] UsingDeclaration=iterator:40:46 +// CHECK: Identifier: "inner" [40:25 - 40:30] NamespaceRef=inner:21:13 +// CHECK: Punctuation: "::" [40:30 - 40:32] UsingDeclaration=iterator:40:46 +// CHECK: Identifier: "vector" [40:32 - 40:38] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [40:38 - 40:39] UsingDeclaration=iterator:40:46 +// CHECK: Identifier: "type" [40:39 - 40:43] TypeRef=type:39:13 +// CHECK: Punctuation: ">" [40:43 - 40:44] UsingDeclaration=iterator:40:46 +// CHECK: Punctuation: "::" [40:44 - 40:46] UsingDeclaration=iterator:40:46 +// CHECK: Identifier: "iterator" [40:46 - 40:54] UsingDeclaration=iterator:40:46 +// CHECK: Punctuation: ";" [40:54 - 40:55] ClassTemplate=X2:38:8 (Definition) +// CHECK: Keyword: "using" [41:3 - 41:8] UsingDeclaration=push_back:41:37 +// CHECK: Identifier: "outer" [41:9 - 41:14] NamespaceRef=outer:20:11 +// CHECK: Punctuation: "::" [41:14 - 41:16] UsingDeclaration=push_back:41:37 +// CHECK: Identifier: "inner" [41:16 - 41:21] NamespaceRef=inner:21:13 +// CHECK: Punctuation: "::" [41:21 - 41:23] UsingDeclaration=push_back:41:37 +// CHECK: Identifier: "vector" [41:23 - 41:29] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [41:29 - 41:30] UsingDeclaration=push_back:41:37 +// CHECK: Identifier: "type" [41:30 - 41:34] TypeRef=type:39:13 +// CHECK: Punctuation: ">" [41:34 - 41:35] UsingDeclaration=push_back:41:37 +// CHECK: Punctuation: "::" [41:35 - 41:37] UsingDeclaration=push_back:41:37 +// CHECK: Identifier: "push_back" [41:37 - 41:46] UsingDeclaration=push_back:41:37 + +// Using directive +// CHECK: Keyword: "using" [51:1 - 51:6] UsingDirective=:51:37 +// CHECK: Keyword: "namespace" [51:7 - 51:16] UsingDirective=:51:37 +// CHECK: Identifier: "outer_alias" [51:17 - 51:28] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [51:28 - 51:30] UsingDirective=:51:37 +// CHECK: Identifier: "inner" [51:30 - 51:35] NamespaceRef=inner:45:13 +// CHECK: Punctuation: "::" [51:35 - 51:37] UsingDirective=:51:37 +// CHECK: Identifier: "secret" [51:37 - 51:43] NamespaceRef=secret:46:15 + +// Namespace alias +// CHECK: Keyword: "namespace" [52:1 - 52:10] NamespaceAlias=super_secret:52:11 +// CHECK: Identifier: "super_secret" [52:11 - 52:23] NamespaceAlias=super_secret:52:11 +// CHECK: Punctuation: "=" [52:24 - 52:25] NamespaceAlias=super_secret:52:11 +// CHECK: Identifier: "outer_alias" [52:26 - 52:37] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [52:37 - 52:39] NamespaceAlias=super_secret:52:11 +// CHECK: Identifier: "inner" [52:39 - 52:44] NamespaceRef=inner:45:13 +// CHECK: Punctuation: "::" [52:44 - 52:46] NamespaceAlias=super_secret:52:11 +// CHECK: Identifier: "secret" [52:46 - 52:52] NamespaceRef=secret:46:15 +// CHECK: Punctuation: ";" [52:52 - 52:53] + +// Pseudo-destructor +// CHECK: Identifier: "t" [57:5 - 57:6] DeclRefExpr=t:56:13 +// CHECK: Punctuation: "->" [57:6 - 57:8] MemberRefExpr= +// CHECK: Punctuation: "::" [57:8 - 57:10] MemberRefExpr= +// CHECK: Identifier: "outer_alias" [57:10 - 57:21] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [57:21 - 57:23] MemberRefExpr= +// CHECK: Identifier: "inner" [57:23 - 57:28] NamespaceRef=inner:45:13 +// CHECK: Punctuation: "::" [57:28 - 57:30] MemberRefExpr= +// CHECK: Keyword: "template" [57:30 - 57:38] MemberRefExpr= +// CHECK: Identifier: "vector" [57:39 - 57:45] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [57:45 - 57:46] MemberRefExpr= +// CHECK: Identifier: "T" [57:46 - 57:47] TypeRef=T:54:19 +// CHECK: Punctuation: ">" [57:47 - 57:48] MemberRefExpr= +// CHECK: Punctuation: "::" [57:48 - 57:50] MemberRefExpr= +// CHECK: Punctuation: "~" [57:50 - 57:51] MemberRefExpr= +// CHECK: Identifier: "vector" [57:51 - 57:57] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [57:57 - 57:58] MemberRefExpr= +// CHECK: Identifier: "T" [57:58 - 57:59] TypeRef=T:54:19 +// CHECK: Punctuation: ">" [57:59 - 57:60] CallExpr= +// CHECK: Punctuation: "(" [57:60 - 57:61] CallExpr= +// CHECK: Punctuation: ")" [57:61 - 57:62] CallExpr= + +// Unresolved member and non-member references +// CHECK: Punctuation: "::" [75:5 - 75:7] DeclRefExpr=[63:10, 64:10] +// CHECK: Identifier: "outer_alias" [75:7 - 75:18] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [75:18 - 75:20] DeclRefExpr=[63:10, 64:10] +// CHECK: Identifier: "inner" [75:20 - 75:25] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [75:25 - 75:27] DeclRefExpr=[63:10, 64:10] +// CHECK: Identifier: "f" [75:27 - 75:28] OverloadedDeclRef=f[63:10, 64:10] +// CHECK: Punctuation: "(" [75:28 - 75:29] CallExpr= +// CHECK: Identifier: "t" [75:29 - 75:30] DeclRefExpr=t:74:12 +// CHECK: Punctuation: ")" [75:30 - 75:31] CallExpr= +// CHECK: Punctuation: "::" [76:5 - 76:7] MemberRefExpr=[71:8, 72:8] +// CHECK: Identifier: "X4" [76:7 - 76:9] TemplateRef=X4:69:8 +// CHECK: Punctuation: "<" [76:9 - 76:10] MemberRefExpr=[71:8, 72:8] +// CHECK: Identifier: "type" [76:10 - 76:14] TypeRef=type:70:13 +// CHECK: Punctuation: ">" [76:14 - 76:15] MemberRefExpr=[71:8, 72:8] +// CHECK: Punctuation: "::" [76:15 - 76:17] MemberRefExpr=[71:8, 72:8] +// CHECK: Identifier: "g" [76:17 - 76:18] OverloadedDeclRef=g[71:8, 72:8] +// CHECK: Punctuation: "(" [76:18 - 76:19] CallExpr= +// CHECK: Identifier: "t" [76:19 - 76:20] DeclRefExpr=t:74:12 +// CHECK: Punctuation: ")" [76:20 - 76:21] CallExpr= +// CHECK: Punctuation: ";" [76:21 - 76:22] CompoundStmt= +// CHECK: Keyword: "this" [77:5 - 77:9] CXXThisExpr= +// CHECK: Punctuation: "->" [77:9 - 77:11] MemberRefExpr= +// CHECK: Punctuation: "::" [77:11 - 77:13] MemberRefExpr= +// CHECK: Identifier: "X4" [77:13 - 77:15] TemplateRef=X4:69:8 +// CHECK: Punctuation: "<" [77:15 - 77:16] MemberRefExpr= +// CHECK: Identifier: "type" [77:16 - 77:20] TypeRef=type:70:13 +// CHECK: Punctuation: ">" [77:20 - 77:21] MemberRefExpr= +// CHECK: Punctuation: "::" [77:21 - 77:23] MemberRefExpr= +// CHECK: Identifier: "g" [77:23 - 77:24] MemberRefExpr= +// CHECK: Punctuation: "(" [77:24 - 77:25] CallExpr= +// CHECK: Identifier: "t" [77:25 - 77:26] DeclRefExpr=t:74:12 +// CHECK: Punctuation: ")" [77:26 - 77:27] CallExpr= + +// Resolved member and non-member references +// CHECK: Punctuation: "::" [90:5 - 90:7] DeclRefExpr=f:63:10 +// CHECK: Identifier: "outer_alias" [90:7 - 90:18] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [90:18 - 90:20] DeclRefExpr=f:63:10 +// CHECK: Identifier: "inner" [90:20 - 90:25] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [90:25 - 90:27] DeclRefExpr=f:63:10 +// CHECK: Identifier: "f" [90:27 - 90:28] DeclRefExpr=f:63:10 +// CHECK: Punctuation: "(" [90:28 - 90:29] CallExpr=f:63:10 +// CHECK: Identifier: "t" [90:29 - 90:30] DeclRefExpr=t:89:15 +// CHECK: Punctuation: ")" [90:30 - 90:31] CallExpr=f:63:10 +// CHECK: Punctuation: ";" [90:31 - 90:32] CompoundStmt= +// CHECK: Punctuation: "::" [91:5 - 91:7] MemberRefExpr=g:86:8 +// CHECK: Identifier: "X4" [91:7 - 91:9] TemplateRef=X4:69:8 +// CHECK: Punctuation: "<" [91:9 - 91:10] MemberRefExpr=g:86:8 +// CHECK: Identifier: "type" [91:10 - 91:14] TypeRef=type:84:19 +// CHECK: Punctuation: ">" [91:14 - 91:15] MemberRefExpr=g:86:8 +// CHECK: Punctuation: "::" [91:15 - 91:17] MemberRefExpr=g:86:8 +// CHECK: Identifier: "g" [91:17 - 91:18] MemberRefExpr=g:86:8 +// CHECK: Punctuation: "(" [91:18 - 91:19] CallExpr=g:86:8 +// CHECK: Identifier: "t" [91:19 - 91:20] DeclRefExpr=t:89:15 +// CHECK: Punctuation: ")" [91:20 - 91:21] CallExpr=g:86:8 +// CHECK: Punctuation: ";" [91:21 - 91:22] CompoundStmt= +// CHECK: Keyword: "this" [92:5 - 92:9] CXXThisExpr= +// CHECK: Punctuation: "->" [92:9 - 92:11] MemberRefExpr=g:86:8 +// CHECK: Punctuation: "::" [92:11 - 92:13] MemberRefExpr=g:86:8 +// CHECK: Identifier: "X4" [92:13 - 92:15] TemplateRef=X4:69:8 +// CHECK: Punctuation: "<" [92:15 - 92:16] MemberRefExpr=g:86:8 +// CHECK: Identifier: "type" [92:16 - 92:20] TypeRef=type:84:19 +// CHECK: Punctuation: ">" [92:20 - 92:21] MemberRefExpr=g:86:8 +// CHECK: Punctuation: "::" [92:21 - 92:23] MemberRefExpr=g:86:8 +// CHECK: Identifier: "g" [92:23 - 92:24] MemberRefExpr=g:86:8 +// CHECK: Punctuation: "(" [92:24 - 92:25] CallExpr=g:86:8 +// CHECK: Identifier: "t" [92:25 - 92:26] DeclRefExpr=t:89:15 +// CHECK: Punctuation: ")" [92:26 - 92:27] CallExpr=g:86:8 + +// Dependent name type +// CHECK: Keyword: "typedef" [100:3 - 100:10] ClassTemplate=X5:98:8 (Definition) +// CHECK: Keyword: "typename" [100:11 - 100:19] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "outer_alias" [100:20 - 100:31] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [100:31 - 100:33] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "inner" [100:33 - 100:38] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [100:38 - 100:40] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "vector" [100:40 - 100:46] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [100:46 - 100:47] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "type" [100:47 - 100:51] TypeRef=type:99:13 +// CHECK: Punctuation: ">" [100:51 - 100:52] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Punctuation: "::" [100:52 - 100:54] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "iterator" [100:54 - 100:62] TypedefDecl=iter_type:100:63 (Definition) +// CHECK: Identifier: "iter_type" [100:63 - 100:72] TypedefDecl=iter_type:100:63 (Definition) + +// CHECK: Keyword: "typedef" [101:3 - 101:10] ClassTemplate=X5:98:8 (Definition) +// CHECK: Keyword: "typename" [101:11 - 101:19] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Identifier: "outer_alias" [101:20 - 101:31] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [101:31 - 101:33] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Identifier: "inner" [101:33 - 101:38] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [101:38 - 101:40] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Identifier: "vector" [101:40 - 101:46] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [101:46 - 101:47] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Keyword: "int" [101:47 - 101:50] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Punctuation: ">" [101:50 - 101:51] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Punctuation: "::" [101:51 - 101:53] TypedefDecl=int_ptr_type:101:62 (Definition) +// CHECK: Identifier: "iterator" [101:53 - 101:61] TypeRef=iterator:5:18 +// CHECK: Identifier: "int_ptr_type" [101:62 - 101:74] TypedefDecl=int_ptr_type:101:62 (Definition) + +// Dependent template specialization types +// CHECK: Keyword: "typename" [107:11 - 107:19] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "outer_alias" [107:20 - 107:31] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [107:31 - 107:33] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "inner" [107:33 - 107:38] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [107:38 - 107:40] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "vector" [107:40 - 107:46] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [107:46 - 107:47] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "type" [107:47 - 107:51] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [107:51 - 107:52] TypedefDecl=type1:107:76 (Definition) +// CHECK: Punctuation: "::" [107:52 - 107:54] TypedefDecl=type1:107:76 (Definition) +// CHECK: Keyword: "template" [107:54 - 107:62] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "rebind" [107:63 - 107:69] TypedefDecl=type1:107:76 (Definition) +// CHECK: Punctuation: "<" [107:69 - 107:70] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "type" [107:70 - 107:74] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [107:74 - 107:75] TypedefDecl=type1:107:76 (Definition) +// CHECK: Identifier: "type1" [107:76 - 107:81] TypedefDecl=type1:107:76 (Definition) + +// CHECK: Keyword: "typedef" [108:3 - 108:10] ClassTemplate=X6:105:8 (Definition) +// CHECK: Keyword: "typename" [108:11 - 108:19] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "outer_alias" [108:20 - 108:31] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [108:31 - 108:33] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "inner" [108:33 - 108:38] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [108:38 - 108:40] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "vector" [108:40 - 108:46] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [108:46 - 108:47] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "type" [108:47 - 108:51] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [108:51 - 108:52] TypedefDecl=type2:108:83 (Definition) +// CHECK: Punctuation: "::" [108:52 - 108:54] TypedefDecl=type2:108:83 (Definition) +// CHECK: Keyword: "template" [108:54 - 108:62] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "rebind" [108:63 - 108:69] TypedefDecl=type2:108:83 (Definition) +// CHECK: Punctuation: "<" [108:69 - 108:70] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "type" [108:70 - 108:74] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [108:74 - 108:75] TypedefDecl=type2:108:83 (Definition) +// CHECK: Punctuation: "::" [108:75 - 108:77] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "other" [108:77 - 108:82] TypedefDecl=type2:108:83 (Definition) +// CHECK: Identifier: "type2" [108:83 - 108:88] TypedefDecl=type2:108:83 (Definition) + +// CHECK: Keyword: "typedef" [109:3 - 109:10] ClassTemplate=X6:105:8 (Definition) +// CHECK: Keyword: "class" [109:11 - 109:16] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "outer_alias" [109:17 - 109:28] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [109:28 - 109:30] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "inner" [109:30 - 109:35] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [109:35 - 109:37] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "vector" [109:37 - 109:43] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [109:43 - 109:44] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type" [109:44 - 109:48] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [109:48 - 109:49] TypedefDecl=type3:109:73 (Definition) +// CHECK: Punctuation: "::" [109:49 - 109:51] TypedefDecl=type3:109:73 (Definition) +// CHECK: Keyword: "template" [109:51 - 109:59] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "rebind" [109:60 - 109:66] TypedefDecl=type3:109:73 (Definition) +// CHECK: Punctuation: "<" [109:66 - 109:67] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type" [109:67 - 109:71] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [109:71 - 109:72] TypedefDecl=type3:109:73 (Definition) +// CHECK: Identifier: "type3" [109:73 - 109:78] TypedefDecl=type3:109:73 (Definition) + +// CHECK: Keyword: "class" [110:11 - 110:16] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "outer_alias" [110:17 - 110:28] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [110:28 - 110:30] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "inner" [110:30 - 110:35] NamespaceRef=inner:62:13 +// CHECK: Punctuation: "::" [110:35 - 110:37] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "vector" [110:37 - 110:43] TemplateRef=vector:4:12 +// CHECK: Punctuation: "<" [110:43 - 110:44] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type" [110:44 - 110:48] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [110:48 - 110:49] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "::" [110:49 - 110:51] TypedefDecl=type4:110:80 (Definition) +// CHECK: Keyword: "template" [110:51 - 110:59] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "rebind" [110:60 - 110:66] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "<" [110:66 - 110:67] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type" [110:67 - 110:71] TypeRef=type:106:14 +// CHECK: Punctuation: ">" [110:71 - 110:72] TypedefDecl=type4:110:80 (Definition) +// CHECK: Punctuation: "::" [110:72 - 110:74] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "other" [110:74 - 110:79] TypedefDecl=type4:110:80 (Definition) +// CHECK: Identifier: "type4" [110:80 - 110:85] TypedefDecl=type4:110:80 (Definition) + +// Template template arguments +// CHECK: Keyword: "typedef" [126:3 - 126:10] ClassTemplate=X7:123:8 (Definition) +// CHECK: Identifier: "outer_alias" [126:11 - 126:22] NamespaceRef=outer_alias:10:11 +// CHECK: Punctuation: "::" [126:22 - 126:24] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "inner" [126:24 - 126:29] NamespaceRef=inner:114:13 +// CHECK: Punctuation: "::" [126:29 - 126:31] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "apply_meta" [126:31 - 126:41] TemplateRef=apply_meta:116:12 +// CHECK: Punctuation: "<" [126:41 - 126:42] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "T_type" [126:42 - 126:48] TypeRef=T_type:124:13 +// CHECK: Punctuation: "," [126:48 - 126:49] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "U_type" [126:50 - 126:56] TypeRef=U_type:125:13 +// CHECK: Punctuation: "::" [126:56 - 126:58] TypedefDecl=type:126:74 (Definition) +// CHECK: Keyword: "template" [126:58 - 126:66] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "apply" [126:67 - 126:72] TypedefDecl=type:126:74 (Definition) +// CHECK: Punctuation: ">" [126:72 - 126:73] TypedefDecl=type:126:74 (Definition) +// CHECK: Identifier: "type" [126:74 - 126:78] TypedefDecl=type:126:74 (Definition) + +// Member access expressions +// CHECK: Identifier: "inherited" [136:5 - 136:14] TypeRef=inherited:134:14 +// CHECK: Punctuation: "::" [136:14 - 136:16] MemberRefExpr=f:130:8 +// CHECK: Identifier: "f" [136:16 - 136:17] MemberRefExpr=f:130:8 diff --git a/clang/test/Index/annotate-subscripting.m b/clang/test/Index/annotate-subscripting.m new file mode 100644 index 0000000..cda1465 --- /dev/null +++ b/clang/test/Index/annotate-subscripting.m @@ -0,0 +1,92 @@ +@interface NSArray +- (id)objectAtIndexedSubscript:(int)index; ++ (id)arrayWithObjects:(id *)objects count:(unsigned)count; +@end + +@interface NSMutableArray : NSArray +- (id)objectAtIndexedSubscript:(int)index; +- (void)setObject:(id)object atIndexedSubscript:(int)index; +@end + +@interface NSDictionary +- (id)objectForKeyedSubscript:(id)key; ++ (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count; +@end + +@interface NSMutableDictionary : NSDictionary +- (void)setObject:(id)object forKeyedSubscript:(id)key; +@end + +@class NSString; + +id testArray(int index, id p) { + NSMutableArray *array; + array[3] = 0; + NSArray *arr = @[ p, p ]; + return array[index]; +} + +void testDict() { + NSMutableDictionary *dictionary; + NSString *key; + id newObject, oldObject; + oldObject = dictionary[key]; + dictionary[key] = newObject; + NSDictionary *dict = @{ key: newObject, key: oldObject }; +} + +// RUN: c-index-test -test-annotate-tokens=%s:22:1:36:1 -target x86_64-apple-macosx10.7 %s | FileCheck %s +// CHECK: Identifier: "array" [24:3 - 24:8] DeclRefExpr=array:23:19 +// CHECK: Punctuation: "[" [24:8 - 24:9] UnexposedExpr= +// CHECK: Literal: "3" [24:9 - 24:10] IntegerLiteral= +// CHECK: Punctuation: "]" [24:10 - 24:11] UnexposedExpr= +// CHECK: Punctuation: "=" [24:12 - 24:13] BinaryOperator= +// CHECK: Literal: "0" [24:14 - 24:15] IntegerLiteral= +// CHECK: Punctuation: ";" [24:15 - 24:16] CompoundStmt= +// CHECK: Identifier: "NSArray" [25:3 - 25:10] ObjCClassRef=NSArray:1:12 +// CHECK: Punctuation: "*" [25:11 - 25:12] VarDecl=arr:25:12 (Definition) +// CHECK: Identifier: "arr" [25:12 - 25:15] VarDecl=arr:25:12 (Definition) +// CHECK: Punctuation: "=" [25:16 - 25:17] VarDecl=arr:25:12 (Definition) +// CHECK: Punctuation: "@" [25:18 - 25:19] UnexposedExpr= +// CHECK: Punctuation: "[" [25:19 - 25:20] UnexposedExpr= +// CHECK: Identifier: "p" [25:21 - 25:22] DeclRefExpr=p:22:28 +// CHECK: Punctuation: "," [25:22 - 25:23] UnexposedExpr= +// CHECK: Identifier: "p" [25:24 - 25:25] DeclRefExpr=p:22:28 +// CHECK: Punctuation: "]" [25:26 - 25:27] UnexposedExpr= +// CHECK: Punctuation: ";" [25:27 - 25:28] DeclStmt= +// CHECK: Keyword: "return" [26:3 - 26:9] ReturnStmt= +// CHECK: Identifier: "array" [26:10 - 26:15] DeclRefExpr=array:23:19 +// CHECK: Punctuation: "[" [26:15 - 26:16] UnexposedExpr= +// CHECK: Identifier: "index" [26:16 - 26:21] DeclRefExpr=index:22:18 +// CHECK: Punctuation: "]" [26:21 - 26:22] UnexposedExpr= +// CHECK: Punctuation: ";" [26:22 - 26:23] CompoundStmt= + +// CHECK: Identifier: "oldObject" [33:3 - 33:12] DeclRefExpr=oldObject:32:17 +// CHECK: Punctuation: "=" [33:13 - 33:14] BinaryOperator= +// CHECK: Identifier: "dictionary" [33:15 - 33:25] DeclRefExpr=dictionary:30:24 +// CHECK: Punctuation: "[" [33:25 - 33:26] UnexposedExpr= +// CHECK: Identifier: "key" [33:26 - 33:29] DeclRefExpr=key:31:13 +// CHECK: Punctuation: "]" [33:29 - 33:30] UnexposedExpr= +// CHECK: Punctuation: ";" [33:30 - 33:31] CompoundStmt= +// CHECK: Identifier: "dictionary" [34:3 - 34:13] DeclRefExpr=dictionary:30:24 +// CHECK: Punctuation: "[" [34:13 - 34:14] UnexposedExpr= +// CHECK: Identifier: "key" [34:14 - 34:17] DeclRefExpr=key:31:13 +// CHECK: Punctuation: "]" [34:17 - 34:18] UnexposedExpr= +// CHECK: Punctuation: "=" [34:19 - 34:20] BinaryOperator= +// CHECK: Identifier: "newObject" [34:21 - 34:30] DeclRefExpr=newObject:32:6 +// CHECK: Punctuation: ";" [34:30 - 34:31] CompoundStmt= +// CHECK: Identifier: "NSDictionary" [35:3 - 35:15] ObjCClassRef=NSDictionary:11:12 +// CHECK: Punctuation: "*" [35:16 - 35:17] VarDecl=dict:35:17 (Definition) +// CHECK: Identifier: "dict" [35:17 - 35:21] VarDecl=dict:35:17 (Definition) +// CHECK: Punctuation: "=" [35:22 - 35:23] VarDecl=dict:35:17 (Definition) +// CHECK: Punctuation: "@" [35:24 - 35:25] UnexposedExpr= +// CHECK: Punctuation: "{" [35:25 - 35:26] UnexposedExpr= +// CHECK: Identifier: "key" [35:27 - 35:30] DeclRefExpr=key:31:13 +// CHECK: Punctuation: ":" [35:30 - 35:31] UnexposedExpr= +// CHECK: Identifier: "newObject" [35:32 - 35:41] DeclRefExpr=newObject:32:6 +// CHECK: Punctuation: "," [35:41 - 35:42] UnexposedExpr= +// CHECK: Identifier: "key" [35:43 - 35:46] DeclRefExpr=key:31:13 +// CHECK: Punctuation: ":" [35:46 - 35:47] UnexposedExpr= +// CHECK: Identifier: "oldObject" [35:48 - 35:57] DeclRefExpr=oldObject:32:17 +// CHECK: Punctuation: "}" [35:58 - 35:59] UnexposedExpr= +// CHECK: Punctuation: ";" [35:59 - 35:60] DeclStmt= diff --git a/clang/test/Index/annotate-tokens-cxx0x.cpp b/clang/test/Index/annotate-tokens-cxx0x.cpp new file mode 100644 index 0000000..a126b85 --- /dev/null +++ b/clang/test/Index/annotate-tokens-cxx0x.cpp @@ -0,0 +1,27 @@ +template<typename ...Args> +int f(Args ...args) { + return sizeof...(args) + sizeof...(Args); +} + +void test() { + int a; + decltype(a) b; + + typedef int Integer; + typedef float Float; + typedef bool Bool; + bool b2 = __is_trivially_constructible(Integer, Float, Bool); +} + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s +// CHECK: Identifier: "args" [3:20 - 3:24] SizeOfPackExpr=args:2:15 +// CHECK: Identifier: "Args" [3:38 - 3:42] TypeRef=Args:1:22 + +// RUN: c-index-test -test-annotate-tokens=%s:8:1:9:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-DECLTYPE %s +// CHECK-DECLTYPE: Identifier: "a" [8:12 - 8:13] DeclRefExpr=a:7:7 + +// RUN: c-index-test -test-annotate-tokens=%s:13:1:14:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-TRAIT %s +// CHECK-TRAIT: Identifier: "Integer" [13:42 - 13:49] TypeRef=Integer:10:15 +// CHECK-TRAIT: Identifier: "Float" [13:51 - 13:56] TypeRef=Float:11:17 +// CHECK-TRAIT: Identifier: "Bool" [13:58 - 13:62] TypeRef=Bool:12:16 + diff --git a/clang/test/Index/annotate-tokens-include.c b/clang/test/Index/annotate-tokens-include.c new file mode 100644 index 0000000..2190125 --- /dev/null +++ b/clang/test/Index/annotate-tokens-include.c @@ -0,0 +1,7 @@ +#include "annotate-tokens-include.h" + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:2:1 %s | FileCheck %s +// CHECK: Punctuation: "#" [1:1 - 1:2] inclusion directive=annotate-tokens-include.h +// CHECK: Identifier: "include" [1:2 - 1:9] inclusion directive=annotate-tokens-include.h +// CHECK: Literal: ""annotate-tokens-include.h"" [1:10 - 1:37] inclusion directive=annotate-tokens-include.h + diff --git a/clang/test/Index/annotate-tokens-include.h b/clang/test/Index/annotate-tokens-include.h new file mode 100644 index 0000000..5d5f8f0 --- /dev/null +++ b/clang/test/Index/annotate-tokens-include.h @@ -0,0 +1 @@ +int foo(); diff --git a/clang/test/Index/annotate-tokens-pp.c b/clang/test/Index/annotate-tokens-pp.c new file mode 100644 index 0000000..b37ab39 --- /dev/null +++ b/clang/test/Index/annotate-tokens-pp.c @@ -0,0 +1,198 @@ +#define NOTHING(X,Y) +#define STILL_NOTHING NOTHING(honk,warble) +#define BAR baz +#define WIBBLE(X, Y) X##Y +NOTHING(more,junk) float WIBBLE(int, float); +int BAR STILL_NOTHING; +#include "foo.h" +#undef BAR + +#define REVERSE_MACRO(x,y) y + x +#define TWICE_MACRO(y) y + y + +void test_macro_args() { + int z = 1; + int t = 2; + int k = REVERSE_MACRO(t,z); + int j = TWICE_MACRO(k + k); + int w = j + j; +} + +#define fun_with_macro_bodies(x, y) do { if (x) y } while (0) + +void test() { + int x = 10; + fun_with_macro_bodies(x, { int z = x; ++z; }); +} + +#include "pragma-once.h" +#include "guarded.h" + +const char *fname = __FILE__; + +// RUN: c-index-test -test-annotate-tokens=%s:2:1:32:1 -I%S/Inputs %s | FileCheck %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:2:1:32:1 -I%S/Inputs %s | FileCheck %s +// CHECK: Punctuation: "#" [2:1 - 2:2] preprocessing directive= +// CHECK: Identifier: "define" [2:2 - 2:8] preprocessing directive= +// CHECK: Identifier: "STILL_NOTHING" [2:9 - 2:22] macro definition=STILL_NOTHING +// CHECK: Identifier: "NOTHING" [2:23 - 2:30] macro definition=STILL_NOTHING +// CHECK: Punctuation: "(" [2:30 - 2:31] macro definition=STILL_NOTHING +// CHECK: Identifier: "honk" [2:31 - 2:35] macro definition=STILL_NOTHING +// CHECK: Punctuation: "," [2:35 - 2:36] macro definition=STILL_NOTHING +// CHECK: Identifier: "warble" [2:36 - 2:42] macro definition=STILL_NOTHING +// CHECK: Punctuation: ")" [2:42 - 2:43] macro definition=STILL_NOTHING +// CHECK: Punctuation: "#" [3:1 - 3:2] preprocessing directive= +// CHECK: Identifier: "define" [3:2 - 3:8] preprocessing directive= +// CHECK: Identifier: "BAR" [3:9 - 3:12] macro definition=BAR +// CHECK: Identifier: "baz" [3:13 - 3:16] macro definition=BAR +// CHECK: Punctuation: "#" [4:1 - 4:2] preprocessing directive= +// CHECK: Identifier: "define" [4:2 - 4:8] preprocessing directive= +// CHECK: Identifier: "WIBBLE" [4:9 - 4:15] macro definition=WIBBLE +// CHECK: Punctuation: "(" [4:15 - 4:16] macro definition=WIBBLE +// CHECK: Identifier: "X" [4:16 - 4:17] macro definition=WIBBLE +// CHECK: Punctuation: "," [4:17 - 4:18] macro definition=WIBBLE +// CHECK: Identifier: "Y" [4:19 - 4:20] macro definition=WIBBLE +// CHECK: Punctuation: ")" [4:20 - 4:21] macro definition=WIBBLE +// CHECK: Identifier: "X" [4:22 - 4:23] macro definition=WIBBLE +// CHECK: Punctuation: "##" [4:23 - 4:25] macro definition=WIBBLE +// CHECK: Identifier: "Y" [4:25 - 4:26] macro definition=WIBBLE +// CHECK: Identifier: "NOTHING" [5:1 - 5:8] macro expansion=NOTHING:1:9 +// CHECK: Punctuation: "(" [5:8 - 5:9] +// CHECK: Identifier: "more" [5:9 - 5:13] +// CHECK: Punctuation: "," [5:13 - 5:14] +// CHECK: Identifier: "junk" [5:14 - 5:18] +// CHECK: Punctuation: ")" [5:18 - 5:19] +// CHECK: Keyword: "float" [5:20 - 5:25] +// CHECK: Identifier: "WIBBLE" [5:26 - 5:32] macro expansion=WIBBLE:4:9 +// CHECK: Punctuation: "(" [5:32 - 5:33] +// CHECK: Keyword: "int" [5:33 - 5:36] +// CHECK: Punctuation: "," [5:36 - 5:37] +// CHECK: Keyword: "float" [5:38 - 5:43] +// CHECK: Punctuation: ")" [5:43 - 5:44] +// CHECK: Punctuation: ";" [5:44 - 5:45] +// CHECK: Keyword: "int" [6:1 - 6:4] +// CHECK: Identifier: "BAR" [6:5 - 6:8] macro expansion=BAR:3:9 +// CHECK: Identifier: "STILL_NOTHING" [6:9 - 6:22] macro expansion=STILL_NOTHING:2:9 +// CHECK: Punctuation: ";" [6:22 - 6:23] +// CHECK: Punctuation: "#" [7:1 - 7:2] inclusion directive=foo.h +// CHECK: Identifier: "include" [7:2 - 7:9] inclusion directive=foo.h +// CHECK: Literal: ""foo.h"" [7:10 - 7:17] inclusion directive=foo.h +// CHECK: Punctuation: "#" [8:1 - 8:2] preprocessing directive= +// CHECK: Identifier: "undef" [8:2 - 8:7] preprocessing directive= +// CHECK: Identifier: "BAR" [8:8 - 8:11] preprocessing directive= +// CHECK: Punctuation: "#" [10:1 - 10:2] preprocessing directive= +// CHECK: Identifier: "define" [10:2 - 10:8] preprocessing directive= +// CHECK: Identifier: "REVERSE_MACRO" [10:9 - 10:22] macro definition=REVERSE_MACRO +// CHECK: Punctuation: "(" [10:22 - 10:23] macro definition=REVERSE_MACRO +// CHECK: Identifier: "x" [10:23 - 10:24] macro definition=REVERSE_MACRO +// CHECK: Punctuation: "," [10:24 - 10:25] macro definition=REVERSE_MACRO +// CHECK: Identifier: "y" [10:25 - 10:26] macro definition=REVERSE_MACRO +// CHECK: Punctuation: ")" [10:26 - 10:27] macro definition=REVERSE_MACRO +// CHECK: Identifier: "y" [10:28 - 10:29] macro definition=REVERSE_MACRO +// CHECK: Punctuation: "+" [10:30 - 10:31] macro definition=REVERSE_MACRO +// CHECK: Identifier: "x" [10:32 - 10:33] macro definition=REVERSE_MACRO +// CHECK: Punctuation: "#" [11:1 - 11:2] preprocessing directive= +// CHECK: Identifier: "define" [11:2 - 11:8] preprocessing directive= +// CHECK: Identifier: "TWICE_MACRO" [11:9 - 11:20] macro definition=TWICE_MACRO +// CHECK: Punctuation: "(" [11:20 - 11:21] macro definition=TWICE_MACRO +// CHECK: Identifier: "y" [11:21 - 11:22] macro definition=TWICE_MACRO +// CHECK: Punctuation: ")" [11:22 - 11:23] macro definition=TWICE_MACRO +// CHECK: Identifier: "y" [11:24 - 11:25] macro definition=TWICE_MACRO +// CHECK: Punctuation: "+" [11:26 - 11:27] macro definition=TWICE_MACRO +// CHECK: Identifier: "y" [11:28 - 11:29] macro definition=TWICE_MACRO +// CHECK: Keyword: "void" [13:1 - 13:5] FunctionDecl=test_macro_args:13:6 (Definition) +// CHECK: Identifier: "test_macro_args" [13:6 - 13:21] FunctionDecl=test_macro_args:13:6 (Definition) +// CHECK: Punctuation: "(" [13:21 - 13:22] FunctionDecl=test_macro_args:13:6 (Definition) +// CHECK: Punctuation: ")" [13:22 - 13:23] FunctionDecl=test_macro_args:13:6 (Definition) +// CHECK: Punctuation: "{" [13:24 - 13:25] CompoundStmt= +// CHECK: Keyword: "int" [14:3 - 14:6] VarDecl=z:14:7 (Definition) +// CHECK: Identifier: "z" [14:7 - 14:8] VarDecl=z:14:7 (Definition) +// CHECK: Punctuation: "=" [14:9 - 14:10] VarDecl=z:14:7 (Definition) +// CHECK: Literal: "1" [14:11 - 14:12] IntegerLiteral= +// CHECK: Punctuation: ";" [14:12 - 14:13] DeclStmt= +// CHECK: Keyword: "int" [15:3 - 15:6] VarDecl=t:15:7 (Definition) +// CHECK: Identifier: "t" [15:7 - 15:8] VarDecl=t:15:7 (Definition) +// CHECK: Punctuation: "=" [15:9 - 15:10] VarDecl=t:15:7 (Definition) +// CHECK: Literal: "2" [15:11 - 15:12] IntegerLiteral= +// CHECK: Punctuation: ";" [15:12 - 15:13] DeclStmt= +// CHECK: Keyword: "int" [16:3 - 16:6] VarDecl=k:16:7 (Definition) +// CHECK: Identifier: "k" [16:7 - 16:8] VarDecl=k:16:7 (Definition) +// CHECK: Punctuation: "=" [16:9 - 16:10] VarDecl=k:16:7 (Definition) +// CHECK: Identifier: "REVERSE_MACRO" [16:11 - 16:24] macro expansion=REVERSE_MACRO:10:9 +// CHECK: Punctuation: "(" [16:24 - 16:25] +// CHECK: Identifier: "t" [16:25 - 16:26] DeclRefExpr=t:15:7 +// CHECK: Punctuation: "," [16:26 - 16:27] +// CHECK: Identifier: "z" [16:27 - 16:28] DeclRefExpr=z:14:7 +// FIXME: The token below should really be annotated as "macro expansion=REVERSE_MACRO:10:9" +// CHECK: Punctuation: ")" [16:28 - 16:29] DeclStmt= +// CHECK: Punctuation: ";" [16:29 - 16:30] DeclStmt= +// CHECK: Keyword: "int" [17:3 - 17:6] VarDecl=j:17:7 (Definition) +// CHECK: Identifier: "j" [17:7 - 17:8] VarDecl=j:17:7 (Definition) +// CHECK: Punctuation: "=" [17:9 - 17:10] VarDecl=j:17:7 (Definition) +// CHECK: Identifier: "TWICE_MACRO" [17:11 - 17:22] macro expansion=TWICE_MACRO:11:9 +// CHECK: Punctuation: "(" [17:22 - 17:23] +// CHECK: Identifier: "k" [17:23 - 17:24] DeclRefExpr=k:16:7 +// CHECK: Punctuation: "+" [17:25 - 17:26] BinaryOperator= +// CHECK: Identifier: "k" [17:27 - 17:28] DeclRefExpr=k:16:7 +// FIXME: The token below should really be annotated as "macro expansion=TWICE_MACRO:11:9" +// CHECK: Punctuation: ")" [17:28 - 17:29] DeclStmt= +// CHECK: Punctuation: ";" [17:29 - 17:30] DeclStmt= +// CHECK: Keyword: "int" [18:3 - 18:6] VarDecl=w:18:7 (Definition) +// CHECK: Identifier: "w" [18:7 - 18:8] VarDecl=w:18:7 (Definition) +// CHECK: Punctuation: "=" [18:9 - 18:10] VarDecl=w:18:7 (Definition) +// CHECK: Identifier: "j" [18:11 - 18:12] DeclRefExpr=j:17:7 +// CHECK: Punctuation: "+" [18:13 - 18:14] BinaryOperator= +// CHECK: Identifier: "j" [18:15 - 18:16] DeclRefExpr=j:17:7 +// CHECK: Punctuation: ";" [18:16 - 18:17] DeclStmt= +// CHECK: Punctuation: "}" [19:1 - 19:2] CompoundStmt= +// CHECK: Punctuation: "#" [21:1 - 21:2] preprocessing directive= +// CHECK: Identifier: "define" [21:2 - 21:8] preprocessing directive= +// CHECK: Identifier: "fun_with_macro_bodies" [21:9 - 21:30] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "(" [21:30 - 21:31] macro definition=fun_with_macro_bodies +// CHECK: Identifier: "x" [21:31 - 21:32] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "," [21:32 - 21:33] macro definition=fun_with_macro_bodies +// CHECK: Identifier: "y" [21:34 - 21:35] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: ")" [21:35 - 21:36] macro definition=fun_with_macro_bodies +// CHECK: Keyword: "do" [21:37 - 21:39] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "{" [21:40 - 21:41] macro definition=fun_with_macro_bodies +// CHECK: Keyword: "if" [21:42 - 21:44] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "(" [21:45 - 21:46] macro definition=fun_with_macro_bodies +// CHECK: Identifier: "x" [21:46 - 21:47] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: ")" [21:47 - 21:48] macro definition=fun_with_macro_bodies +// CHECK: Identifier: "y" [21:49 - 21:50] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "}" [21:51 - 21:52] macro definition=fun_with_macro_bodies +// CHECK: Keyword: "while" [21:53 - 21:58] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: "(" [21:59 - 21:60] macro definition=fun_with_macro_bodies +// CHECK: Literal: "0" [21:60 - 21:61] macro definition=fun_with_macro_bodies +// CHECK: Punctuation: ")" [21:61 - 21:62] macro definition=fun_with_macro_bodies +// CHECK: Keyword: "void" [23:1 - 23:5] FunctionDecl=test:23:6 (Definition) +// CHECK: Identifier: "test" [23:6 - 23:10] FunctionDecl=test:23:6 (Definition) +// CHECK: Punctuation: "(" [23:10 - 23:11] FunctionDecl=test:23:6 (Definition) +// CHECK: Punctuation: ")" [23:11 - 23:12] FunctionDecl=test:23:6 (Definition) +// CHECK: Punctuation: "{" [23:13 - 23:14] CompoundStmt= +// CHECK: Keyword: "int" [24:3 - 24:6] VarDecl=x:24:7 (Definition) +// CHECK: Identifier: "x" [24:7 - 24:8] VarDecl=x:24:7 (Definition) +// CHECK: Punctuation: "=" [24:9 - 24:10] VarDecl=x:24:7 (Definition) +// CHECK: Literal: "10" [24:11 - 24:13] IntegerLiteral= +// CHECK: Punctuation: ";" [24:13 - 24:14] DeclStmt= +// CHECK: Identifier: "fun_with_macro_bodies" [25:3 - 25:24] macro expansion=fun_with_macro_bodies:21:9 +// CHECK: Punctuation: "(" [25:24 - 25:25] CompoundStmt= +// CHECK: Identifier: "x" [25:25 - 25:26] DeclRefExpr=x:24:7 +// CHECK: Punctuation: "," [25:26 - 25:27] +// CHECK: Punctuation: "{" [25:28 - 25:29] CompoundStmt= +// CHECK: Keyword: "int" [25:30 - 25:33] DeclStmt= +// CHECK: Identifier: "z" [25:34 - 25:35] VarDecl=z:25:34 (Definition) +// CHECK: Punctuation: "=" [25:36 - 25:37] VarDecl=z:25:34 (Definition) +// CHECK: Identifier: "x" [25:38 - 25:39] DeclRefExpr=x:24:7 +// CHECK: Punctuation: ";" [25:39 - 25:40] DeclStmt= +// CHECK: Punctuation: "++" [25:41 - 25:43] UnaryOperator= +// CHECK: Identifier: "z" [25:43 - 25:44] DeclRefExpr=z:25:3 +// CHECK: Punctuation: ";" [25:44 - 25:45] CompoundStmt= +// CHECK: Punctuation: "}" [25:46 - 25:47] CompoundStmt= +// FIXME: The token below should really be annotated as "macro expansion=fun_with_macro_bodies:21:9" +// CHECK: Punctuation: ")" [25:47 - 25:48] CompoundStmt= +// CHECK: Punctuation: ";" [25:48 - 25:49] CompoundStmt= +// CHECK: Punctuation: "}" [26:1 - 26:2] CompoundStmt= +// CHECK: {{28:1.*inclusion directive=pragma-once.h.*multi-include guarded}} +// CHECK: {{29:1.*inclusion directive=guarded.h.*multi-include guarded}} +// CHECK: Identifier: "__FILE__" [31:21 - 31:29] macro expansion=__FILE__ diff --git a/clang/test/Index/annotate-tokens-preamble.c b/clang/test/Index/annotate-tokens-preamble.c new file mode 100644 index 0000000..aa222bd --- /dev/null +++ b/clang/test/Index/annotate-tokens-preamble.c @@ -0,0 +1,20 @@ +// A comment line. + +void f(void *ptr) { +} + + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 %s | FileCheck %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:1:1:5:1 %s | FileCheck %s +// CHECK: Comment: "// A comment line." [1:1 - 1:19] +// CHECK: Keyword: "void" [3:1 - 3:5] FunctionDecl=f:3:6 (Definition) +// CHECK: Identifier: "f" [3:6 - 3:7] FunctionDecl=f:3:6 (Definition) +// CHECK: Punctuation: "(" [3:7 - 3:8] FunctionDecl=f:3:6 (Definition) +// CHECK: Keyword: "void" [3:8 - 3:12] ParmDecl=ptr:3:14 (Definition) +// CHECK: Punctuation: "*" [3:13 - 3:14] ParmDecl=ptr:3:14 (Definition) +// CHECK: Identifier: "ptr" [3:14 - 3:17] ParmDecl=ptr:3:14 (Definition) +// CHECK: Punctuation: ")" [3:17 - 3:18] FunctionDecl=f:3:6 (Definition) +// CHECK: Punctuation: "{" [3:19 - 3:20] CompoundStmt= +// CHECK: Punctuation: "}" [4:1 - 4:2] CompoundStmt= + + diff --git a/clang/test/Index/annotate-tokens-with-default-args.cpp b/clang/test/Index/annotate-tokens-with-default-args.cpp new file mode 100644 index 0000000..d5ca706 --- /dev/null +++ b/clang/test/Index/annotate-tokens-with-default-args.cpp @@ -0,0 +1,16 @@ +#include "annotate-tokens-with-default-args.h" + +void Foo::m(Foo *f) {} + +// RUN: c-index-test -test-annotate-tokens=%s:3:1:4:1 %s | FileCheck %s +// CHECK: Keyword: "void" [3:1 - 3:5] CXXMethod=m:3:11 (Definition) +// CHECK: Identifier: "Foo" [3:6 - 3:9] TypeRef=struct Foo:1:8 +// CHECK: Punctuation: "::" [3:9 - 3:11] CXXMethod=m:3:11 (Definition) +// CHECK: Identifier: "m" [3:11 - 3:12] CXXMethod=m:3:11 (Definition) +// CHECK: Punctuation: "(" [3:12 - 3:13] CXXMethod=m:3:11 (Definition) +// CHECK: Identifier: "Foo" [3:13 - 3:16] TypeRef=struct Foo:1:8 +// CHECK: Punctuation: "*" [3:17 - 3:18] ParmDecl=f:3:18 (Definition) +// CHECK: Identifier: "f" [3:18 - 3:19] ParmDecl=f:3:18 (Definition) +// CHECK: Punctuation: ")" [3:19 - 3:20] CXXMethod=m:3:11 (Definition) +// CHECK: Punctuation: "{" [3:21 - 3:22] CompoundStmt= +// CHECK: Punctuation: "}" [3:22 - 3:23] CompoundStmt= diff --git a/clang/test/Index/annotate-tokens-with-default-args.h b/clang/test/Index/annotate-tokens-with-default-args.h new file mode 100644 index 0000000..323c519 --- /dev/null +++ b/clang/test/Index/annotate-tokens-with-default-args.h @@ -0,0 +1,3 @@ +struct Foo { + void m(Foo *f = 0); +}; diff --git a/clang/test/Index/annotate-tokens.c b/clang/test/Index/annotate-tokens.c new file mode 100644 index 0000000..0b5f3d4 --- /dev/null +++ b/clang/test/Index/annotate-tokens.c @@ -0,0 +1,136 @@ +typedef int T; +struct X { int a, b; }; +void f(void *ptr) { + T* t_ptr = (T *)ptr; + (void)sizeof(T); + /* A comment */ + struct X x = (struct X){1, 2}; + void *xx = ptr ? : &x; + const char * hello = "Hello"; +} +enum Color { Red, Green, Blue }; +typedef int Int; +enum Color g(int i, ...) { + __builtin_va_list va; + (void)__builtin_va_arg(va, Int); + (void)__builtin_types_compatible_p(Int, Int); + + struct X x = { 0, 0 }; + do { + x.a++; + } while (x.a < 10); + + enum Color c; + switch (c) { + case Red: + return Green; + + case Green: + return Blue; + + case Blue: + return Red; + } +} + +// RUN: c-index-test -test-annotate-tokens=%s:4:1:34:1 %s | FileCheck %s +// CHECK: Identifier: "T" [4:3 - 4:4] TypeRef=T:1:13 +// CHECK: Punctuation: "*" [4:4 - 4:5] VarDecl=t_ptr:4:6 (Definition) +// CHECK: Identifier: "t_ptr" [4:6 - 4:11] VarDecl=t_ptr:4:6 (Definition) +// CHECK: Punctuation: "=" [4:12 - 4:13] VarDecl=t_ptr:4:6 (Definition) +// CHECK: Punctuation: "(" [4:14 - 4:15] CStyleCastExpr= +// CHECK: Identifier: "T" [4:15 - 4:16] TypeRef=T:1:13 +// CHECK: Identifier: "ptr" [4:19 - 4:22] DeclRefExpr=ptr:3:14 +// CHECK: Punctuation: ";" [4:22 - 4:23] DeclStmt= +// CHECK: Punctuation: "(" [5:3 - 5:4] CStyleCastExpr= +// CHECK: Keyword: "void" [5:4 - 5:8] CStyleCastExpr= +// CHECK: Punctuation: ")" [5:8 - 5:9] CStyleCastExpr= +// CHECK: Keyword: "sizeof" [5:9 - 5:15] UnexposedExpr= +// CHECK: Punctuation: "(" [5:15 - 5:16] UnexposedExpr= +// CHECK: Identifier: "T" [5:16 - 5:17] TypeRef=T:1:13 +// CHECK: Punctuation: ")" [5:17 - 5:18] UnexposedExpr= +// CHECK: Punctuation: ";" [5:18 - 5:19] CompoundStmt= +// CHECK: Keyword: "struct" [7:3 - 7:9] VarDecl=x:7:12 (Definition) +// CHECK: Identifier: "X" [7:10 - 7:11] TypeRef=struct X:2:8 +// CHECK: Identifier: "x" [7:12 - 7:13] VarDecl=x:7:12 (Definition) +// CHECK: Punctuation: "=" [7:14 - 7:15] VarDecl=x:7:12 (Definition) +// CHECK: Punctuation: "(" [7:16 - 7:17] CompoundLiteralExpr= +// CHECK: Keyword: "struct" [7:17 - 7:23] CompoundLiteralExpr= +// CHECK: Identifier: "X" [7:24 - 7:25] TypeRef=struct X:2:8 +// CHECK: Punctuation: ")" [7:25 - 7:26] CompoundLiteralExpr= +// CHECK: Punctuation: "{" [7:26 - 7:27] InitListExpr= +// CHECK: Literal: "1" [7:27 - 7:28] IntegerLiteral= +// CHECK: Punctuation: "," [7:28 - 7:29] InitListExpr= +// CHECK: Literal: "2" [7:30 - 7:31] IntegerLiteral= +// CHECK: Punctuation: "}" [7:31 - 7:32] InitListExpr= +// CHECK: Punctuation: ";" [7:32 - 7:33] DeclStmt= +// CHECK: Keyword: "void" [8:3 - 8:7] VarDecl=xx:8:9 (Definition) +// CHECK: Punctuation: "*" [8:8 - 8:9] VarDecl=xx:8:9 (Definition) +// CHECK: Identifier: "xx" [8:9 - 8:11] VarDecl=xx:8:9 (Definition) +// CHECK: Punctuation: "=" [8:12 - 8:13] VarDecl=xx:8:9 (Definition) +// CHECK: Identifier: "ptr" [8:14 - 8:17] DeclRefExpr=ptr:3:14 +// CHECK: Punctuation: "?" [8:18 - 8:19] UnexposedExpr= +// CHECK: Punctuation: ":" [8:20 - 8:21] UnexposedExpr= +// CHECK: Punctuation: "&" [8:22 - 8:23] UnaryOperator= +// CHECK: Identifier: "x" [8:23 - 8:24] DeclRefExpr=x:7:12 +// CHECK: Punctuation: ";" [8:24 - 8:25] DeclStmt= +// CHECK: Keyword: "const" [9:3 - 9:8] DeclStmt= +// CHECK: Keyword: "char" [9:9 - 9:13] VarDecl=hello:9:16 (Definition) +// CHECK: Punctuation: "*" [9:14 - 9:15] VarDecl=hello:9:16 (Definition) +// CHECK: Identifier: "hello" [9:16 - 9:21] VarDecl=hello:9:16 (Definition) +// CHECK: Punctuation: "=" [9:22 - 9:23] VarDecl=hello:9:16 (Definition) +// CHECK: Literal: ""Hello"" [9:24 - 9:31] StringLiteral= +// CHECK: Punctuation: ";" [9:31 - 9:32] DeclStmt= +// CHECK: Punctuation: "}" [10:1 - 10:2] CompoundStmt= +// CHECK: Keyword: "__builtin_va_arg" [15:9 - 15:25] UnexposedExpr= +// CHECK: Identifier: "Int" [15:30 - 15:33] TypeRef=Int:12:13 +// CHECK: Keyword: "__builtin_types_compatible_p" [16:9 - 16:37] UnexposedExpr= +// CHECK: Identifier: "Int" [16:38 - 16:41] TypeRef=Int:12:13 +// CHECK: Punctuation: "," [16:41 - 16:42] UnexposedExpr= +// CHECK: Identifier: "Int" [16:43 - 16:46] TypeRef=Int:12:13 +// CHECK: Keyword: "struct" [18:3 - 18:9] VarDecl=x:18:12 (Definition) +// CHECK: Identifier: "X" [18:10 - 18:11] TypeRef=struct X:2:8 +// CHECK: Identifier: "x" [18:12 - 18:13] VarDecl=x:18:12 (Definition) +// CHECK: Keyword: "do" [19:3 - 19:5] DoStmt= +// CHECK: Identifier: "x" [20:5 - 20:6] DeclRefExpr=x:18:12 +// CHECK: Punctuation: "." [20:6 - 20:7] MemberRefExpr=a:2:16 +// CHECK: Identifier: "a" [20:7 - 20:8] MemberRefExpr=a:2:16 +// CHECK: Punctuation: "++" [20:8 - 20:10] UnaryOperator= +// CHECK: Punctuation: ";" [20:10 - 20:11] CompoundStmt= +// CHECK: Punctuation: "}" [21:3 - 21:4] CompoundStmt= +// CHECK: Keyword: "while" [21:5 - 21:10] DoStmt= +// CHECK: Punctuation: "(" [21:11 - 21:12] DoStmt= +// CHECK: Identifier: "x" [21:12 - 21:13] DeclRefExpr=x:18:12 +// CHECK: Punctuation: "." [21:13 - 21:14] MemberRefExpr=a:2:16 +// CHECK: Identifier: "a" [21:14 - 21:15] MemberRefExpr=a:2:16 + +// CHECK: Keyword: "enum" [23:3 - 23:7] VarDecl=c:23:14 (Definition) +// CHECK: Identifier: "Color" [23:8 - 23:13] TypeRef=enum Color:11:6 +// CHECK: Identifier: "c" [23:14 - 23:15] VarDecl=c:23:14 (Definition) +// CHECK: Punctuation: ";" [23:15 - 23:16] DeclStmt= +// CHECK: Keyword: "switch" [24:3 - 24:9] SwitchStmt= +// CHECK: Punctuation: "(" [24:10 - 24:11] SwitchStmt= +// CHECK: Identifier: "c" [24:11 - 24:12] DeclRefExpr=c:23:14 +// CHECK: Punctuation: ")" [24:12 - 24:13] SwitchStmt= +// CHECK: Punctuation: "{" [24:14 - 24:15] CompoundStmt= +// CHECK: Keyword: "case" [25:3 - 25:7] CaseStmt= +// CHECK: Identifier: "Red" [25:8 - 25:11] DeclRefExpr=Red:11:14 +// CHECK: Punctuation: ":" [25:11 - 25:12] CaseStmt= +// CHECK: Keyword: "return" [26:5 - 26:11] ReturnStmt= +// CHECK: Identifier: "Green" [26:12 - 26:17] DeclRefExpr=Green:11:19 +// CHECK: Punctuation: ";" [26:17 - 26:18] CompoundStmt= +// CHECK: Keyword: "case" [28:3 - 28:7] CaseStmt= +// CHECK: Identifier: "Green" [28:8 - 28:13] DeclRefExpr=Green:11:19 +// CHECK: Punctuation: ":" [28:13 - 28:14] CaseStmt= +// CHECK: Keyword: "return" [29:5 - 29:11] ReturnStmt= +// CHECK: Identifier: "Blue" [29:12 - 29:16] DeclRefExpr=Blue:11:26 +// CHECK: Punctuation: ";" [29:16 - 29:17] CompoundStmt= +// CHECK: Keyword: "case" [31:3 - 31:7] CaseStmt= +// CHECK: Identifier: "Blue" [31:8 - 31:12] DeclRefExpr=Blue:11:26 +// CHECK: Punctuation: ":" [31:12 - 31:13] CaseStmt= +// CHECK: Keyword: "return" [32:5 - 32:11] ReturnStmt= +// CHECK: Identifier: "Red" [32:12 - 32:15] DeclRefExpr=Red:11:14 +// CHECK: Punctuation: ";" [32:15 - 32:16] CompoundStmt= + +// RUN: c-index-test -test-annotate-tokens=%s:4:1:165:32 %s | FileCheck %s +// RUN: c-index-test -test-annotate-tokens=%s:4:1:165:38 %s | FileCheck %s diff --git a/clang/test/Index/annotate-tokens.cpp b/clang/test/Index/annotate-tokens.cpp new file mode 100644 index 0000000..3062901 --- /dev/null +++ b/clang/test/Index/annotate-tokens.cpp @@ -0,0 +1,122 @@ +struct bonk { }; +void test(bonk X) { + X = X; + __is_base_of(bonk, bonk); +} + +struct X { + X operator++(); + X operator++(int); +}; +void test2(X x) { + ++(x); + (x)++; +} + +struct S1 { void f(); }; +struct S2 { S1 *operator->(); }; +void test3(S2 s2) { + s2->f(); + X foo; +} + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:21:1 %s | FileCheck %s +// CHECK: Keyword: "struct" [1:1 - 1:7] StructDecl=bonk:1:8 (Definition) +// CHECK: Identifier: "bonk" [1:8 - 1:12] StructDecl=bonk:1:8 (Definition) +// CHECK: Punctuation: "{" [1:13 - 1:14] StructDecl=bonk:1:8 (Definition) +// CHECK: Punctuation: "}" [1:15 - 1:16] StructDecl=bonk:1:8 (Definition) +// CHECK: Punctuation: ";" [1:16 - 1:17] +// CHECK: Keyword: "void" [2:1 - 2:5] FunctionDecl=test:2:6 (Definition) +// CHECK: Identifier: "test" [2:6 - 2:10] FunctionDecl=test:2:6 (Definition) +// CHECK: Punctuation: "(" [2:10 - 2:11] FunctionDecl=test:2:6 (Definition) +// CHECK: Identifier: "bonk" [2:11 - 2:15] TypeRef=struct bonk:1:8 +// CHECK: Identifier: "X" [2:16 - 2:17] ParmDecl=X:2:16 (Definition) +// CHECK: Punctuation: ")" [2:17 - 2:18] FunctionDecl=test:2:6 (Definition) +// CHECK: Punctuation: "{" [2:19 - 2:20] CompoundStmt= +// CHECK: Identifier: "X" [3:5 - 3:6] DeclRefExpr=X:2:16 +// CHECK: Punctuation: "=" [3:7 - 3:8] DeclRefExpr=operator=:1:8 +// CHECK: Identifier: "X" [3:9 - 3:10] DeclRefExpr=X:2:16 +// CHECK: Punctuation: ";" [3:10 - 3:11] CompoundStmt= +// CHECK: Keyword: "__is_base_of" [4:5 - 4:17] UnexposedExpr= +// CHECK: Punctuation: "(" [4:17 - 4:18] UnexposedExpr= +// CHECK: Identifier: "bonk" [4:18 - 4:22] TypeRef=struct bonk:1:8 +// CHECK: Punctuation: "," [4:22 - 4:23] UnexposedExpr= +// CHECK: Identifier: "bonk" [4:24 - 4:28] TypeRef=struct bonk:1:8 +// CHECK: Punctuation: ")" [4:28 - 4:29] UnexposedExpr= +// CHECK: Punctuation: ";" [4:29 - 4:30] CompoundStmt= +// CHECK: Punctuation: "}" [5:1 - 5:2] CompoundStmt= +// CHECK: Keyword: "struct" [7:1 - 7:7] StructDecl=X:7:8 (Definition) +// CHECK: Identifier: "X" [7:8 - 7:9] StructDecl=X:7:8 (Definition) +// CHECK: Punctuation: "{" [7:10 - 7:11] StructDecl=X:7:8 (Definition) +// CHECK: Identifier: "X" [8:3 - 8:4] TypeRef=struct X:7:8 +// CHECK: Keyword: "operator" [8:5 - 8:13] CXXMethod=operator++:8:5 +// CHECK: Punctuation: "++" [8:13 - 8:15] CXXMethod=operator++:8:5 +// CHECK: Punctuation: "(" [8:15 - 8:16] CXXMethod=operator++:8:5 +// CHECK: Punctuation: ")" [8:16 - 8:17] CXXMethod=operator++:8:5 +// CHECK: Punctuation: ";" [8:17 - 8:18] StructDecl=X:7:8 (Definition) +// CHECK: Identifier: "X" [9:3 - 9:4] TypeRef=struct X:7:8 +// CHECK: Keyword: "operator" [9:5 - 9:13] CXXMethod=operator++:9:5 +// CHECK: Punctuation: "++" [9:13 - 9:15] CXXMethod=operator++:9:5 +// CHECK: Punctuation: "(" [9:15 - 9:16] CXXMethod=operator++:9:5 +// CHECK: Keyword: "int" [9:16 - 9:19] ParmDecl=:9:19 (Definition) +// CHECK: Punctuation: ")" [9:19 - 9:20] ParmDecl=:9:19 (Definition) +// CHECK: Punctuation: ";" [9:20 - 9:21] StructDecl=X:7:8 (Definition) +// CHECK: Punctuation: "}" [10:1 - 10:2] StructDecl=X:7:8 (Definition) +// CHECK: Punctuation: ";" [10:2 - 10:3] +// CHECK: Keyword: "void" [11:1 - 11:5] FunctionDecl=test2:11:6 (Definition) +// CHECK: Identifier: "test2" [11:6 - 11:11] FunctionDecl=test2:11:6 (Definition) +// CHECK: Punctuation: "(" [11:11 - 11:12] FunctionDecl=test2:11:6 (Definition) +// CHECK: Identifier: "X" [11:12 - 11:13] TypeRef=struct X:7:8 +// CHECK: Identifier: "x" [11:14 - 11:15] ParmDecl=x:11:14 (Definition) +// CHECK: Punctuation: ")" [11:15 - 11:16] FunctionDecl=test2:11:6 (Definition) +// CHECK: Punctuation: "{" [11:17 - 11:18] CompoundStmt= +// CHECK: Punctuation: "++" [12:3 - 12:5] CallExpr=operator++:8:5 +// CHECK: Punctuation: "(" [12:5 - 12:6] ParenExpr= +// CHECK: Identifier: "x" [12:6 - 12:7] DeclRefExpr=x:11:14 +// CHECK: Punctuation: ")" [12:7 - 12:8] ParenExpr= +// CHECK: Punctuation: ";" [12:8 - 12:9] CompoundStmt= +// CHECK: Punctuation: "(" [13:3 - 13:4] ParenExpr= +// CHECK: Identifier: "x" [13:4 - 13:5] DeclRefExpr=x:11:14 +// CHECK: Punctuation: ")" [13:5 - 13:6] ParenExpr= +// CHECK: Punctuation: "++" [13:6 - 13:8] DeclRefExpr=operator++:9:5 +// CHECK: Punctuation: ";" [13:8 - 13:9] CompoundStmt= +// CHECK: Punctuation: "}" [14:1 - 14:2] CompoundStmt= +// CHECK: Keyword: "struct" [16:1 - 16:7] StructDecl=S1:16:8 (Definition) +// CHECK: Identifier: "S1" [16:8 - 16:10] StructDecl=S1:16:8 (Definition) +// CHECK: Punctuation: "{" [16:11 - 16:12] StructDecl=S1:16:8 (Definition) +// CHECK: Keyword: "void" [16:13 - 16:17] CXXMethod=f:16:18 +// CHECK: Identifier: "f" [16:18 - 16:19] CXXMethod=f:16:18 +// CHECK: Punctuation: "(" [16:19 - 16:20] CXXMethod=f:16:18 +// CHECK: Punctuation: ")" [16:20 - 16:21] CXXMethod=f:16:18 +// CHECK: Punctuation: ";" [16:21 - 16:22] StructDecl=S1:16:8 (Definition) +// CHECK: Punctuation: "}" [16:23 - 16:24] StructDecl=S1:16:8 (Definition) +// CHECK: Punctuation: ";" [16:24 - 16:25] +// CHECK: Keyword: "struct" [17:1 - 17:7] StructDecl=S2:17:8 (Definition) +// CHECK: Identifier: "S2" [17:8 - 17:10] StructDecl=S2:17:8 (Definition) +// CHECK: Punctuation: "{" [17:11 - 17:12] StructDecl=S2:17:8 (Definition) +// CHECK: Identifier: "S1" [17:13 - 17:15] TypeRef=struct S1:16:8 +// CHECK: Punctuation: "*" [17:16 - 17:17] CXXMethod=operator->:17:17 +// CHECK: Keyword: "operator" [17:17 - 17:25] CXXMethod=operator->:17:17 +// CHECK: Punctuation: "->" [17:25 - 17:27] CXXMethod=operator->:17:17 +// CHECK: Punctuation: "(" [17:27 - 17:28] CXXMethod=operator->:17:17 +// CHECK: Punctuation: ")" [17:28 - 17:29] CXXMethod=operator->:17:17 +// CHECK: Punctuation: ";" [17:29 - 17:30] StructDecl=S2:17:8 (Definition) +// CHECK: Punctuation: "}" [17:31 - 17:32] StructDecl=S2:17:8 (Definition) +// CHECK: Punctuation: ";" [17:32 - 17:33] +// CHECK: Keyword: "void" [18:1 - 18:5] FunctionDecl=test3:18:6 (Definition) +// CHECK: Identifier: "test3" [18:6 - 18:11] FunctionDecl=test3:18:6 (Definition) +// CHECK: Punctuation: "(" [18:11 - 18:12] FunctionDecl=test3:18:6 (Definition) +// CHECK: Identifier: "S2" [18:12 - 18:14] TypeRef=struct S2:17:8 +// CHECK: Identifier: "s2" [18:15 - 18:17] ParmDecl=s2:18:15 (Definition) +// CHECK: Punctuation: ")" [18:17 - 18:18] FunctionDecl=test3:18:6 (Definition) +// CHECK: Punctuation: "{" [18:19 - 18:20] CompoundStmt= +// CHECK: Identifier: "s2" [19:3 - 19:5] DeclRefExpr=s2:18:15 +// CHECK: Punctuation: "->" [19:5 - 19:7] DeclRefExpr=operator->:17:17 +// CHECK: Identifier: "f" [19:7 - 19:8] MemberRefExpr=f:16:18 +// CHECK: Punctuation: "(" [19:8 - 19:9] CallExpr=f:16:18 +// CHECK: Punctuation: ")" [19:9 - 19:10] CallExpr=f:16:18 +// CHECK: Punctuation: ";" [19:10 - 19:11] CompoundStmt= +// CHECK: Identifier: "X" [20:3 - 20:4] TypeRef=struct X:7:8 +// CHECK: Identifier: "foo" [20:5 - 20:8] VarDecl=foo:20:5 (Definition) +// CHECK: Punctuation: ";" [20:8 - 20:9] DeclStmt= +// CHECK: Punctuation: "}" [21:1 - 21:2] CompoundStmt= diff --git a/clang/test/Index/annotate-tokens.m b/clang/test/Index/annotate-tokens.m new file mode 100644 index 0000000..1a48293 --- /dev/null +++ b/clang/test/Index/annotate-tokens.m @@ -0,0 +1,576 @@ +@interface Foo +- (int)compare:(Foo*)other; +@end + +@implementation Foo +- (int)compare:(Foo*)other { + return 0; + (void)@encode(Foo); +} +@end + +// From <rdar://problem/7971430>, the 'barType' referenced in the ivar +// declarations should be annotated as TypeRefs. +typedef int * barType; +@interface Bar +{ + barType iVar; + barType iVar1, iVar2; +} +@end +@implementation Bar +- (void) method +{ + barType local = iVar; +} +@end + +// From <rdar://problem/7967123>. The ranges for attributes are not +// currently stored, causing most of the tokens to be falsely annotated. +// Since there are no source ranges for attributes, we currently don't +// annotate them. +@interface IBActionTests +- (IBAction) actionMethod:(in id)arg; +- (void)foo:(int)x; +@end +extern int ibaction_test(void); +@implementation IBActionTests +- (IBAction) actionMethod:(in id)arg +{ + ibaction_test(); + [self foo:0]; +} +- (void) foo:(int)x +{ + (void) x; +} +@end + +// From <rdar://problem/7961995>. Essentially the same issue as 7967123, +// but impacting code marked as IBOutlets. +@interface IBOutletTests +{ + IBOutlet char * anOutlet; +} +- (IBAction) actionMethod:(id)arg; +@property IBOutlet int * aPropOutlet; +@end + +// From <rdar://problem/7974151>. The first 'foo:' wasn't being annotated as +// being part of the Objective-C message expression since the argument +// was expanded from a macro. + +#define VAL 0 + +@interface R7974151 +- (int) foo:(int)arg; +- (int) method; +@end + +@implementation R7974151 +- (int) foo:(int)arg { + return arg; +} +- (int) method +{ + int local = [self foo:VAL]; + int second = [self foo:0]; + return local; +} +- (int)othermethod:(IBOutletTests *)ibt { + return *ibt.aPropOutlet; +} +@end + +@protocol Proto @end + +void f() { + (void)@protocol(Proto); +} + +// <rdar://problem/8595462> - Properly annotate functions and variables +// declared within an @implementation. +@class Rdar8595462_A; +@interface Rdar8595462_B +@end + +@implementation Rdar8595462_B +Rdar8595462_A * Rdar8595462_aFunction() { + Rdar8595462_A * localVar = 0; + return localVar; +} +static Rdar8595462_A * Rdar8595462_staticVar; +@end + +// <rdar://problem/8595386> Issues doing syntax coloring of properties +@interface Rdar8595386 { + Foo *_foo; +} + +@property (readonly, copy) Foo *foo; +@property (readonly) Foo *foo2; +@end + +@implementation Rdar8595386 +@synthesize foo = _foo; +@dynamic foo2; +@end + +// <rdar://problem/8778404> Blocks don't get colored if annotation starts within the block itself +@interface Rdar8778404 +@end + +@implementation Rdar8778404 +- (int)blah:(int)arg, ... { return arg; } +- (int)blarg:(int)x { + (void)^ { + int result = [self blah:5, x]; + Rdar8778404 *a = self; + return 0; + }; +} +@end + +@interface Rdar8062781 ++ (Foo*)getB; +@property (readonly, nonatomic) Foo *blah; +@property (readonly, atomic) Foo *abah; +@end + +@interface rdar9535717 { + __weak Foo *foo; +} +@end + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:118:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck %s +// CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Identifier: "Foo" [1:12 - 1:15] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Punctuation: "-" [2:1 - 2:2] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Punctuation: "(" [2:3 - 2:4] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Keyword: "int" [2:4 - 2:7] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Punctuation: ")" [2:7 - 2:8] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Identifier: "compare" [2:8 - 2:15] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Punctuation: ":" [2:15 - 2:16] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Punctuation: "(" [2:16 - 2:17] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Identifier: "Foo" [2:17 - 2:20] ObjCClassRef=Foo:1:12 +// CHECK: Punctuation: "*" [2:20 - 2:21] ParmDecl=other:2:22 (Definition) +// CHECK: Punctuation: ")" [2:21 - 2:22] ParmDecl=other:2:22 (Definition) +// CHECK: Identifier: "other" [2:22 - 2:27] ParmDecl=other:2:22 (Definition) +// CHECK: Punctuation: ";" [2:27 - 2:28] ObjCInstanceMethodDecl=compare::2:8 +// CHECK: Punctuation: "@" [3:1 - 3:2] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Keyword: "end" [3:2 - 3:5] ObjCInterfaceDecl=Foo:1:12 +// CHECK: Punctuation: "@" [5:1 - 5:2] ObjCImplementationDecl=Foo:5:17 (Definition) +// CHECK: Keyword: "implementation" [5:2 - 5:16] ObjCImplementationDecl=Foo:5:17 (Definition) +// CHECK: Identifier: "Foo" [5:17 - 5:20] ObjCImplementationDecl=Foo:5:17 (Definition) +// CHECK: Punctuation: "-" [6:1 - 6:2] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Punctuation: "(" [6:3 - 6:4] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Keyword: "int" [6:4 - 6:7] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Punctuation: ")" [6:7 - 6:8] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Identifier: "compare" [6:8 - 6:15] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Punctuation: ":" [6:15 - 6:16] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Punctuation: "(" [6:16 - 6:17] ObjCInstanceMethodDecl=compare::6:8 (Definition) +// CHECK: Identifier: "Foo" [6:17 - 6:20] ObjCClassRef=Foo:1:12 +// CHECK: Punctuation: "*" [6:20 - 6:21] ParmDecl=other:6:22 (Definition) +// CHECK: Punctuation: ")" [6:21 - 6:22] ParmDecl=other:6:22 (Definition) +// CHECK: Identifier: "other" [6:22 - 6:27] ParmDecl=other:6:22 (Definition) +// CHECK: Punctuation: "{" [6:28 - 6:29] CompoundStmt= +// CHECK: Keyword: "return" [7:3 - 7:9] ReturnStmt= +// CHECK: Literal: "0" [7:10 - 7:11] IntegerLiteral= +// CHECK: Punctuation: ";" [7:11 - 7:12] CompoundStmt= +// CHECK: Punctuation: "(" [8:3 - 8:4] CStyleCastExpr= +// CHECK: Keyword: "void" [8:4 - 8:8] CStyleCastExpr= +// CHECK: Punctuation: ")" [8:8 - 8:9] CStyleCastExpr= +// CHECK: Punctuation: "@" [8:9 - 8:10] ObjCEncodeExpr= +// CHECK: Keyword: "encode" [8:10 - 8:16] ObjCEncodeExpr= +// CHECK: Punctuation: "(" [8:16 - 8:17] ObjCEncodeExpr= +// CHECK: Identifier: "Foo" [8:17 - 8:20] ObjCClassRef=Foo:1:12 +// CHECK: Punctuation: ")" [8:20 - 8:21] ObjCEncodeExpr= +// CHECK: Punctuation: ";" [8:21 - 8:22] CompoundStmt= +// CHECK: Punctuation: "}" [9:1 - 9:2] CompoundStmt= +// CHECK: Punctuation: "@" [10:1 - 10:2] ObjCImplementationDecl=Foo:5:17 (Definition) +// CHECK: Keyword: "end" [10:2 - 10:5] +// CHECK: Keyword: "typedef" [14:1 - 14:8] +// CHECK: Keyword: "int" [14:9 - 14:12] +// CHECK: Punctuation: "*" [14:13 - 14:14] +// CHECK: Identifier: "barType" [14:15 - 14:22] TypedefDecl=barType:14:15 (Definition) +// CHECK: Punctuation: ";" [14:22 - 14:23] +// CHECK: Punctuation: "@" [15:1 - 15:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Keyword: "interface" [15:2 - 15:11] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "Bar" [15:12 - 15:15] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "{" [16:1 - 16:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "barType" [17:5 - 17:12] TypeRef=barType:14:15 +// CHECK: Identifier: "iVar" [17:13 - 17:17] ObjCIvarDecl=iVar:17:13 (Definition) +// CHECK: Punctuation: ";" [17:17 - 17:18] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Identifier: "barType" [18:5 - 18:12] TypeRef=barType:14:15 +// CHECK: Identifier: "iVar1" [18:13 - 18:18] ObjCIvarDecl=iVar1:18:13 (Definition) +// CHECK: Punctuation: "," [18:18 - 18:19] ObjCIvarDecl=iVar2:18:20 (Definition) +// CHECK: Identifier: "iVar2" [18:20 - 18:25] ObjCIvarDecl=iVar2:18:20 (Definition) +// CHECK: Punctuation: ";" [18:25 - 18:26] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "}" [19:1 - 19:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "@" [20:1 - 20:2] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Keyword: "end" [20:2 - 20:5] ObjCInterfaceDecl=Bar:15:12 +// CHECK: Punctuation: "@" [21:1 - 21:2] ObjCImplementationDecl=Bar:21:17 (Definition) +// CHECK: Keyword: "implementation" [21:2 - 21:16] ObjCImplementationDecl=Bar:21:17 (Definition) +// CHECK: Identifier: "Bar" [21:17 - 21:20] ObjCImplementationDecl=Bar:21:17 (Definition) +// CHECK: Punctuation: "-" [22:1 - 22:2] ObjCInstanceMethodDecl=method:22:10 (Definition) +// CHECK: Punctuation: "(" [22:3 - 22:4] ObjCInstanceMethodDecl=method:22:10 (Definition) +// CHECK: Keyword: "void" [22:4 - 22:8] ObjCInstanceMethodDecl=method:22:10 (Definition) +// CHECK: Punctuation: ")" [22:8 - 22:9] ObjCInstanceMethodDecl=method:22:10 (Definition) +// CHECK: Identifier: "method" [22:10 - 22:16] ObjCInstanceMethodDecl=method:22:10 (Definition) +// CHECK: Punctuation: "{" [23:1 - 23:2] CompoundStmt= +// CHECK: Identifier: "barType" [24:5 - 24:12] TypeRef=barType:14:15 +// CHECK: Identifier: "local" [24:13 - 24:18] VarDecl=local:24:13 (Definition) +// CHECK: Punctuation: "=" [24:19 - 24:20] VarDecl=local:24:13 (Definition) +// CHECK: Identifier: "iVar" [24:21 - 24:25] MemberRefExpr=iVar:17:13 +// CHECK: Punctuation: ";" [24:25 - 24:26] DeclStmt= +// CHECK: Punctuation: "}" [25:1 - 25:2] CompoundStmt= +// CHECK: Punctuation: "@" [26:1 - 26:2] ObjCImplementationDecl=Bar:21:17 (Definition) +// CHECK: Keyword: "end" [26:2 - 26:5] +// CHECK: Punctuation: "@" [32:1 - 32:2] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "interface" [32:2 - 32:11] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Identifier: "IBActionTests" [32:12 - 32:25] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Punctuation: "-" [33:1 - 33:2] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "(" [33:3 - 33:4] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "IBAction" [33:4 - 33:12] macro expansion=IBAction +// CHECK: Punctuation: ")" [33:12 - 33:13] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "actionMethod" [33:14 - 33:26] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: ":" [33:26 - 33:27] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "(" [33:27 - 33:28] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Keyword: "in" [33:28 - 33:30] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Identifier: "id" [33:31 - 33:33] TypeRef=id:0:0 +// CHECK: Punctuation: ")" [33:33 - 33:34] ParmDecl=arg:33:34 (Definition) +// CHECK: Identifier: "arg" [33:34 - 33:37] ParmDecl=arg:33:34 (Definition) +// CHECK: Punctuation: ";" [33:37 - 33:38] ObjCInstanceMethodDecl=actionMethod::33:1 +// CHECK: Punctuation: "-" [34:1 - 34:2] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Punctuation: "(" [34:3 - 34:4] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Keyword: "void" [34:4 - 34:8] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Punctuation: ")" [34:8 - 34:9] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Identifier: "foo" [34:9 - 34:12] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Punctuation: ":" [34:12 - 34:13] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Punctuation: "(" [34:13 - 34:14] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Keyword: "int" [34:14 - 34:17] ParmDecl=x:34:18 (Definition) +// CHECK: Punctuation: ")" [34:17 - 34:18] ParmDecl=x:34:18 (Definition) +// CHECK: Identifier: "x" [34:18 - 34:19] ParmDecl=x:34:18 (Definition) +// CHECK: Punctuation: ";" [34:19 - 34:20] ObjCInstanceMethodDecl=foo::34:9 +// CHECK: Punctuation: "@" [35:1 - 35:2] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "end" [35:2 - 35:5] ObjCInterfaceDecl=IBActionTests:32:12 +// CHECK: Keyword: "extern" [36:1 - 36:7] +// CHECK: Keyword: "int" [36:8 - 36:11] FunctionDecl=ibaction_test:36:12 +// CHECK: Identifier: "ibaction_test" [36:12 - 36:25] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: "(" [36:25 - 36:26] FunctionDecl=ibaction_test:36:12 +// CHECK: Keyword: "void" [36:26 - 36:30] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: ")" [36:30 - 36:31] FunctionDecl=ibaction_test:36:12 +// CHECK: Punctuation: ";" [36:31 - 36:32] +// CHECK: Punctuation: "@" [37:1 - 37:2] ObjCImplementationDecl=IBActionTests:37:17 (Definition) +// CHECK: Keyword: "implementation" [37:2 - 37:16] ObjCImplementationDecl=IBActionTests:37:17 (Definition) +// CHECK: Identifier: "IBActionTests" [37:17 - 37:30] ObjCImplementationDecl=IBActionTests:37:17 (Definition) +// CHECK: Punctuation: "-" [38:1 - 38:2] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Punctuation: "(" [38:3 - 38:4] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Identifier: "IBAction" [38:4 - 38:12] macro expansion=IBAction +// CHECK: Punctuation: ")" [38:12 - 38:13] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Identifier: "actionMethod" [38:14 - 38:26] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Punctuation: ":" [38:26 - 38:27] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Keyword: "in" [38:28 - 38:30] ObjCInstanceMethodDecl=actionMethod::38:14 (Definition) +// CHECK: Identifier: "id" [38:31 - 38:33] TypeRef=id:0:0 +// CHECK: Punctuation: ")" [38:33 - 38:34] ParmDecl=arg:38:34 (Definition) +// CHECK: Identifier: "arg" [38:34 - 38:37] ParmDecl=arg:38:34 (Definition) +// CHECK: Punctuation: "{" [39:1 - 39:2] CompoundStmt= +// CHECK: Identifier: "ibaction_test" [40:5 - 40:18] DeclRefExpr=ibaction_test:36:12 +// CHECK: Punctuation: "(" [40:18 - 40:19] CallExpr=ibaction_test:36:12 +// CHECK: Punctuation: ")" [40:19 - 40:20] CallExpr=ibaction_test:36:12 +// CHECK: Punctuation: ";" [40:20 - 40:21] CompoundStmt= +// CHECK: Punctuation: "[" [41:5 - 41:6] ObjCMessageExpr=foo::34:9 +// CHECK: Identifier: "self" [41:6 - 41:10] DeclRefExpr=self:0:0 +// CHECK: Identifier: "foo" [41:11 - 41:14] ObjCMessageExpr=foo::34:9 +// CHECK: Punctuation: ":" [41:14 - 41:15] ObjCMessageExpr=foo::34:9 +// CHECK: Literal: "0" [41:15 - 41:16] IntegerLiteral= +// CHECK: Punctuation: "]" [41:16 - 41:17] ObjCMessageExpr=foo::34:9 +// CHECK: Punctuation: ";" [41:17 - 41:18] CompoundStmt= +// CHECK: Punctuation: "}" [42:1 - 42:2] CompoundStmt= +// CHECK: Punctuation: "-" [43:1 - 43:2] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Punctuation: "(" [43:3 - 43:4] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Keyword: "void" [43:4 - 43:8] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Punctuation: ")" [43:8 - 43:9] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Identifier: "foo" [43:10 - 43:13] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Punctuation: ":" [43:13 - 43:14] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Punctuation: "(" [43:14 - 43:15] ObjCInstanceMethodDecl=foo::43:10 (Definition) +// CHECK: Keyword: "int" [43:15 - 43:18] ParmDecl=x:43:19 (Definition) +// CHECK: Punctuation: ")" [43:18 - 43:19] ParmDecl=x:43:19 (Definition) +// CHECK: Identifier: "x" [43:19 - 43:20] ParmDecl=x:43:19 (Definition) +// CHECK: Punctuation: "{" [44:1 - 44:2] CompoundStmt= +// CHECK: Punctuation: "(" [45:3 - 45:4] CStyleCastExpr= +// CHECK: Keyword: "void" [45:4 - 45:8] CStyleCastExpr= +// CHECK: Punctuation: ")" [45:8 - 45:9] CStyleCastExpr= +// CHECK: Identifier: "x" [45:10 - 45:11] DeclRefExpr=x:43:19 +// CHECK: Punctuation: ";" [45:11 - 45:12] CompoundStmt= +// CHECK: Punctuation: "}" [46:1 - 46:2] CompoundStmt= +// CHECK: Punctuation: "@" [47:1 - 47:2] ObjCImplementationDecl=IBActionTests:37:17 (Definition) +// CHECK: Keyword: "end" [47:2 - 47:5] +// CHECK: Punctuation: "@" [51:1 - 51:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Keyword: "interface" [51:2 - 51:11] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBOutletTests" [51:12 - 51:25] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "{" [52:1 - 52:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Identifier: "IBOutlet" [53:5 - 53:13] macro expansion=IBOutlet +// CHECK: Keyword: "char" [53:14 - 53:18] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Punctuation: "*" [53:19 - 53:20] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Identifier: "anOutlet" [53:21 - 53:29] ObjCIvarDecl=anOutlet:53:21 (Definition) +// CHECK: Punctuation: ";" [53:29 - 53:30] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "}" [54:1 - 54:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "-" [55:1 - 55:2] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Punctuation: "(" [55:3 - 55:4] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Identifier: "IBAction" [55:4 - 55:12] macro expansion=IBAction +// CHECK: Punctuation: ")" [55:12 - 55:13] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Identifier: "actionMethod" [55:14 - 55:26] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Punctuation: ":" [55:26 - 55:27] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Punctuation: "(" [55:27 - 55:28] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Identifier: "id" [55:28 - 55:30] TypeRef=id:0:0 +// CHECK: Punctuation: ")" [55:30 - 55:31] ParmDecl=arg:55:31 (Definition) +// CHECK: Identifier: "arg" [55:31 - 55:34] ParmDecl=arg:55:31 (Definition) +// CHECK: Punctuation: ";" [55:34 - 55:35] ObjCInstanceMethodDecl=actionMethod::55:1 +// CHECK: Punctuation: "@" [56:1 - 56:2] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Keyword: "property" [56:2 - 56:10] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Identifier: "IBOutlet" [56:11 - 56:19] macro expansion=IBOutlet +// CHECK: Keyword: "int" [56:20 - 56:23] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Punctuation: "*" [56:24 - 56:25] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Identifier: "aPropOutlet" [56:26 - 56:37] ObjCPropertyDecl=aPropOutlet:56:26 +// CHECK: Punctuation: ";" [56:37 - 56:38] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "@" [57:1 - 57:2] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Keyword: "end" [57:2 - 57:5] ObjCInterfaceDecl=IBOutletTests:51:12 +// CHECK: Punctuation: "#" [63:1 - 63:2] preprocessing directive= +// CHECK: Identifier: "define" [63:2 - 63:8] preprocessing directive= +// CHECK: Identifier: "VAL" [63:9 - 63:12] macro definition=VAL +// CHECK: Literal: "0" [63:13 - 63:14] macro definition=VAL +// CHECK: Punctuation: "@" [65:1 - 65:2] ObjCInterfaceDecl=R7974151:65:12 +// CHECK: Keyword: "interface" [65:2 - 65:11] ObjCInterfaceDecl=R7974151:65:12 +// CHECK: Identifier: "R7974151" [65:12 - 65:20] ObjCInterfaceDecl=R7974151:65:12 +// CHECK: Punctuation: "-" [66:1 - 66:2] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Punctuation: "(" [66:3 - 66:4] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Keyword: "int" [66:4 - 66:7] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Punctuation: ")" [66:7 - 66:8] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Identifier: "foo" [66:9 - 66:12] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Punctuation: ":" [66:12 - 66:13] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Punctuation: "(" [66:13 - 66:14] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Keyword: "int" [66:14 - 66:17] ParmDecl=arg:66:18 (Definition) +// CHECK: Punctuation: ")" [66:17 - 66:18] ParmDecl=arg:66:18 (Definition) +// CHECK: Identifier: "arg" [66:18 - 66:21] ParmDecl=arg:66:18 (Definition) +// CHECK: Punctuation: ";" [66:21 - 66:22] ObjCInstanceMethodDecl=foo::66:9 +// CHECK: Punctuation: "-" [67:1 - 67:2] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Punctuation: "(" [67:3 - 67:4] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Keyword: "int" [67:4 - 67:7] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Punctuation: ")" [67:7 - 67:8] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Identifier: "method" [67:9 - 67:15] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Punctuation: ";" [67:15 - 67:16] ObjCInstanceMethodDecl=method:67:9 +// CHECK: Punctuation: "@" [68:1 - 68:2] ObjCInterfaceDecl=R7974151:65:12 +// CHECK: Keyword: "end" [68:2 - 68:5] ObjCInterfaceDecl=R7974151:65:12 +// CHECK: Punctuation: "@" [70:1 - 70:2] ObjCImplementationDecl=R7974151:70:17 (Definition) +// CHECK: Keyword: "implementation" [70:2 - 70:16] ObjCImplementationDecl=R7974151:70:17 (Definition) +// CHECK: Identifier: "R7974151" [70:17 - 70:25] ObjCImplementationDecl=R7974151:70:17 (Definition) +// CHECK: Punctuation: "-" [71:1 - 71:2] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Punctuation: "(" [71:3 - 71:4] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Keyword: "int" [71:4 - 71:7] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Punctuation: ")" [71:7 - 71:8] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Identifier: "foo" [71:9 - 71:12] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Punctuation: ":" [71:12 - 71:13] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Punctuation: "(" [71:13 - 71:14] ObjCInstanceMethodDecl=foo::71:9 (Definition) +// CHECK: Keyword: "int" [71:14 - 71:17] ParmDecl=arg:71:18 (Definition) +// CHECK: Punctuation: ")" [71:17 - 71:18] ParmDecl=arg:71:18 (Definition) +// CHECK: Identifier: "arg" [71:18 - 71:21] ParmDecl=arg:71:18 (Definition) +// CHECK: Punctuation: "{" [71:22 - 71:23] CompoundStmt= +// CHECK: Keyword: "return" [72:3 - 72:9] ReturnStmt= +// CHECK: Identifier: "arg" [72:10 - 72:13] DeclRefExpr=arg:71:18 +// CHECK: Punctuation: ";" [72:13 - 72:14] CompoundStmt= +// CHECK: Punctuation: "}" [73:1 - 73:2] CompoundStmt= +// CHECK: Punctuation: "-" [74:1 - 74:2] ObjCInstanceMethodDecl=method:74:9 (Definition) +// CHECK: Punctuation: "(" [74:3 - 74:4] ObjCInstanceMethodDecl=method:74:9 (Definition) +// CHECK: Keyword: "int" [74:4 - 74:7] ObjCInstanceMethodDecl=method:74:9 (Definition) +// CHECK: Punctuation: ")" [74:7 - 74:8] ObjCInstanceMethodDecl=method:74:9 (Definition) +// CHECK: Identifier: "method" [74:9 - 74:15] ObjCInstanceMethodDecl=method:74:9 (Definition) +// CHECK: Punctuation: "{" [75:1 - 75:2] CompoundStmt= +// CHECK: Keyword: "int" [76:5 - 76:8] VarDecl=local:76:9 (Definition) +// CHECK: Identifier: "local" [76:9 - 76:14] VarDecl=local:76:9 (Definition) +// CHECK: Punctuation: "=" [76:15 - 76:16] VarDecl=local:76:9 (Definition) +// CHECK: Punctuation: "[" [76:17 - 76:18] ObjCMessageExpr=foo::66:9 +// CHECK: Identifier: "self" [76:18 - 76:22] DeclRefExpr=self:0:0 +// CHECK: Identifier: "foo" [76:23 - 76:26] ObjCMessageExpr=foo::66:9 +// CHECK: Punctuation: ":" [76:26 - 76:27] ObjCMessageExpr=foo::66:9 +// CHECK: Identifier: "VAL" [76:27 - 76:30] macro expansion=VAL:63:9 +// CHECK: Punctuation: "]" [76:30 - 76:31] ObjCMessageExpr=foo::66:9 +// CHECK: Punctuation: ";" [76:31 - 76:32] DeclStmt= +// CHECK: Keyword: "int" [77:5 - 77:8] VarDecl=second:77:9 (Definition) +// CHECK: Identifier: "second" [77:9 - 77:15] VarDecl=second:77:9 (Definition) +// CHECK: Punctuation: "=" [77:16 - 77:17] VarDecl=second:77:9 (Definition) +// CHECK: Punctuation: "[" [77:18 - 77:19] ObjCMessageExpr=foo::66:9 +// CHECK: Identifier: "self" [77:19 - 77:23] DeclRefExpr=self:0:0 +// CHECK: Identifier: "foo" [77:24 - 77:27] ObjCMessageExpr=foo::66:9 +// CHECK: Punctuation: ":" [77:27 - 77:28] ObjCMessageExpr=foo::66:9 +// CHECK: Literal: "0" [77:28 - 77:29] IntegerLiteral= +// CHECK: Punctuation: "]" [77:29 - 77:30] ObjCMessageExpr=foo::66:9 +// CHECK: Punctuation: ";" [77:30 - 77:31] DeclStmt= +// CHECK: Keyword: "return" [78:5 - 78:11] ReturnStmt= +// CHECK: Identifier: "local" [78:12 - 78:17] DeclRefExpr=local:76:9 +// CHECK: Punctuation: ";" [78:17 - 78:18] CompoundStmt= +// CHECK: Punctuation: "}" [79:1 - 79:2] CompoundStmt= +// CHECK: Punctuation: "-" [80:1 - 80:2] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Punctuation: "(" [80:3 - 80:4] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Keyword: "int" [80:4 - 80:7] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Punctuation: ")" [80:7 - 80:8] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Identifier: "othermethod" [80:8 - 80:19] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Punctuation: ":" [80:19 - 80:20] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Punctuation: "(" [80:20 - 80:21] ObjCInstanceMethodDecl=othermethod::80:8 (Definition) +// CHECK: Identifier: "IBOutletTests" [80:21 - 80:34] ObjCClassRef=IBOutletTests:51:12 +// CHECK: Punctuation: "*" [80:35 - 80:36] ParmDecl=ibt:80:37 (Definition) +// CHECK: Punctuation: ")" [80:36 - 80:37] ParmDecl=ibt:80:37 (Definition) +// CHECK: Identifier: "ibt" [80:37 - 80:40] ParmDecl=ibt:80:37 (Definition) +// CHECK: Punctuation: "{" [80:41 - 80:42] CompoundStmt= +// CHECK: Keyword: "return" [81:3 - 81:9] ReturnStmt= +// CHECK: Punctuation: "*" [81:10 - 81:11] UnaryOperator= +// CHECK: Identifier: "ibt" [81:11 - 81:14] DeclRefExpr=ibt:80:37 +// CHECK: Punctuation: "." [81:14 - 81:15] MemberRefExpr=aPropOutlet:56:26 +// CHECK: Identifier: "aPropOutlet" [81:15 - 81:26] MemberRefExpr=aPropOutlet:56:26 +// CHECK: Punctuation: ";" [81:26 - 81:27] CompoundStmt= +// CHECK: Punctuation: "}" [82:1 - 82:2] CompoundStmt= +// CHECK: Punctuation: "@" [83:1 - 83:2] ObjCImplementationDecl=R7974151:70:17 (Definition) +// CHECK: Keyword: "end" [83:2 - 83:5] +// CHECK: Punctuation: "@" [85:1 - 85:2] ObjCProtocolDecl=Proto:85:11 (Definition) +// CHECK: Keyword: "protocol" [85:2 - 85:10] ObjCProtocolDecl=Proto:85:11 (Definition) +// CHECK: Identifier: "Proto" [85:11 - 85:16] ObjCProtocolDecl=Proto:85:11 (Definition) +// CHECK: Punctuation: "@" [85:17 - 85:18] ObjCProtocolDecl=Proto:85:11 (Definition) +// CHECK: Keyword: "end" [85:18 - 85:21] ObjCProtocolDecl=Proto:85:11 (Definition) +// CHECK: Keyword: "void" [87:1 - 87:5] FunctionDecl=f:87:6 (Definition) +// CHECK: Identifier: "f" [87:6 - 87:7] FunctionDecl=f:87:6 (Definition) +// CHECK: Punctuation: "(" [87:7 - 87:8] FunctionDecl=f:87:6 (Definition) +// CHECK: Punctuation: ")" [87:8 - 87:9] FunctionDecl=f:87:6 (Definition) +// CHECK: Punctuation: "{" [87:10 - 87:11] CompoundStmt= +// CHECK: Punctuation: "(" [88:3 - 88:4] CStyleCastExpr= +// CHECK: Keyword: "void" [88:4 - 88:8] CStyleCastExpr= +// CHECK: Punctuation: ")" [88:8 - 88:9] CStyleCastExpr= +// CHECK: Punctuation: "@" [88:9 - 88:10] ObjCProtocolExpr=Proto:85:1 +// CHECK: Keyword: "protocol" [88:10 - 88:18] ObjCProtocolExpr=Proto:85:1 +// CHECK: Punctuation: "(" [88:18 - 88:19] ObjCProtocolExpr=Proto:85:1 +// CHECK: Identifier: "Proto" [88:19 - 88:24] ObjCProtocolExpr=Proto:85:1 +// CHECK: Punctuation: ")" [88:24 - 88:25] ObjCProtocolExpr=Proto:85:1 +// CHECK: Punctuation: ";" [88:25 - 88:26] CompoundStmt= +// CHECK: Punctuation: "}" [89:1 - 89:2] CompoundStmt= +// CHECK: Punctuation: "@" [93:1 - 93:2] ObjCInterfaceDecl=Rdar8595462_A:93:8 +// CHECK: Keyword: "class" [93:2 - 93:7] ObjCInterfaceDecl=Rdar8595462_A:93:8 +// CHECK: Identifier: "Rdar8595462_A" [93:8 - 93:21] ObjCClassRef=Rdar8595462_A:93:8 +// CHECK: Punctuation: ";" [93:21 - 93:22] +// CHECK: Punctuation: "@" [94:1 - 94:2] ObjCInterfaceDecl=Rdar8595462_B:94:12 +// CHECK: Keyword: "interface" [94:2 - 94:11] ObjCInterfaceDecl=Rdar8595462_B:94:12 +// CHECK: Identifier: "Rdar8595462_B" [94:12 - 94:25] ObjCInterfaceDecl=Rdar8595462_B:94:12 +// CHECK: Punctuation: "@" [95:1 - 95:2] ObjCInterfaceDecl=Rdar8595462_B:94:12 +// CHECK: Keyword: "end" [95:2 - 95:5] ObjCInterfaceDecl=Rdar8595462_B:94:12 +// CHECK: Punctuation: "@" [97:1 - 97:2] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Keyword: "implementation" [97:2 - 97:16] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Identifier: "Rdar8595462_B" [97:17 - 97:30] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Identifier: "Rdar8595462_A" [98:1 - 98:14] ObjCClassRef=Rdar8595462_A:93:8 +// CHECK: Punctuation: "*" [98:15 - 98:16] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition) +// CHECK: Identifier: "Rdar8595462_aFunction" [98:17 - 98:38] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition) +// CHECK: Punctuation: "(" [98:38 - 98:39] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition) +// CHECK: Punctuation: ")" [98:39 - 98:40] FunctionDecl=Rdar8595462_aFunction:98:17 (Definition) +// CHECK: Punctuation: "{" [98:41 - 98:42] CompoundStmt= +// CHECK: Identifier: "Rdar8595462_A" [99:3 - 99:16] ObjCClassRef=Rdar8595462_A:93:8 +// CHECK: Punctuation: "*" [99:17 - 99:18] VarDecl=localVar:99:19 (Definition) +// CHECK: Identifier: "localVar" [99:19 - 99:27] VarDecl=localVar:99:19 (Definition) +// CHECK: Punctuation: "=" [99:28 - 99:29] VarDecl=localVar:99:19 (Definition) +// CHECK: Literal: "0" [99:30 - 99:31] IntegerLiteral= +// CHECK: Punctuation: ";" [99:31 - 99:32] DeclStmt= +// CHECK: Keyword: "return" [100:3 - 100:9] ReturnStmt= +// CHECK: Identifier: "localVar" [100:10 - 100:18] DeclRefExpr=localVar:99:19 +// CHECK: Punctuation: ";" [100:18 - 100:19] CompoundStmt= +// CHECK: Punctuation: "}" [101:1 - 101:2] CompoundStmt= +// CHECK: Keyword: "static" [102:1 - 102:7] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Identifier: "Rdar8595462_A" [102:8 - 102:21] ObjCClassRef=Rdar8595462_A:93:8 +// CHECK: Punctuation: "*" [102:22 - 102:23] VarDecl=Rdar8595462_staticVar:102:24 +// CHECK: Identifier: "Rdar8595462_staticVar" [102:24 - 102:45] VarDecl=Rdar8595462_staticVar:102:24 +// CHECK: Punctuation: ";" [102:45 - 102:46] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Punctuation: "@" [103:1 - 103:2] ObjCImplementationDecl=Rdar8595462_B:97:17 (Definition) +// CHECK: Keyword: "end" [103:2 - 103:5] + +// CHECK: Punctuation: "@" [110:1 - 110:2] ObjCPropertyDecl=foo:110:33 +// CHECK: Keyword: "property" [110:2 - 110:10] ObjCPropertyDecl=foo:110:33 +// CHECK: Punctuation: "(" [110:11 - 110:12] ObjCPropertyDecl=foo:110:33 +// CHECK: Keyword: "readonly" [110:12 - 110:20] ObjCPropertyDecl=foo:110:33 +// CHECK: Punctuation: "," [110:20 - 110:21] ObjCPropertyDecl=foo:110:33 +// CHECK: Keyword: "copy" [110:22 - 110:26] ObjCPropertyDecl=foo:110:33 +// CHECK: Punctuation: ")" [110:26 - 110:27] ObjCPropertyDecl=foo:110:33 +// CHECK: Identifier: "Foo" [110:28 - 110:31] ObjCClassRef=Foo:1:12 +// CHECK: Punctuation: "*" [110:32 - 110:33] ObjCPropertyDecl=foo:110:33 +// CHECK: Identifier: "foo" [110:33 - 110:36] ObjCPropertyDecl=foo:110:33 +// CHECK: Keyword: "property" [111:2 - 111:10] ObjCPropertyDecl=foo2:111:27 +// CHECK: Punctuation: "(" [111:11 - 111:12] ObjCPropertyDecl=foo2:111:27 +// CHECK: Keyword: "readonly" [111:12 - 111:20] ObjCPropertyDecl=foo2:111:27 +// CHECK: Punctuation: ")" [111:20 - 111:21] ObjCPropertyDecl=foo2:111:27 +// CHECK: Identifier: "Foo" [111:22 - 111:25] ObjCClassRef=Foo:1:12 +// CHECK: Punctuation: "*" [111:26 - 111:27] ObjCPropertyDecl=foo2:111:27 +// CHECK: Identifier: "foo2" [111:27 - 111:31] ObjCPropertyDecl=foo2:111:27 + +// CHECK: Punctuation: "@" [115:1 - 115:2] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Keyword: "synthesize" [115:2 - 115:12] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Identifier: "foo" [115:13 - 115:16] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Punctuation: "=" [115:17 - 115:18] ObjCSynthesizeDecl=foo:110:33 (Definition) +// CHECK: Identifier: "_foo" [115:19 - 115:23] MemberRef=_foo:107:8 +// CHECK: Punctuation: ";" [115:23 - 115:24] ObjCImplementationDecl=Rdar8595386:114:17 (Definition) + +// RUN: c-index-test -test-annotate-tokens=%s:127:1:130:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck -check-prefix=CHECK-INSIDE_BLOCK %s +// CHECK-INSIDE_BLOCK: Keyword: "int" [127:5 - 127:8] VarDecl=result:127:9 (Definition) +// CHECK-INSIDE_BLOCK: Identifier: "result" [127:9 - 127:15] VarDecl=result:127:9 (Definition) +// CHECK-INSIDE_BLOCK: Punctuation: "=" [127:16 - 127:17] VarDecl=result:127:9 (Definition) +// CHECK-INSIDE_BLOCK: Punctuation: "[" [127:18 - 127:19] ObjCMessageExpr=blah::124:8 +// CHECK-INSIDE_BLOCK: Identifier: "self" [127:19 - 127:23] DeclRefExpr=self:0:0 +// CHECK-INSIDE_BLOCK: Identifier: "blah" [127:24 - 127:28] ObjCMessageExpr=blah::124:8 +// CHECK-INSIDE_BLOCK: Punctuation: ":" [127:28 - 127:29] ObjCMessageExpr=blah::124:8 +// CHECK-INSIDE_BLOCK: Literal: "5" [127:29 - 127:30] IntegerLiteral= +// CHECK-INSIDE_BLOCK: Punctuation: "," [127:30 - 127:31] ObjCMessageExpr=blah::124:8 +// CHECK-INSIDE_BLOCK: Identifier: "x" [127:32 - 127:33] DeclRefExpr=x:125:19 +// CHECK-INSIDE_BLOCK: Punctuation: "]" [127:33 - 127:34] ObjCMessageExpr=blah::124:8 +// CHECK-INSIDE_BLOCK: Punctuation: ";" [127:34 - 127:35] DeclStmt= +// CHECK-INSIDE_BLOCK: Identifier: "Rdar8778404" [128:5 - 128:16] ObjCClassRef=Rdar8778404:120:12 +// CHECK-INSIDE_BLOCK: Punctuation: "*" [128:17 - 128:18] VarDecl=a:128:18 (Definition) +// CHECK-INSIDE_BLOCK: Identifier: "a" [128:18 - 128:19] VarDecl=a:128:18 (Definition) +// CHECK-INSIDE_BLOCK: Punctuation: "=" [128:20 - 128:21] VarDecl=a:128:18 (Definition) +// CHECK-INSIDE_BLOCK: Identifier: "self" [128:22 - 128:26] DeclRefExpr=self:0:0 + +// RUN: c-index-test -test-annotate-tokens=%s:134:1:138:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' | FileCheck -check-prefix=CHECK-PROP-AFTER-METHOD %s +// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [134:1 - 134:2] ObjCInterfaceDecl=Rdar8062781:134:12 +// CHECK-PROP-AFTER-METHOD: Keyword: "interface" [134:2 - 134:11] ObjCInterfaceDecl=Rdar8062781:134:12 +// CHECK-PROP-AFTER-METHOD: Identifier: "Rdar8062781" [134:12 - 134:23] ObjCInterfaceDecl=Rdar8062781:134:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "+" [135:1 - 135:2] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Punctuation: "(" [135:3 - 135:4] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Identifier: "Foo" [135:4 - 135:7] ObjCClassRef=Foo:1:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "*" [135:7 - 135:8] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Punctuation: ")" [135:8 - 135:9] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Identifier: "getB" [135:9 - 135:13] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [135:13 - 135:14] ObjCClassMethodDecl=getB:135:9 +// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [136:1 - 136:2] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Keyword: "property" [136:2 - 136:10] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Punctuation: "(" [136:11 - 136:12] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Keyword: "readonly" [136:12 - 136:20] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Punctuation: "," [136:20 - 136:21] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Keyword: "nonatomic" [136:22 - 136:31] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Punctuation: ")" [136:31 - 136:32] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Identifier: "Foo" [136:33 - 136:36] ObjCClassRef=Foo:1:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "*" [136:37 - 136:38] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Identifier: "blah" [136:38 - 136:42] ObjCPropertyDecl=blah:136:38 +// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [136:42 - 136:43] ObjCInterfaceDecl=Rdar8062781:134:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [137:1 - 137:2] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Keyword: "property" [137:2 - 137:10] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Punctuation: "(" [137:11 - 137:12] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Keyword: "readonly" [137:12 - 137:20] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Punctuation: "," [137:20 - 137:21] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Keyword: "atomic" [137:22 - 137:28] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Punctuation: ")" [137:28 - 137:29] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Identifier: "Foo" [137:30 - 137:33] ObjCClassRef=Foo:1:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "*" [137:34 - 137:35] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Identifier: "abah" [137:35 - 137:39] ObjCPropertyDecl=abah:137:35 +// CHECK-PROP-AFTER-METHOD: Punctuation: ";" [137:39 - 137:40] ObjCInterfaceDecl=Rdar8062781:134:12 +// CHECK-PROP-AFTER-METHOD: Punctuation: "@" [138:1 - 138:2] ObjCInterfaceDecl=Rdar8062781:134:12 + +// RUN: c-index-test -test-annotate-tokens=%s:141:1:142:1 %s -DIBOutlet='__attribute__((iboutlet))' -DIBAction='void)__attribute__((ibaction)' -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s +// CHECK-WITH-WEAK: Identifier: "__weak" [141:3 - 141:9] macro expansion +// CHECK-WITH-WEAK: Identifier: "Foo" [141:10 - 141:13] ObjCClassRef=Foo:1:12 +// CHECK-WITH-WEAK: Punctuation: "*" [141:14 - 141:15] ObjCIvarDecl=foo:141:15 (Definition) +// CHECK-WITH-WEAK: Identifier: "foo" [141:15 - 141:18] ObjCIvarDecl=foo:141:15 (Definition) +// CHECK-WITH-WEAK: Punctuation: ";" [141:18 - 141:19] ObjCInterfaceDecl=rdar9535717:140:12 +// CHECK-WITH-WEAK: Punctuation: "}" [142:1 - 142:2] ObjCInterfaceDecl=rdar9535717:140:12 diff --git a/clang/test/Index/annotate-toplevel-in-objccontainer.m b/clang/test/Index/annotate-toplevel-in-objccontainer.m new file mode 100644 index 0000000..56b7871 --- /dev/null +++ b/clang/test/Index/annotate-toplevel-in-objccontainer.m @@ -0,0 +1,33 @@ +@interface Foo +void func1(int); +void func2(int); + +-(void)meth1; +-(void)meth2; +@end + +@implementation Foo +void func(int); +static int glob1; +static int glob2; + +-(void)meth1 {} +-(void)meth2 {} +@end + +// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %s.h + +// RUN: c-index-test -test-annotate-tokens=%s:5:1:7:1 %s -include %t.h \ +// RUN: | FileCheck -check-prefix=INTER %s +// CHECK-INTER: Identifier: "meth1" [5:8 - 5:13] ObjCInstanceMethodDecl=meth1:5:8 +// CHECK-INTER: Identifier: "meth2" [6:8 - 6:13] ObjCInstanceMethodDecl=meth2:6:8 + +// RUN: c-index-test -test-annotate-tokens=%s:14:1:16:1 %s -include %t.h \ +// RUN: | FileCheck -check-prefix=IMPL %s +// CHECK-IMPL: Identifier: "meth1" [14:8 - 14:13] ObjCInstanceMethodDecl=meth1:14:8 (Definition) +// CHECK-IMPL: Identifier: "meth2" [15:8 - 15:13] ObjCInstanceMethodDecl=meth2:15:8 (Definition) + +// RUN: c-index-test -test-annotate-tokens=%s.h:7:1:9:1 %s -include %t.h \ +// RUN: | FileCheck -check-prefix=PCH %s +// CHECK-PCH: Identifier: "meth1" [7:8 - 7:13] ObjCInstanceMethodDecl=meth1:7:8 +// CHECK-PCH: Identifier: "meth2" [8:8 - 8:13] ObjCInstanceMethodDecl=meth2:8:8 diff --git a/clang/test/Index/annotate-toplevel-in-objccontainer.m.h b/clang/test/Index/annotate-toplevel-in-objccontainer.m.h new file mode 100644 index 0000000..fe507fc --- /dev/null +++ b/clang/test/Index/annotate-toplevel-in-objccontainer.m.h @@ -0,0 +1,9 @@ +@interface FooPCH +void funcPCH1(int); +void funcPCH2(int); + +enum E { Cake }; + +-(void)meth1; +-(void)meth2; +@end diff --git a/clang/test/Index/arc-annotate.m b/clang/test/Index/arc-annotate.m new file mode 100644 index 0000000..b836bc8 --- /dev/null +++ b/clang/test/Index/arc-annotate.m @@ -0,0 +1,38 @@ +@interface A +@property (strong, nonatomic) id property; +@property (nonatomic, weak) id second_property; +@property (unsafe_unretained, nonatomic) id third_property; +@end + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 %s -fobjc-arc -fobjc-nonfragile-abi | FileCheck %s +// CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=A:1:12 +// CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=A:1:12 +// CHECK: Identifier: "A" [1:12 - 1:13] ObjCInterfaceDecl=A:1:12 +// CHECK: Punctuation: "@" [2:1 - 2:2] ObjCPropertyDecl=property:2:34 +// CHECK: Keyword: "property" [2:2 - 2:10] ObjCPropertyDecl=property:2:34 +// CHECK: Punctuation: "(" [2:11 - 2:12] ObjCPropertyDecl=property:2:34 +// CHECK: Keyword: "strong" [2:12 - 2:18] ObjCPropertyDecl=property:2:34 +// CHECK: Punctuation: "," [2:18 - 2:19] ObjCPropertyDecl=property:2:34 +// CHECK: Keyword: "nonatomic" [2:20 - 2:29] ObjCPropertyDecl=property:2:34 +// CHECK: Punctuation: ")" [2:29 - 2:30] ObjCPropertyDecl=property:2:34 +// CHECK: Identifier: "id" [2:31 - 2:33] TypeRef=id:0:0 +// CHECK: Identifier: "property" [2:34 - 2:42] ObjCPropertyDecl=property:2:34 +// CHECK: Punctuation: ";" [2:42 - 2:43] ObjCInterfaceDecl=A:1:12 +// CHECK: Punctuation: "@" [3:1 - 3:2] ObjCPropertyDecl=second_property:3:32 +// CHECK: Keyword: "property" [3:2 - 3:10] ObjCPropertyDecl=second_property:3:32 +// CHECK: Punctuation: "(" [3:11 - 3:12] ObjCPropertyDecl=second_property:3:32 +// CHECK: Keyword: "nonatomic" [3:12 - 3:21] ObjCPropertyDecl=second_property:3:32 +// CHECK: Punctuation: "," [3:21 - 3:22] ObjCPropertyDecl=second_property:3:32 +// CHECK: Keyword: "weak" [3:23 - 3:27] ObjCPropertyDecl=second_property:3:32 +// CHECK: Punctuation: ")" [3:27 - 3:28] ObjCPropertyDecl=second_property:3:32 +// CHECK: Identifier: "id" [3:29 - 3:31] TypeRef=id:0:0 +// CHECK: Identifier: "second_property" [3:32 - 3:47] ObjCPropertyDecl=second_property:3:32 +// CHECK: Punctuation: "@" [4:1 - 4:2] ObjCPropertyDecl=third_property:4:45 +// CHECK: Keyword: "property" [4:2 - 4:10] ObjCPropertyDecl=third_property:4:45 +// CHECK: Punctuation: "(" [4:11 - 4:12] ObjCPropertyDecl=third_property:4:45 +// CHECK: Keyword: "unsafe_unretained" [4:12 - 4:29] ObjCPropertyDecl=third_property:4:45 +// CHECK: Punctuation: "," [4:29 - 4:30] ObjCPropertyDecl=third_property:4:45 +// CHECK: Keyword: "nonatomic" [4:31 - 4:40] ObjCPropertyDecl=third_property:4:45 +// CHECK: Punctuation: ")" [4:40 - 4:41] ObjCPropertyDecl=third_property:4:45 +// CHECK: Identifier: "id" [4:42 - 4:44] TypeRef=id:0:0 +// CHECK: Identifier: "third_property" [4:45 - 4:59] ObjCPropertyDecl=third_property:4:45 diff --git a/clang/test/Index/arc-complete.m b/clang/test/Index/arc-complete.m new file mode 100644 index 0000000..328983c --- /dev/null +++ b/clang/test/Index/arc-complete.m @@ -0,0 +1,16 @@ +typedef const void *CFTypeRef; + +void test(id x) { + (__bridge CFTypeRef)x; +} + + + +// RUN: c-index-test -code-completion-at=%s:4:4 %s -fobjc-arc -fobjc-nonfragile-abi | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: macro definition:{TypedText __autoreleasing} (70) +// CHECK-CC1: NotImplemented:{TypedText __bridge}{HorizontalSpace }{Placeholder type}{RightParen )}{Placeholder expression} (40) +// CHECK-CC1: NotImplemented:{TypedText __bridge_retained}{HorizontalSpace }{Placeholder CF type}{RightParen )}{Placeholder expression} (40) +// CHECK-CC1: NotImplemented:{TypedText __bridge_transfer}{HorizontalSpace }{Placeholder Objective-C type}{RightParen )}{Placeholder expression} (40) +// CHECK-CC1: macro definition:{TypedText __strong} (70) +// CHECK-CC1: macro definition:{TypedText __unsafe_unretained} (70) +// CHECK-CC1: macro definition:{TypedText __weak} (70) diff --git a/clang/test/Index/asm-attribute.c b/clang/test/Index/asm-attribute.c new file mode 100644 index 0000000..f952459 --- /dev/null +++ b/clang/test/Index/asm-attribute.c @@ -0,0 +1,6 @@ +int foo(int x) __asm__("_foo_"); + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: asm-attribute.c:1:5: FunctionDecl=foo:1:5 Extent=[1:1 - 1:32] +// FIXME: Location below. +// CHECK: <invalid loc>:0:0: asm label=_foo_ Extent=[1:24 - 1:31] diff --git a/clang/test/Index/blocks.c b/clang/test/Index/blocks.c new file mode 100644 index 0000000..3f33e48 --- /dev/null +++ b/clang/test/Index/blocks.c @@ -0,0 +1,34 @@ +// RUN: c-index-test -test-load-source local -fblocks %s | FileCheck %s + +typedef int int_t; +struct foo { long x; }; + +void test() { + static struct foo _foo; + __block i = 0; + ^ int_t(struct foo *foo) { return (int_t) foo->x + i; }(&_foo); +} + +// CHECK: blocks.c:6:6: FunctionDecl=test:6:6 (Definition) Extent=[6:1 - 10:2] +// CHECK: blocks.c:6:13: CompoundStmt= Extent=[6:13 - 10:2] +// CHECK: blocks.c:7:3: DeclStmt= Extent=[7:3 - 7:26] +// CHECK: blocks.c:7:21: VarDecl=_foo:7:21 (Definition) Extent=[7:3 - 7:25] +// CHECK: blocks.c:7:17: TypeRef=struct foo:4:8 Extent=[7:17 - 7:20] +// CHECK: blocks.c:8:11: VarDecl=i:8:11 (Definition) Extent=[8:3 - 8:16] +// CHECK: blocks.c:8:15: IntegerLiteral= Extent=[8:15 - 8:16] +// CHECK: blocks.c:9:3: CallExpr= Extent=[9:3 - 9:65] +// CHECK: blocks.c:9:3: BlockExpr= Extent=[9:3 - 9:58] +// CHECK: blocks.c:9:5: TypeRef=int_t:3:13 Extent=[9:5 - 9:10] +// CHECK: blocks.c:9:23: ParmDecl=foo:9:23 (Definition) Extent=[9:11 - 9:26] +// CHECK: blocks.c:9:18: TypeRef=struct foo:4:8 Extent=[9:18 - 9:21] +// CHECK: blocks.c:9:28: CompoundStmt= Extent=[9:28 - 9:58] +// CHECK: blocks.c:9:30: ReturnStmt= Extent=[9:30 - 9:55] +// CHECK: blocks.c:9:37: BinaryOperator= Extent=[9:37 - 9:55] +// CHECK: blocks.c:9:37: CStyleCastExpr= Extent=[9:37 - 9:51] +// CHECK: blocks.c:9:38: TypeRef=int_t:3:13 Extent=[9:38 - 9:43] +// CHECK: blocks.c:9:50: MemberRefExpr=x:4:19 SingleRefName=[9:50 - 9:51] RefName=[9:50 - 9:51] Extent=[9:45 - 9:51] +// CHECK: blocks.c:9:45: DeclRefExpr=foo:9:23 Extent=[9:45 - 9:48] +// CHECK: blocks.c:9:54: DeclRefExpr=i:8:11 Extent=[9:54 - 9:55] +// CHECK: blocks.c:9:59: UnaryOperator= Extent=[9:59 - 9:64] +// CHECK: blocks.c:9:60: DeclRefExpr=_foo:7:21 Extent=[9:60 - 9:64] + diff --git a/clang/test/Index/c-index-api-loadTU-test.m b/clang/test/Index/c-index-api-loadTU-test.m new file mode 100644 index 0000000..251d73b --- /dev/null +++ b/clang/test/Index/c-index-api-loadTU-test.m @@ -0,0 +1,163 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast +// RUN: c-index-test -test-load-tu %t.ast all | FileCheck %s + +@interface Foo +{ + __attribute__((iboutlet)) id myoutlet; +} +- (void) __attribute__((ibaction)) myMessage:(id)msg; +- foo __attribute__((deprecated)); ++ fooC; + +@end + +@interface Bar : Foo +{ +} + +@end + +@interface Foo (FooCat) +- (int) catMethodWithFloat:(float) fArg; +- (float) floatMethod; +@end + +@protocol Proto +- pMethod; +@end + +@protocol SubP <Proto> +- spMethod; +@end + +@interface Baz : Bar <SubP> +{ + int _anIVar; +} + +- (Foo *) bazMethod; + +@end + +enum { + someEnum +}; + +int main (int argc, const char * argv[]) { + Baz * bee; + id a = [bee foo]; + id <SubP> c = [Foo fooC]; + id <Proto> d; + d = c; + [d pMethod]; + [bee catMethodWithFloat:[bee floatMethod]]; + main(someEnum, (const char **)bee); +} + +// Test attribute traversal. +#define IBOutlet __attribute__((iboutlet)) +#define IBOutletCollection(ClassName) __attribute__((iboutletcollection(ClassName))) +#define IBAction void)__attribute__((ibaction) + +@interface TestAttributes { + IBOutlet id anOutlet; + IBOutletCollection(id) id anOutletCollection; +} +- (IBAction) actionMethod:(id)arg; +@end + +typedef struct X0 X1; +struct X0; +struct X0 {}; + +@interface TestAttributes() +// <rdar://problem/9561076> +@property (retain) IBOutlet id anotherOutlet; +@end + +// CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 12:5] +// CHECK: c-index-api-loadTU-test.m:6:32: ObjCIvarDecl=myoutlet:6:32 (Definition) Extent=[6:3 - 6:40] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: c-index-api-loadTU-test.m:6:29: TypeRef=id:0:0 Extent=[6:29 - 6:31] +// CHECK: c-index-api-loadTU-test.m:8:36: ObjCInstanceMethodDecl=myMessage::8:36 Extent=[8:1 - 8:54] +// CHECK: <invalid loc>:0:0: attribute(ibaction)= +// CHECK: c-index-api-loadTU-test.m:8:50: ParmDecl=msg:8:50 (Definition) Extent=[8:47 - 8:53] +// CHECK: c-index-api-loadTU-test.m:8:47: TypeRef=id:0:0 Extent=[8:47 - 8:49] +// CHECK: c-index-api-loadTU-test.m:9:3: ObjCInstanceMethodDecl=foo:9:3 (deprecated) Extent=[9:1 - 9:35] +// CHECK: c-index-api-loadTU-test.m:10:3: ObjCClassMethodDecl=fooC:10:3 Extent=[10:1 - 10:8] +// CHECK: c-index-api-loadTU-test.m:14:12: ObjCInterfaceDecl=Bar:14:12 Extent=[14:1 - 18:5] +// CHECK: c-index-api-loadTU-test.m:14:18: ObjCSuperClassRef=Foo:4:12 Extent=[14:18 - 14:21] +// CHECK: c-index-api-loadTU-test.m:20:12: ObjCCategoryDecl=FooCat:20:12 Extent=[20:1 - 23:5] +// CHECK: c-index-api-loadTU-test.m:20:12: ObjCClassRef=Foo:4:12 Extent=[20:12 - 20:15] +// CHECK: c-index-api-loadTU-test.m:21:9: ObjCInstanceMethodDecl=catMethodWithFloat::21:9 Extent=[21:1 - 21:41] +// CHECK: c-index-api-loadTU-test.m:21:36: ParmDecl=fArg:21:36 (Definition) Extent=[21:29 - 21:40] +// CHECK: c-index-api-loadTU-test.m:22:11: ObjCInstanceMethodDecl=floatMethod:22:11 Extent=[22:1 - 22:23] +// CHECK: c-index-api-loadTU-test.m:25:11: ObjCProtocolDecl=Proto:25:11 (Definition) Extent=[25:1 - 27:5] +// CHECK: c-index-api-loadTU-test.m:26:3: ObjCInstanceMethodDecl=pMethod:26:3 Extent=[26:1 - 26:11] +// CHECK: c-index-api-loadTU-test.m:29:11: ObjCProtocolDecl=SubP:29:11 (Definition) Extent=[29:1 - 31:5] +// CHECK: c-index-api-loadTU-test.m:29:17: ObjCProtocolRef=Proto:25:11 Extent=[29:17 - 29:22] +// CHECK: c-index-api-loadTU-test.m:30:3: ObjCInstanceMethodDecl=spMethod:30:3 Extent=[30:1 - 30:12] +// CHECK: c-index-api-loadTU-test.m:33:12: ObjCInterfaceDecl=Baz:33:12 Extent=[33:1 - 40:5] +// CHECK: c-index-api-loadTU-test.m:33:18: ObjCSuperClassRef=Bar:14:12 Extent=[33:18 - 33:21] +// CHECK: c-index-api-loadTU-test.m:33:23: ObjCProtocolRef=SubP:29:11 Extent=[33:23 - 33:27] +// CHECK: c-index-api-loadTU-test.m:35:9: ObjCIvarDecl=_anIVar:35:9 (Definition) Extent=[35:5 - 35:16] +// CHECK: c-index-api-loadTU-test.m:38:11: ObjCInstanceMethodDecl=bazMethod:38:11 Extent=[38:1 - 38:21] +// CHECK: c-index-api-loadTU-test.m:38:4: ObjCClassRef=Foo:4:12 Extent=[38:4 - 38:7] +// CHECK: c-index-api-loadTU-test.m:42:1: EnumDecl=:42:1 (Definition) Extent=[42:1 - 44:2] +// CHECK: c-index-api-loadTU-test.m:43:3: EnumConstantDecl=someEnum:43:3 (Definition) Extent=[43:3 - 43:11] +// CHECK: c-index-api-loadTU-test.m:46:5: FunctionDecl=main:46:5 (Definition) Extent=[46:1 - 55:2] +// CHECK: c-index-api-loadTU-test.m:46:15: ParmDecl=argc:46:15 (Definition) Extent=[46:11 - 46:19] +// CHECK: c-index-api-loadTU-test.m:46:34: ParmDecl=argv:46:34 (Definition) Extent=[46:21 - 46:40] +// CHECK: c-index-api-loadTU-test.m:47:8: VarDecl=bee:47:8 (Definition) Extent=[47:2 - 47:11] +// CHECK: c-index-api-loadTU-test.m:47:2: ObjCClassRef=Baz:33:12 Extent=[47:2 - 47:5] +// CHECK: c-index-api-loadTU-test.m:48:5: VarDecl=a:48:5 (Definition) Extent=[48:2 - 48:18] +// CHECK: c-index-api-loadTU-test.m:48:2: TypeRef=id:0:0 Extent=[48:2 - 48:4] +// CHECK: c-index-api-loadTU-test.m:48:9: ObjCMessageExpr=foo:9:3 Extent=[48:9 - 48:18] +// CHECK: c-index-api-loadTU-test.m:48:10: DeclRefExpr=bee:47:8 Extent=[48:10 - 48:13] +// CHECK: c-index-api-loadTU-test.m:49:12: VarDecl=c:49:12 (Definition) Extent=[49:2 - 49:26] +// CHECK: c-index-api-loadTU-test.m:49:2: TypeRef=id:0:0 Extent=[49:2 - 49:4] +// CHECK: c-index-api-loadTU-test.m:49:6: ObjCProtocolRef=SubP:29:11 Extent=[49:6 - 49:10] +// CHECK: c-index-api-loadTU-test.m:49:16: UnexposedExpr=fooC:10:3 Extent=[49:16 - 49:26] +// CHECK: c-index-api-loadTU-test.m:49:16: ObjCMessageExpr=fooC:10:3 Extent=[49:16 - 49:26] +// CHECK: c-index-api-loadTU-test.m:49:17: ObjCClassRef=Foo:4:12 Extent=[49:17 - 49:20] +// CHECK: c-index-api-loadTU-test.m:50:13: VarDecl=d:50:13 (Definition) Extent=[50:2 - 50:14] +// CHECK: c-index-api-loadTU-test.m:50:2: TypeRef=id:0:0 Extent=[50:2 - 50:4] +// CHECK: c-index-api-loadTU-test.m:50:6: ObjCProtocolRef=Proto:25:11 Extent=[50:6 - 50:11] +// CHECK: c-index-api-loadTU-test.m:51:2: BinaryOperator= Extent=[51:2 - 51:7] +// CHECK: c-index-api-loadTU-test.m:51:2: DeclRefExpr=d:50:13 Extent=[51:2 - 51:3] +// CHECK: c-index-api-loadTU-test.m:51:6: UnexposedExpr=c:49:12 Extent=[51:6 - 51:7] +// CHECK: c-index-api-loadTU-test.m:51:6: DeclRefExpr=c:49:12 Extent=[51:6 - 51:7] +// CHECK: c-index-api-loadTU-test.m:52:2: ObjCMessageExpr=pMethod:26:3 Extent=[52:2 - 52:13] +// CHECK: c-index-api-loadTU-test.m:52:3: DeclRefExpr=d:50:13 Extent=[52:3 - 52:4] +// CHECK: c-index-api-loadTU-test.m:53:2: ObjCMessageExpr=catMethodWithFloat::21:9 Extent=[53:2 - 53:44] +// CHECK: c-index-api-loadTU-test.m:53:3: DeclRefExpr=bee:47:8 Extent=[53:3 - 53:6] +// CHECK: c-index-api-loadTU-test.m:53:26: ObjCMessageExpr=floatMethod:22:11 Extent=[53:26 - 53:43] +// CHECK: c-index-api-loadTU-test.m:53:27: DeclRefExpr=bee:47:8 Extent=[53:27 - 53:30] +// CHECK: c-index-api-loadTU-test.m:54:3: CallExpr=main:46:5 Extent=[54:3 - 54:37] +// CHECK: c-index-api-loadTU-test.m:54:3: UnexposedExpr=main:46:5 Extent=[54:3 - 54:7] +// CHECK: c-index-api-loadTU-test.m:54:3: DeclRefExpr=main:46:5 Extent=[54:3 - 54:7] +// CHECK: c-index-api-loadTU-test.m:54:8: DeclRefExpr=someEnum:43:3 Extent=[54:8 - 54:16] +// CHECK: c-index-api-loadTU-test.m:54:18: CStyleCastExpr= Extent=[54:18 - 54:36] +// CHECK: c-index-api-loadTU-test.m:54:33: DeclRefExpr=bee:47:8 Extent=[54:33 - 54:36] +// CHECK: c-index-api-loadTU-test.m:62:12: ObjCInterfaceDecl=TestAttributes:62:12 Extent=[62:1 - 67:5] +// CHECK: c-index-api-loadTU-test.m:63:15: ObjCIvarDecl=anOutlet:63:15 (Definition) Extent=[58:18 - 63:23] +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: c-index-api-loadTU-test.m:64:29: ObjCIvarDecl=anOutletCollection:64:29 (Definition) Extent=[59:39 - 64:47] +// CHECK: <invalid loc>:0:0: attribute(iboutletcollection)= [IBOutletCollection=ObjCObjectPointer] +// CHECK: c-index-api-loadTU-test.m:64:26: TypeRef=id:0:0 Extent=[64:26 - 64:28] +// CHECK: c-index-api-loadTU-test.m:66:14: ObjCInstanceMethodDecl=actionMethod::66:14 Extent=[66:1 - 66:35] +// CHECK: <invalid loc>:0:0: attribute(ibaction)= +// CHECK: c-index-api-loadTU-test.m:66:31: ParmDecl=arg:66:31 (Definition) Extent=[66:28 - 66:34] +// CHECK: c-index-api-loadTU-test.m:66:28: TypeRef=id:0:0 Extent=[66:28 - 66:30] +// CHECK: c-index-api-loadTU-test.m:69:16: StructDecl=X0:69:16 Extent=[69:9 - 69:18] +// CHECK: c-index-api-loadTU-test.m:69:19: TypedefDecl=X1:69:19 (Definition) Extent=[69:1 - 69:21] +// CHECK: c-index-api-loadTU-test.m:69:16: TypeRef=struct X0:71:8 Extent=[69:16 - 69:18] +// CHECK: c-index-api-loadTU-test.m:70:8: StructDecl=X0:70:8 Extent=[70:1 - 70:10] +// CHECK: c-index-api-loadTU-test.m:71:8: StructDecl=X0:71:8 (Definition) Extent=[71:1 - 71:14] + +// CHECK: <invalid loc>:0:0: attribute(iboutlet)= +// CHECK: c-index-api-loadTU-test.m:75:29: TypeRef=id:0:0 Extent=[75:29 - 75:31] +// CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=anotherOutlet:75:32 Extent=[75:32 - 75:45] +// CHECK: c-index-api-loadTU-test.m:75:32: ObjCInstanceMethodDecl=setAnotherOutlet::75:32 Extent=[75:32 - 75:45] +// CHECK: c-index-api-loadTU-test.m:75:32: ParmDecl=anotherOutlet:75:32 (Definition) Extent=[75:32 - 75:45] + diff --git a/clang/test/Index/c-index-getCursor-pp.c b/clang/test/Index/c-index-getCursor-pp.c new file mode 100644 index 0000000..0a10450 --- /dev/null +++ b/clang/test/Index/c-index-getCursor-pp.c @@ -0,0 +1,39 @@ +#define OBSCURE(X) X +#define DECORATION + +typedef int T; +void OBSCURE(func)(int x) { + OBSCURE(T) DECORATION value; +} + +#include "a.h" + +#define A(X) X +#define B(X) A(X) + +B(int x); + +const char *fname = __FILE__; + +// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s +// CHECK-1: macro definition=OBSCURE +// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s +// CHECK-2: macro definition=DECORATION +// RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s +// CHECK-3: macro expansion=OBSCURE:1:9 +// RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s +// CHECK-4: macro expansion=OBSCURE:1:9 +// RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s +// CHECK-5: macro expansion=DECORATION:2:9 +// RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s +// CHECK-6: inclusion directive=a.h +// RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s +// CHECK-7: macro expansion=B:12:9 +// RUN: c-index-test -cursor-at=%s:16:25 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-8 %s +// CHECK-8: macro expansion=__FILE__ + +// Same tests, but with "editing" optimizations +// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s diff --git a/clang/test/Index/c-index-getCursor-test.m b/clang/test/Index/c-index-getCursor-test.m new file mode 100644 index 0000000..bae5979 --- /dev/null +++ b/clang/test/Index/c-index-getCursor-test.m @@ -0,0 +1,168 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -detailed-preprocessing-record -o %t.ast +// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck %s +@interface Foo +{ +} + +- foo; ++ fooC; + +@end + +@interface Bar : Foo +{ +} + +@end + +@interface Foo (FooCat) +- (int) catMethodWithFloat:(float) fArg; +- (float) floatMethod; +@end + +@protocol Proto +- pMethod; +@end + +@protocol SubP <Proto> +- spMethod; +@end + +@interface Baz : Bar <SubP> +{ + int _anIVar; +} + +- (Foo *) bazMethod; + +@end + +enum { + someEnum +}; + +int main (int argc, const char * argv[]) { + Baz * bee; + id a = [bee foo]; + id <SubP> c = [Foo fooC]; + id <Proto> d; + d = c; + [d pMethod]; + [bee catMethodWithFloat:[bee floatMethod]]; + main(someEnum, (const char **)bee); +} + +#define CONCAT(X, Y) X##Y + +void f() { + int CONCAT(my,_var); +} +#undef CONCAT + +// CHECK: [1:1 - 3:1] Invalid Cursor => NoDeclFound +// CHECK: [3:1 - 7:1] ObjCInterfaceDecl=Foo:3:12 +// CHECK: [7:1 - 7:7] ObjCInstanceMethodDecl=foo:7:3 +// CHECK: [7:7 - 8:1] ObjCInterfaceDecl=Foo:3:12 +// CHECK: [8:1 - 8:8] ObjCClassMethodDecl=fooC:8:3 +// CHECK: [8:8 - 10:5] ObjCInterfaceDecl=Foo:3:12 +// CHECK: [10:5 - 12:1] Invalid Cursor => NoDeclFound +// CHECK: [12:1 - 12:18] ObjCInterfaceDecl=Bar:12:12 +// CHECK: [12:18 - 12:21] ObjCSuperClassRef=Foo:3:12 +// CHECK: [12:21 - 16:5] ObjCInterfaceDecl=Bar:12:12 +// CHECK: [16:5 - 18:1] Invalid Cursor => NoDeclFound +// CHECK: [18:1 - 18:12] ObjCCategoryDecl=FooCat:18:12 +// CHECK: [18:12 - 18:15] ObjCClassRef=Foo:3:12 +// CHECK: [18:15 - 19:1] ObjCCategoryDecl=FooCat:18:12 +// CHECK: [19:1 - 19:29] ObjCInstanceMethodDecl=catMethodWithFloat::19:9 +// CHECK: [19:29 - 19:40] ParmDecl=fArg:19:36 (Definition) +// CHECK: [19:40 - 19:41] ObjCInstanceMethodDecl=catMethodWithFloat::19:9 +// CHECK: [19:41 - 20:1] ObjCCategoryDecl=FooCat:18:12 +// CHECK: [20:1 - 20:23] ObjCInstanceMethodDecl=floatMethod:20:11 +// CHECK: [20:23 - 21:5] ObjCCategoryDecl=FooCat:18:12 +// CHECK: [21:5 - 23:1] Invalid Cursor => NoDeclFound +// CHECK: [23:1 - 24:1] ObjCProtocolDecl=Proto:23:11 (Definition) +// CHECK: [24:1 - 24:11] ObjCInstanceMethodDecl=pMethod:24:3 +// CHECK: [24:11 - 25:5] ObjCProtocolDecl=Proto:23:11 (Definition) +// CHECK: [25:5 - 27:1] Invalid Cursor => NoDeclFound +// CHECK: [27:1 - 27:17] ObjCProtocolDecl=SubP:27:11 (Definition) +// CHECK: [27:17 - 27:22] ObjCProtocolRef=Proto:23:1 +// CHECK: [27:22 - 28:1] ObjCProtocolDecl=SubP:27:11 (Definition) +// CHECK: [28:1 - 28:12] ObjCInstanceMethodDecl=spMethod:28:3 +// CHECK: [28:12 - 29:5] ObjCProtocolDecl=SubP:27:11 (Definition) +// CHECK: [29:5 - 31:1] Invalid Cursor => NoDeclFound +// CHECK: [31:1 - 31:18] ObjCInterfaceDecl=Baz:31:12 +// CHECK: [31:18 - 31:21] ObjCSuperClassRef=Bar:12:12 +// CHECK: [31:21 - 31:23] ObjCInterfaceDecl=Baz:31:12 +// CHECK: [31:23 - 31:27] ObjCProtocolRef=SubP:27:1 +// CHECK: [31:27 - 33:5] ObjCInterfaceDecl=Baz:31:12 +// CHECK: [33:5 - 33:16] ObjCIvarDecl=_anIVar:33:9 (Definition) +// CHECK: [33:16 - 36:1] ObjCInterfaceDecl=Baz:31:12 +// CHECK: [36:1 - 36:4] ObjCInstanceMethodDecl=bazMethod:36:1 +// CHECK: [36:4 - 36:7] ObjCClassRef=Foo:3:12 +// CHECK: [36:7 - 36:21] ObjCInstanceMethodDecl=bazMethod:36:1 +// CHECK: [36:21 - 38:5] ObjCInterfaceDecl=Baz:31:12 +// CHECK: [38:5 - 40:1] Invalid Cursor => NoDeclFound +// CHECK: [40:1 - 41:3] EnumDecl=:40:1 (Definition) +// CHECK: [41:3 - 41:11] EnumConstantDecl=someEnum:41:3 (Definition) +// CHECK: [41:11 - 42:2] EnumDecl=:40:1 (Definition) +// CHECK: [42:2 - 44:1] Invalid Cursor => NoDeclFound +// CHECK: [44:1 - 44:11] FunctionDecl=main:44:5 (Definition) +// CHECK: [44:11 - 44:19] ParmDecl=argc:44:15 (Definition) +// CHECK: [44:19 - 44:21] FunctionDecl=main:44:5 (Definition) +// CHECK: [44:21 - 44:40] ParmDecl=argv:44:34 (Definition) +// CHECK: [44:40 - 44:42] FunctionDecl=main:44:5 (Definition) +// CHECK: [44:42 - 45:2] CompoundStmt= +// CHECK: [45:2 - 45:5] ObjCClassRef=Baz:31:12 +// CHECK: [45:5 - 45:11] VarDecl=bee:45:8 (Definition) +// CHECK: [45:11 - 45:12] DeclStmt= +// CHECK: [45:12 - 46:2] CompoundStmt= +// CHECK: [46:2 - 46:4] TypeRef=id:0:0 +// CHECK: [46:4 - 46:9] VarDecl=a:46:5 (Definition) +// CHECK: [46:9 - 46:10] ObjCMessageExpr=foo:7:3 +// CHECK: [46:10 - 46:13] DeclRefExpr=bee:45:8 +// CHECK: [46:13 - 46:18] ObjCMessageExpr=foo:7:3 +// CHECK: [46:18 - 46:19] DeclStmt= +// CHECK: [46:19 - 47:2] CompoundStmt= +// CHECK: [47:2 - 47:4] TypeRef=id:0:0 +// CHECK: [47:4 - 47:6] VarDecl=c:47:12 (Definition) +// CHECK: [47:6 - 47:10] ObjCProtocolRef=SubP:27:1 +// CHECK: [47:10 - 47:16] VarDecl=c:47:12 (Definition) +// CHECK: [47:16 - 47:17] ObjCMessageExpr=fooC:8:3 +// CHECK: [47:17 - 47:20] ObjCClassRef=Foo:3:12 +// CHECK: [47:20 - 47:26] ObjCMessageExpr=fooC:8:3 +// CHECK: [47:26 - 47:27] DeclStmt= +// CHECK: [47:27 - 48:2] CompoundStmt= +// CHECK: [48:2 - 48:4] TypeRef=id:0:0 +// CHECK: [48:4 - 48:6] VarDecl=d:48:13 (Definition) +// CHECK: [48:6 - 48:11] ObjCProtocolRef=Proto:23:1 +// CHECK: [48:11 - 48:14] VarDecl=d:48:13 (Definition) +// CHECK: [48:14 - 48:15] DeclStmt= +// CHECK: [48:15 - 49:2] CompoundStmt= +// CHECK: [49:2 - 49:3] DeclRefExpr=d:48:13 +// CHECK: [49:3 - 49:6] BinaryOperator= +// CHECK: [49:6 - 49:7] DeclRefExpr=c:47:12 +// CHECK: [49:7 - 50:2] CompoundStmt= +// CHECK: [50:2 - 50:3] ObjCMessageExpr=pMethod:24:3 +// CHECK: [50:3 - 50:4] DeclRefExpr=d:48:13 +// CHECK: [50:4 - 50:13] ObjCMessageExpr=pMethod:24:3 +// CHECK: [50:13 - 51:2] CompoundStmt= +// CHECK: [51:2 - 51:3] ObjCMessageExpr=catMethodWithFloat::19:9 +// CHECK: [51:3 - 51:6] DeclRefExpr=bee:45:8 +// CHECK: [51:6 - 51:26] ObjCMessageExpr=catMethodWithFloat::19:9 +// CHECK: [51:26 - 51:27] ObjCMessageExpr=floatMethod:20:1 +// CHECK: [51:27 - 51:30] DeclRefExpr=bee:45:8 +// CHECK: [51:30 - 51:43] ObjCMessageExpr=floatMethod:20:1 +// CHECK: [51:43 - 51:44] ObjCMessageExpr=catMethodWithFloat::19:9 +// CHECK: [51:44 - 52:3] CompoundStmt= +// CHECK: [52:3 - 52:7] DeclRefExpr=main:44:5 +// CHECK: [52:7 - 52:8] CallExpr=main:44:5 +// CHECK: [52:8 - 52:16] DeclRefExpr=someEnum:41:3 +// CHECK: [52:16 - 52:18] CallExpr=main:44:5 +// CHECK: [52:18 - 52:33] CStyleCastExpr= +// CHECK: [52:33 - 52:36] DeclRefExpr=bee:45:8 +// CHECK: [52:36 - 52:37] CallExpr=main:44:5 +// CHECK: [52:37 - 53:2] CompoundStmt= +// CHECK: [55:9 - 55:26] macro definition=CONCAT +// CHECK: [57:1 - 57:10] FunctionDecl=f:57:6 (Definition) +// CHECK: [58:4 - 58:8] VarDecl=my_var:58:8 (Definition) +// CHECK: [58:8 - 58:15] macro expansion=CONCAT:55:9 diff --git a/clang/test/Index/c-index-pch.c b/clang/test/Index/c-index-pch.c new file mode 100644 index 0000000..313fae8 --- /dev/null +++ b/clang/test/Index/c-index-pch.c @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -emit-pch -x c -o %t.pch %S/Inputs/c-index-pch.h +// RUN: %clang_cc1 -include-pch %t.pch -x c -emit-pch -o %t.ast %s +// RUN: c-index-test -test-load-tu %t.ast all | FileCheck -check-prefix=ALL %s +// ALL: FunctionDecl=foo +// ALL: VarDecl=bar +// ALL: FunctionDecl=wibble +// ALL: FunctionDecl=wonka +void wibble(int i); +void wonka(float); diff --git a/clang/test/Index/c-index-redecls.c b/clang/test/Index/c-index-redecls.c new file mode 100644 index 0000000..0cf2f03 --- /dev/null +++ b/clang/test/Index/c-index-redecls.c @@ -0,0 +1,107 @@ +// RUN: %clang_cc1 -emit-pch -o %t.ast %s +// RUN: c-index-test -test-load-tu %t.ast all + +// rdar://8956193 - We would blow the thread stack because of nested calls due +// to redeclarations. + +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); +void socrates(void); diff --git a/clang/test/Index/cindex-from-source.m b/clang/test/Index/cindex-from-source.m new file mode 100644 index 0000000..f226e45 --- /dev/null +++ b/clang/test/Index/cindex-from-source.m @@ -0,0 +1,12 @@ + +// RUN: %clang -x objective-c-header %S/Inputs/cindex-from-source.h -o %t.pfx.h.gch +// RUN: c-index-test -test-load-source local %s -include %t.pfx.h > %t +// RUN: FileCheck %s < %t +// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: StructDecl=s0:{{.*}}:{{.*}} +// CHECK: cindex-from-source.m:{{.*}}:{{.*}}: VarDecl=g0:{{.*}}:{{.*}} +// CHECK: cindex-from-source.m:9:1: TypeRef=t0:1:13 Extent=[9:1 - 9:3] +struct s0 {}; +t0 g0; + +// RUN: c-index-test -test-load-source-reparse 5 local %s -include %t.pfx.h > %t +// RUN: FileCheck %s < %t diff --git a/clang/test/Index/cindex-on-invalid-usrs.m b/clang/test/Index/cindex-on-invalid-usrs.m new file mode 100644 index 0000000..6414761 --- /dev/null +++ b/clang/test/Index/cindex-on-invalid-usrs.m @@ -0,0 +1,7 @@ +// RUN: c-index-test -test-load-source-usrs local %s 2>&1 | FileCheck %s + +// <rdar://problem/8452791> - Crash when generating USRs. +@interface Rdar8452791 () - (void)rdar8452791; + +// CHECK: error: cannot find interface declaration for 'Rdar8452791' +// CHECK: missing '@end' diff --git a/clang/test/Index/cindex-on-invalid.m b/clang/test/Index/cindex-on-invalid.m new file mode 100644 index 0000000..6eff24b --- /dev/null +++ b/clang/test/Index/cindex-on-invalid.m @@ -0,0 +1,21 @@ +// RUN: c-index-test -test-load-source local %s 2>&1 | FileCheck %s + +// <rdar://problem/9123493> +void test() { + goto exit; +} + +int foo; + +#define NO 0 + +void f(int y) { + if (y = NO); +} + +int + +// CHECK: cindex-on-invalid.m:5:8: error: use of undeclared label 'exit' +// CHECK: cindex-on-invalid.m:13:9:{13:7-13:13} +// CHECK: cindex-on-invalid.m:21:1: error: expected identifier or '(' + diff --git a/clang/test/Index/cindex-test-inclusions.c b/clang/test/Index/cindex-test-inclusions.c new file mode 100644 index 0000000..9c7de2e --- /dev/null +++ b/clang/test/Index/cindex-test-inclusions.c @@ -0,0 +1,13 @@ +// RUN: c-index-test -test-inclusion-stack-source %s 2>&1 | FileCheck %s + +#include "include_test.h" + +// CHECK: cindex-test-inclusions.c +// CHECK: included by: +// CHECK: include_test.h +// CHECK: included by: +// CHECK: cindex-test-inclusions.c:3:10 +// CHECK: include_test_2.h +// CHECK: included by: +// CHECK: include_test.h:1:10 +// CHECK: cindex-test-inclusions.c:3:10 diff --git a/clang/test/Index/code-completion.cpp b/clang/test/Index/code-completion.cpp new file mode 100644 index 0000000..5789d3b --- /dev/null +++ b/clang/test/Index/code-completion.cpp @@ -0,0 +1,90 @@ +// Code-completion through the C interface +#include "nonexistent_header.h" +struct X { + int member; + + enum E { Val1 }; +}; + +struct Y { + float member; + void memfunc(int i = 17); +}; + +struct Z : X, Y { + double member; + operator int() const; +}; +struct W { }; +struct Z get_Z(); +namespace N { } +void test_Z() { + // RUN: c-index-test -code-completion-at=%s:23:11 %s | FileCheck -check-prefix=CHECK-MEMBER %s + get_Z().member = 17; +} + + +float& overloaded(int i, long second); +double& overloaded(float f, int second); +int& overloaded(Z z, int second); + +void test_overloaded() { + // RUN: c-index-test -code-completion-at=%s:33:18 %s | FileCheck -check-prefix=CHECK-OVERLOAD %s + overloaded(Z(), 0); +} + +Z::operator int() const { + return 0; +} + +// CHECK-MEMBER: FieldDecl:{ResultType double}{TypedText member} +// CHECK-MEMBER: FieldDecl:{ResultType int}{Text X::}{TypedText member} +// CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member} +// CHECK-MEMBER: CXXMethod:{ResultType void}{Informative Y::}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )} +// CHECK-MEMBER: CXXConversion:{TypedText operator int}{LeftParen (}{RightParen )}{Informative const} +// CHECK-MEMBER: CXXMethod:{ResultType Z &}{TypedText operator=}{LeftParen (}{Placeholder const Z &}{RightParen )} +// CHECK-MEMBER: CXXMethod:{ResultType X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder const X &}{RightParen )} +// CHECK-MEMBER: CXXMethod:{ResultType Y &}{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder const Y &}{RightParen )} +// CHECK-MEMBER: EnumConstantDecl:{ResultType X::E}{Informative E::}{TypedText Val1} +// CHECK-MEMBER: StructDecl:{TypedText X}{Text ::} +// CHECK-MEMBER: StructDecl:{TypedText Y}{Text ::} +// CHECK-MEMBER: StructDecl:{TypedText Z}{Text ::} +// CHECK-MEMBER: CXXDestructor:{ResultType void}{Informative X::}{TypedText ~X}{LeftParen (}{RightParen )} +// CHECK-MEMBER: CXXDestructor:{ResultType void}{Informative Y::}{TypedText ~Y}{LeftParen (}{RightParen )} +// CHECK-MEMBER: CXXDestructor:{ResultType void}{TypedText ~Z}{LeftParen (}{RightParen )} +// CHECK-MEMBER: Completion contexts: +// CHECK-MEMBER-NEXT: Dot member access +// CHECK-MEMBER-NEXT: Container Kind: StructDecl +// CHECK-MEMBER-NEXT: Container is complete +// CHECK-MEMBER-NEXT: Container USR: c:@S@Z + +// CHECK-OVERLOAD: NotImplemented:{ResultType int &}{Text overloaded}{LeftParen (}{Text Z z}{Comma , }{CurrentParameter int second}{RightParen )} +// CHECK-OVERLOAD: NotImplemented:{ResultType float &}{Text overloaded}{LeftParen (}{Text int i}{Comma , }{CurrentParameter long second}{RightParen )} +// CHECK-OVERLOAD: NotImplemented:{ResultType double &}{Text overloaded}{LeftParen (}{Text float f}{Comma , }{CurrentParameter int second}{RightParen )} +// CHECK-OVERLOAD: Completion contexts: +// CHECK-OVERLOAD-NEXT: Any type +// CHECK-OVERLOAD-NEXT: Any value +// CHECK-OVERLOAD-NEXT: Enum tag +// CHECK-OVERLOAD-NEXT: Union tag +// CHECK-OVERLOAD-NEXT: Struct tag +// CHECK-OVERLOAD-NEXT: Class name +// CHECK-OVERLOAD-NEXT: Nested name specifier +// CHECK-OVERLOAD-NEXT: Objective-C interface + +// RUN: c-index-test -code-completion-at=%s:37:10 %s | FileCheck -check-prefix=CHECK-EXPR %s +// CHECK-EXPR: NotImplemented:{TypedText int} (50) +// CHECK-EXPR: NotImplemented:{TypedText long} (50) +// CHECK-EXPR: FieldDecl:{ResultType double}{TypedText member} (17) +// CHECK-EXPR: FieldDecl:{ResultType int}{Text X::}{TypedText member} (9) +// CHECK-EXPR: FieldDecl:{ResultType float}{Text Y::}{TypedText member} (18) +// CHECK-EXPR: CXXMethod:{ResultType void}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )} (37) +// CHECK-EXPR: Namespace:{TypedText N}{Text ::} (75) +// CHECK-EXPR: Completion contexts: +// CHECK-EXPR-NEXT: Any type +// CHECK-EXPR-NEXT: Any value +// CHECK-EXPR-NEXT: Enum tag +// CHECK-EXPR-NEXT: Union tag +// CHECK-EXPR-NEXT: Struct tag +// CHECK-EXPR-NEXT: Class name +// CHECK-EXPR-NEXT: Nested name specifier +// CHECK-EXPR-NEXT: Objective-C interface diff --git a/clang/test/Index/complete-access-checks.cpp b/clang/test/Index/complete-access-checks.cpp new file mode 100644 index 0000000..c77a5d6 --- /dev/null +++ b/clang/test/Index/complete-access-checks.cpp @@ -0,0 +1,89 @@ +struct X { + int member1; + void func1(); +protected: + int member2; + void func2(); +private: + int member3; + void func3(); +}; + +struct Y: protected X { + void doSomething(); +}; + +class Z { +public: + int member1; + void func1(); +protected: + int member2; + void func2(); +private: + int member3; + void func3(); +}; + +void Y::doSomething() { + // RUN: c-index-test -code-completion-at=%s:30:9 %s | FileCheck -check-prefix=CHECK-SUPER-ACCESS %s + this->; + + Z that; + // RUN: c-index-test -code-completion-at=%s:34:8 %s | FileCheck -check-prefix=CHECK-ACCESS %s + that. +} + +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType void}{TypedText doSomething}{LeftParen (}{RightParen )} (34) +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType void}{Informative X::}{TypedText func1}{LeftParen (}{RightParen )} (36) +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType void}{Informative X::}{TypedText func2}{LeftParen (}{RightParen )} (36) (inaccessible) +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType void}{Informative X::}{TypedText func3}{LeftParen (}{RightParen )} (36) (inaccessible) +// CHECK-SUPER-ACCESS: FieldDecl:{ResultType int}{Informative X::}{TypedText member1} (37) +// CHECK-SUPER-ACCESS: FieldDecl:{ResultType int}{Informative X::}{TypedText member2} (37) (inaccessible) +// CHECK-SUPER-ACCESS: FieldDecl:{ResultType int}{Informative X::}{TypedText member3} (37) (inaccessible) +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType Y &}{TypedText operator=}{LeftParen (}{Placeholder const Y &}{RightParen )} (34) +// CHECK-SUPER-ACCESS: CXXMethod:{ResultType X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder const X &}{RightParen )} (36) +// CHECK-SUPER-ACCESS: StructDecl:{TypedText X}{Text ::} (77) +// CHECK-SUPER-ACCESS: StructDecl:{TypedText Y}{Text ::} (75) +// CHECK-SUPER-ACCESS: CXXDestructor:{ResultType void}{Informative X::}{TypedText ~X}{LeftParen (}{RightParen )} (36) +// CHECK-SUPER-ACCESS: CXXDestructor:{ResultType void}{TypedText ~Y}{LeftParen (}{RightParen )} (34) + +// CHECK-ACCESS: CXXMethod:{ResultType void}{TypedText func1}{LeftParen (}{RightParen )} (34) +// CHECK-ACCESS: CXXMethod:{ResultType void}{TypedText func2}{LeftParen (}{RightParen )} (34) (inaccessible) +// CHECK-ACCESS: CXXMethod:{ResultType void}{TypedText func3}{LeftParen (}{RightParen )} (34) (inaccessible) +// CHECK-ACCESS: FieldDecl:{ResultType int}{TypedText member1} (35) +// CHECK-ACCESS: FieldDecl:{ResultType int}{TypedText member2} (35) (inaccessible) +// CHECK-ACCESS: FieldDecl:{ResultType int}{TypedText member3} (35) (inaccessible) +// CHECK-ACCESS: CXXMethod:{ResultType Z &}{TypedText operator=}{LeftParen (}{Placeholder const Z &}{RightParen )} (34) +// CHECK-ACCESS: ClassDecl:{TypedText Z}{Text ::} (75) +// CHECK-ACCESS: CXXDestructor:{ResultType void}{TypedText ~Z}{LeftParen (}{RightParen )} (34) + +class P { +protected: + int member; +}; + +class Q : public P { +public: + using P::member; +}; + +void f(P x, Q y) { + // RUN: c-index-test -code-completion-at=%s:73:5 %s | FileCheck -check-prefix=CHECK-USING-INACCESSIBLE %s + x.; // member is inaccessible + // RUN: c-index-test -code-completion-at=%s:75:5 %s | FileCheck -check-prefix=CHECK-USING-ACCESSIBLE %s + y.; // member is accessible +} + +// CHECK-USING-INACCESSIBLE: FieldDecl:{ResultType int}{TypedText member} (35) (inaccessible) +// CHECK-USING-INACCESSIBLE: CXXMethod:{ResultType P &}{TypedText operator=}{LeftParen (}{Placeholder const P &}{RightParen )} (34) +// CHECK-USING-INACCESSIBLE: ClassDecl:{TypedText P}{Text ::} (75) +// CHECK-USING-INACCESSIBLE: CXXDestructor:{ResultType void}{TypedText ~P}{LeftParen (}{RightParen )} (34) + +// CHECK-USING-ACCESSIBLE: FieldDecl:{ResultType int}{TypedText member} (35) +// CHECK-USING-ACCESSIBLE: CXXMethod:{ResultType Q &}{TypedText operator=}{LeftParen (}{Placeholder const Q &}{RightParen )} (34) +// CHECK-USING-ACCESSIBLE: CXXMethod:{ResultType P &}{Text P::}{TypedText operator=}{LeftParen (}{Placeholder const P &}{RightParen )} (36) +// CHECK-USING-ACCESSIBLE: ClassDecl:{TypedText P}{Text ::} (77) +// CHECK-USING-ACCESSIBLE: ClassDecl:{TypedText Q}{Text ::} (75) +// CHECK-USING-ACCESSIBLE: CXXDestructor:{ResultType void}{Informative P::}{TypedText ~P}{LeftParen (}{RightParen )} (36) +// CHECK-USING-ACCESSIBLE: CXXDestructor:{ResultType void}{TypedText ~Q}{LeftParen (}{RightParen )} (34) diff --git a/clang/test/Index/complete-at-directives.m b/clang/test/Index/complete-at-directives.m new file mode 100644 index 0000000..1e97d45 --- /dev/null +++ b/clang/test/Index/complete-at-directives.m @@ -0,0 +1,54 @@ +/* Run lines are at the end, since line/column matter in this test. */ +@interface MyClass { @public } +@end + +@implementation MyClass +@end + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:2:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: {TypedText class}{HorizontalSpace }{Placeholder name} +// CHECK-CC1: {TypedText compatibility_alias}{HorizontalSpace }{Placeholder alias}{HorizontalSpace }{Placeholder class} +// CHECK-CC1: {TypedText implementation}{HorizontalSpace }{Placeholder class} +// CHECK-CC1: {TypedText interface}{HorizontalSpace }{Placeholder class} +// CHECK-CC1: {TypedText protocol}{HorizontalSpace }{Placeholder protocol} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:3:2 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: {TypedText end} +// CHECK-CC2: {TypedText optional} +// CHECK-CC2: {TypedText property} +// CHECK-CC2: {TypedText required} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:6:2 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: {TypedText dynamic}{HorizontalSpace }{Placeholder property} +// CHECK-CC3: {TypedText end} +// CHECK-CC3: {TypedText synthesize}{HorizontalSpace }{Placeholder property} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:2:1 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: NotImplemented:{TypedText @class}{HorizontalSpace }{Placeholder name} +// CHECK-CC4: NotImplemented:{TypedText @compatibility_alias}{HorizontalSpace }{Placeholder alias}{HorizontalSpace }{Placeholder class} +// CHECK-CC4: NotImplemented:{TypedText @implementation}{HorizontalSpace }{Placeholder class} +// CHECK-CC4: NotImplemented:{TypedText @interface}{HorizontalSpace }{Placeholder class} +// CHECK-CC4: NotImplemented:{TypedText @protocol}{HorizontalSpace }{Placeholder protocol} +// CHECK-CC4: NotImplemented:{TypedText _Bool} +// CHECK-CC4: TypedefDecl:{TypedText Class} +// CHECK-CC4: TypedefDecl:{TypedText id} +// CHECK-CC4: TypedefDecl:{TypedText SEL} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:3:1 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: {TypedText @end} +// CHECK-CC5: {TypedText @optional} +// CHECK-CC5: {TypedText @property} +// CHECK-CC5: {TypedText @required} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:2:23 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: NotImplemented:{TypedText package} +// CHECK-CC6: NotImplemented:{TypedText private} +// CHECK-CC6: NotImplemented:{TypedText protected} +// CHECK-CC6: NotImplemented:{TypedText public} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:2:22 %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7: NotImplemented:{TypedText @package} +// CHECK-CC7: NotImplemented:{TypedText @private} +// CHECK-CC7: NotImplemented:{TypedText @protected} +// CHECK-CC7: NotImplemented:{TypedText @public} +// CHECK-CC7: NotImplemented:{TypedText _Bool} diff --git a/clang/test/Index/complete-at-exprstmt.m b/clang/test/Index/complete-at-exprstmt.m new file mode 100644 index 0000000..a6d7675 --- /dev/null +++ b/clang/test/Index/complete-at-exprstmt.m @@ -0,0 +1,55 @@ +/* The run lines are below, because this test is line- and + column-number sensitive. */ +@interface MyClass { int ivar; } +- (int)myMethod:(int)arg; +@end + +@implementation MyClass +- (int)myMethod:(int)arg { + @synchronized (@encode(MyClass)) { } +} +@end + +@interface A ++ (int)add:(int)x to:(int)y; ++ (int)add:(int)x to:(int)y plus:(int)z; +@end + +void f() { + @selector(add:to:); +} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:4 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC1: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} +// CHECK-CC1: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} +// CHECK-CC1: {TypedText synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} +// CHECK-CC1: {TypedText throw}{HorizontalSpace }{Placeholder expression} +// CHECK-CC1: {TypedText try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }} +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:19 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: {TypedText encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC2: {TypedText protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} +// CHECK-CC2: {TypedText selector}{LeftParen (}{Placeholder selector}{RightParen )} +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:3 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC3: NotImplemented:{ResultType Protocol *}{TypedText @protocol}{LeftParen (}{Placeholder protocol-name}{RightParen )} +// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText @selector}{LeftParen (}{Placeholder selector}{RightParen )} +// CHECK-CC3: NotImplemented:{TypedText @synchronized}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }} +// CHECK-CC3: NotImplemented:{TypedText @throw}{HorizontalSpace }{Placeholder expression} +// CHECK-CC3: NotImplemented:{TypedText @try}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @catch}{LeftParen (}{Placeholder parameter}{RightParen )}{LeftBrace {}{Placeholder statements}{RightBrace }}{Text @finally}{LeftBrace {}{Placeholder statements}{RightBrace }} +// CHECK-CC3: NotImplemented:{ResultType SEL}{TypedText _cmd} +// CHECK-CC3: ParmDecl:{ResultType int}{TypedText arg} +// CHECK-CC3: TypedefDecl:{TypedText Class} +// CHECK-CC3: TypedefDecl:{TypedText id} +// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText ivar} +// CHECK-CC3: ObjCInterfaceDecl:{TypedText MyClass} +// CHECK-CC3: TypedefDecl:{TypedText SEL} +// CHECK-CC3: NotImplemented:{ResultType MyClass *}{TypedText self} +// RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: NotImplemented:{TypedText add:to:} (40) +// CHECK-CC4: NotImplemented:{TypedText add:to:plus:} (40) +// CHECK-CC4: NotImplemented:{TypedText myMethod:} (40) +// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:} (40) +// CHECK-CC5: NotImplemented:{Informative add:}{TypedText to:plus:} (40) + diff --git a/clang/test/Index/complete-blocks.m b/clang/test/Index/complete-blocks.m new file mode 100644 index 0000000..cb507e2 --- /dev/null +++ b/clang/test/Index/complete-blocks.m @@ -0,0 +1,64 @@ +// The line and column layout of this test is significant. Run lines +// are at the end. +typedef void (^block_t)(float f, double d); +void f(int (^block)(int x, int y)); +void g(block_t b); + +void test_f() { + +} + +@interface A +- method:(int (^)(int x, int y))b; +- method2:(block_t)b; +@end + +void test_A(A *a) { + [a method:0]; +} + +@interface B +- method3:(int (^)(void))b; +@end + +void test_B(B *b) { + [b method3:^int(void){ return 0; }]; +} + +@interface C +- method4:(void(^)(void))arg; +- method5:(void(^)())arg5; +@end + +void test_C(C *c) { + [c method4:^{}]; +} + +@interface D +- method6:(void(^)(block_t block))arg; +@end + +void test_D(D *d) { + [d method6:0]; +} + +// RUN: c-index-test -code-completion-at=%s:8:1 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder ^int(int x, int y)block}{RightParen )} (50) +// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{Placeholder ^(float f, double d)b}{RightParen )} (50) +// RUN: c-index-test -code-completion-at=%s:17:6 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method2:}{Placeholder ^(float f, double d)b} (35) +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText method:}{Placeholder ^int(int x, int y)b} (35) +// RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText method3:}{Placeholder ^int(void)b} (35) +// RUN: c-index-test -code-completion-at=%s:34:6 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method4:}{Placeholder ^(void)arg} (35) +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType id}{TypedText method5:}{Placeholder ^(void)arg5} (35) +// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: TypedefDecl:{TypedText block_t} (50) +// CHECK-CC5: TypedefDecl:{TypedText Class} (50) +// CHECK-CC5-NOT: test_A +// CHECK-CC5: {TypedText union} (50) + +// RUN: c-index-test -code-completion-at=%s:42:6 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInstanceMethodDecl:{ResultType id}{TypedText method6:}{Placeholder ^(block_t block)arg} (35) + diff --git a/clang/test/Index/complete-categories.m b/clang/test/Index/complete-categories.m new file mode 100644 index 0000000..92b14db --- /dev/null +++ b/clang/test/Index/complete-categories.m @@ -0,0 +1,39 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ + +@interface I1 @end +@interface I2 @end +@interface I3 : I2 @end + +@interface I1(Cat1) @end +@interface I1(Cat2) @end +@interface I1(Cat3) @end + +@interface I2 (Cat2) @end +@interface I2 (Cat3) @end +@interface I2 (Cat2) @end +@interface I3 (Cat1) @end +@interface I3 (Cat2) @end + +@implementation I1(Cat2) @end +@implementation I1(Cat3) @end +@implementation I3(Cat2) @end + +// RUN: c-index-test -code-completion-at=%s:12:16 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCCategoryDecl:{TypedText Cat1} +// CHECK-CC1: ObjCCategoryDecl:{TypedText Cat2} +// CHECK-CC1: ObjCCategoryDecl:{TypedText Cat3} +// RUN: c-index-test -code-completion-at=%s:13:16 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCCategoryDecl:{TypedText Cat1} +// CHECK-CC2-NEXT: ObjCCategoryDecl:{TypedText Cat3} +// RUN: c-index-test -code-completion-at=%s:18:20 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCCategoryDecl:{TypedText Cat1} +// CHECK-CC3: ObjCCategoryDecl:{TypedText Cat2} +// CHECK-CC3: ObjCCategoryDecl:{TypedText Cat3} +// RUN: c-index-test -code-completion-at=%s:19:20 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCCategoryDecl:{TypedText Cat1} +// CHECK-CC4-NEXT: ObjCCategoryDecl:{TypedText Cat3} +// RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: ObjCCategoryDecl:{TypedText Cat1} +// CHECK-CC5-NEXT: ObjCCategoryDecl:{TypedText Cat2} +// CHECK-CC5-NEXT: ObjCCategoryDecl:{TypedText Cat3} diff --git a/clang/test/Index/complete-ctor-inits.cpp b/clang/test/Index/complete-ctor-inits.cpp new file mode 100644 index 0000000..f506214 --- /dev/null +++ b/clang/test/Index/complete-ctor-inits.cpp @@ -0,0 +1,40 @@ +// The run lines are below, because this test is line- and +// column-number sensitive. + +template<typename T> +struct X { + X(T); +}; + +struct Virt { }; +struct Y : virtual Virt { }; + +struct Z : public X<int>, public Y { + Z(); + + int a, b, c; +}; + +Z::Z() : ::X<int>(0), Virt(), b(), c() { } + +// RUN: c-index-test -code-completion-at=%s:18:10 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC1: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC1: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC1: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC1: NotImplemented:{TypedText X<int>}{LeftParen (}{Placeholder args}{RightParen )} (7) +// CHECK-CC1: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (35) + +// RUN: c-index-test -code-completion-at=%s:18:23 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC2: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC2: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC2: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC2: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (7) + +// RUN: c-index-test -code-completion-at=%s:18:36 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: MemberRef:{TypedText a}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CC3-NOT: MemberRef:{TypedText b}{LeftParen (}{Placeholder args}{RightParen )} +// CHECK-CC3: MemberRef:{TypedText c}{LeftParen (}{Placeholder args}{RightParen )} (7) +// CHECK-CC3-NOT: NotImplemented:{TypedText Virt}{LeftParen (}{Placeholder args}{RightParen )} +// CHECK-CC3: NotImplemented:{TypedText Y}{LeftParen (}{Placeholder args}{RightParen )} (35) diff --git a/clang/test/Index/complete-cxx-inline-methods.cpp b/clang/test/Index/complete-cxx-inline-methods.cpp new file mode 100644 index 0000000..d441972 --- /dev/null +++ b/clang/test/Index/complete-cxx-inline-methods.cpp @@ -0,0 +1,44 @@ +namespace { +class MyCls { + void in_foo() { + vec.x = 0; + } + void out_foo(); + + struct Vec { int x, y; }; + Vec vec; +}; + +void MyCls::out_foo() { + vec.x = 0; +} + +class OtherClass : public MyCls { +public: + OtherClass(const OtherClass &other) : MyCls(other), value(value) { } + +private: + int value; + MyCls *object; +}; +} + +// RUN: c-index-test -code-completion-at=%s:4:9 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:13:7 %s | FileCheck %s +// CHECK: CXXMethod:{ResultType MyCls::Vec &}{TypedText operator=}{LeftParen (}{Placeholder const MyCls::Vec &}{RightParen )} (34) +// CHECK-NEXT: StructDecl:{TypedText Vec}{Text ::} (75) +// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText x} (35) +// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText y} (35) +// CHECK-NEXT: CXXDestructor:{ResultType void}{TypedText ~Vec}{LeftParen (}{RightParen )} (34) +// CHECK-NEXT: Completion contexts: +// CHECK-NEXT: Dot member access +// CHECK-NEXT: Container Kind: StructDecl + +// RUN: c-index-test -code-completion-at=%s:18:41 %s | FileCheck -check-prefix=CHECK-CTOR-INIT %s +// CHECK-CTOR-INIT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )} (7) +// CHECK-CTOR-INIT: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CTOR-INIT: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (35) +// RUN: c-index-test -code-completion-at=%s:18:55 %s | FileCheck -check-prefix=CHECK-CTOR-INIT-2 %s +// CHECK-CTOR-INIT-2-NOT: NotImplemented:{TypedText MyCls}{LeftParen (}{Placeholder args}{RightParen )} +// CHECK-CTOR-INIT-2: MemberRef:{TypedText object}{LeftParen (}{Placeholder args}{RightParen )} (35) +// CHECK-CTOR-INIT-2: MemberRef:{TypedText value}{LeftParen (}{Placeholder args}{RightParen )} (7) diff --git a/clang/test/Index/complete-declarators.cpp b/clang/test/Index/complete-declarators.cpp new file mode 100644 index 0000000..ccbfde1 --- /dev/null +++ b/clang/test/Index/complete-declarators.cpp @@ -0,0 +1,43 @@ +// This test is line- and column-sensitive, so test commands are at the bottom. +namespace N { + struct X { + int f(X); + }; +} + +int g(int a); + +struct Y { }; + +struct Z { + int member; + friend int N::X::f(N::X); +}; + +// RUN: c-index-test -code-completion-at=%s:8:5 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:8:5 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText const} (40) +// CHECK-CC1: Namespace:{TypedText N}{Text ::} (75) +// CHECK-CC1: NotImplemented:{TypedText operator} (40) +// CHECK-CC1: NotImplemented:{TypedText volatile} (40) +// RUN: c-index-test -code-completion-at=%s:8:11 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:8:11 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{TypedText const} (40) +// CHECK-CC2-NOT: Namespace:{TypedText N}{Text ::} (75) +// CHECK-CC2-NOT: NotImplemented:{TypedText operator} (40) +// CHECK-CC2: NotImplemented:{TypedText volatile} (40) +// RUN: c-index-test -code-completion-at=%s:13:7 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:13:7 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{TypedText const} (40) +// CHECK-CC3-NOT: Namespace:{TypedText N}{Text ::} (75) +// CHECK-CC3: NotImplemented:{TypedText operator} (40) +// CHECK-CC3: NotImplemented:{TypedText volatile} (40) +// RUN: c-index-test -code-completion-at=%s:14:14 %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:14 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: NotImplemented:{TypedText const} (40) +// CHECK-CC4: Namespace:{TypedText N}{Text ::} (75) +// CHECK-CC4: NotImplemented:{TypedText operator} (40) +// CHECK-CC4: NotImplemented:{TypedText volatile} (40) +// CHECK-CC4: StructDecl:{TypedText Y}{Text ::} (75) +// CHECK-CC4: StructDecl:{TypedText Z}{Text ::} (75) + diff --git a/clang/test/Index/complete-declarators.m b/clang/test/Index/complete-declarators.m new file mode 100644 index 0000000..071df60 --- /dev/null +++ b/clang/test/Index/complete-declarators.m @@ -0,0 +1,72 @@ +// This test is line- and column-sensitive, so test commands are at the bottom. +@protocol P +- (int)method:(id)param1; +@end + +@interface A <P> +- (int)method:(id)param1; + +@property int prop1; +@end + +@implementation A +- (int)method:(id)param1 { + int q2; + for(id q in param1) { + int y; + } + id q; + for(q in param1) { + int y; + } + + static P *p = 0; +} +@end + +// RUN: c-index-test -code-completion-at=%s:7:19 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1-NOT: NotImplemented:{TypedText extern} (40) +// CHECK-CC1: NotImplemented:{TypedText param1} (40) +// RUN: c-index-test -code-completion-at=%s:9:15 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:15:10 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:16:9 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{TypedText const} (40) +// CHECK-CC2-NOT: int +// CHECK-CC2: NotImplemented:{TypedText restrict} (40) +// CHECK-CC2: NotImplemented:{TypedText volatile} (40) +// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34) +// CHECK-CC3-NOT: VarDecl:{ResultType int}{TypedText q2} +// CHECK-CC3-NOT: VarDecl:{ResultType id}{TypedText q} +// CHECK-CC3: NotImplemented:{ResultType A *}{TypedText self} (34) +// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ParmDecl:{ResultType id}{TypedText param1} (34) +// CHECK-CC4-NOT: VarDecl:{ResultType int}{TypedText q2} +// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (34) +// CHECK-CC4: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// RUN: c-index-test -code-completion-at=%s:23:10 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: NotImplemented:{TypedText _Bool} (50) +// CHECK-CC5: NotImplemented:{TypedText _Complex} (50) +// CHECK-CC5: NotImplemented:{TypedText _Imaginary} (50) +// CHECK-CC5: ObjCInterfaceDecl:{TypedText A} (50) +// CHECK-CC5: NotImplemented:{TypedText char} (50) +// CHECK-CC5: TypedefDecl:{TypedText Class} (50) +// CHECK-CC5: NotImplemented:{TypedText const} (50) +// CHECK-CC5: NotImplemented:{TypedText double} (50) +// CHECK-CC5: NotImplemented:{TypedText enum} (50) +// CHECK-CC5: NotImplemented:{TypedText float} (50) +// CHECK-CC5: TypedefDecl:{TypedText id} (50) +// CHECK-CC5: NotImplemented:{TypedText int} (50) +// CHECK-CC5: NotImplemented:{TypedText long} (50) +// CHECK-CC5: NotImplemented:{TypedText restrict} (50) +// CHECK-CC5: TypedefDecl:{TypedText SEL} (50) +// CHECK-CC5: NotImplemented:{TypedText short} (50) +// CHECK-CC5: NotImplemented:{TypedText signed} (50) +// CHECK-CC5: NotImplemented:{TypedText struct} (50) +// CHECK-CC5: NotImplemented:{TypedText typeof}{HorizontalSpace }{Placeholder expression} (40) +// CHECK-CC5: NotImplemented:{TypedText typeof}{LeftParen (}{Placeholder type}{RightParen )} (40) +// CHECK-CC5: NotImplemented:{TypedText union} (50) +// CHECK-CC5: NotImplemented:{TypedText unsigned} (50) +// CHECK-CC5: NotImplemented:{TypedText void} (50) +// CHECK-CC5: NotImplemented:{TypedText volatile} (50) diff --git a/clang/test/Index/complete-driver-errors.c b/clang/test/Index/complete-driver-errors.c new file mode 100644 index 0000000..566090c --- /dev/null +++ b/clang/test/Index/complete-driver-errors.c @@ -0,0 +1,24 @@ +int *blah = 1; + +int + +// CHECK-RESULTS: NotImplemented:{TypedText const} (40) +// CHECK-RESULTS: NotImplemented:{TypedText restrict} (40) +// CHECK-RESULTS: NotImplemented:{TypedText volatile} (40) +// CHECK-DIAGS: error: invalid value '' in '-std=' +// CHECK-DIAGS: complete-driver-errors.c:1:6:{1:13-1:14}: warning: incompatible integer to pointer conversion initializing 'int *' with an expression of type 'int' + +// Test driver errors with code completion +// RUN: c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t + +// Test driver errors with parsing +// RUN: c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t +// CHECK-LOAD: complete-driver-errors.c:1:6: VarDecl=blah:1:6 + +// Test driver errors with code completion and precompiled preamble +// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t diff --git a/clang/test/Index/complete-enums.c b/clang/test/Index/complete-enums.c new file mode 100644 index 0000000..713e24f --- /dev/null +++ b/clang/test/Index/complete-enums.c @@ -0,0 +1,22 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +enum __attribute__((deprecated)) Color { + Color_Red = 17, + Color_Green, + Color_Blue +}; +int Greeby(); +void f(enum Color color) { + switch (color) { + case Red: + } +} + +// RUN: c-index-test -code-completion-at=%s:11:1 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: EnumConstantDecl:{ResultType enum Color}{TypedText Color_Red} (65) (deprecated) + +// RUN: c-index-test -code-completion-at=%s:12:8 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: EnumConstantDecl:{ResultType enum Color}{TypedText Color_Blue} (7) (deprecated) +// CHECK-CC2-NEXT: EnumConstantDecl:{ResultType enum Color}{TypedText Color_Green} (7) (deprecated) +// CHECK-CC2-NEXT: EnumConstantDecl:{ResultType enum Color}{TypedText Color_Red} (7) (deprecated) diff --git a/clang/test/Index/complete-enums.cpp b/clang/test/Index/complete-enums.cpp new file mode 100644 index 0000000..49a8932 --- /dev/null +++ b/clang/test/Index/complete-enums.cpp @@ -0,0 +1,25 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +enum class Color { + Red = 17, + Green, + Blue +}; +int Greeby(); +void f(Color color) { + switch (color) { + case Color::Green: + case Color::Red; + } +} + +// RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7) +// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Green} (7) +// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7) + +// RUN: c-index-test -code-completion-at=%s:13:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7) +// CHECK-CC2-NOT: Green +// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7) diff --git a/clang/test/Index/complete-exprs.c b/clang/test/Index/complete-exprs.c new file mode 100644 index 0000000..afb6219 --- /dev/null +++ b/clang/test/Index/complete-exprs.c @@ -0,0 +1,69 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +int f(int) __attribute__((unavailable)); + +int test(int i, int j, int k, int l) { + return i | j | k & l; +} + +struct X __attribute__((deprecated)) f1 = { 17 }; +void f2() { f1(17); } + +const char *str = "Hello, \nWorld"; + +void f3(const char*, ...) __attribute__((sentinel(0))); + +#define NULL __null +void f4(const char* str) { + f3(str, NULL); +} + +typedef int type; +void f5(float f) { + (type)f; +} + +// RUN: c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText __PRETTY_FUNCTION__} (65) +// CHECK-CC1: macro definition:{TypedText __VERSION__} (70) +// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (12) (unavailable) +// CHECK-CC1-NOT: NotImplemented:{TypedText float} (65) +// CHECK-CC1: ParmDecl:{ResultType int}{TypedText j} (8) +// CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:14 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: macro definition:{TypedText __VERSION__} (70) +// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC3-NOT: NotImplemented:{TypedText float} +// CHECK-CC3: ParmDecl:{ResultType int}{TypedText j} (34) +// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expressio + +// RUN: c-index-test -code-completion-at=%s:7:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:7:22 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:7:2 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: macro definition:{TypedText __VERSION__} (70) +// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC2: NotImplemented:{TypedText float} (50) +// CHECK-CC2: ParmDecl:{ResultType int}{TypedText j} (34) +// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// RUN: c-index-test -code-completion-at=%s:11:16 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText f}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated) + +// RUN: c-index-test -code-completion-at=%s:19:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50) +// CHECK-CC6: NotImplemented:{TypedText void} (50) +// CHECK-CC6: NotImplemented:{TypedText volatile} (50) + +// RUN: c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:24:4 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7: ParmDecl:{ResultType float}{TypedText f} (34) +// CHECK-CC7: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated) +// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f2}{LeftParen (}{RightParen )} (50) +// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (50) +// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f4}{LeftParen (}{Placeholder const char *str}{RightParen )} (50) +// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText f5}{LeftParen (}{Placeholder float f}{RightParen )} (50) +// CHECK-CC7: TypedefDecl:{TypedText type} diff --git a/clang/test/Index/complete-exprs.cpp b/clang/test/Index/complete-exprs.cpp new file mode 100644 index 0000000..de3aac5 --- /dev/null +++ b/clang/test/Index/complete-exprs.cpp @@ -0,0 +1,84 @@ +// Line- and column-sensitive test; run lines follow. + +class string { + public: + string(); + string(const char *); + string(const char *, int n); +}; + +template<typename T> +class vector { +public: + vector(const T &, unsigned n); + template<typename InputIterator> + vector(InputIterator first, InputIterator last); + void push_back(const T&); +}; +template<typename T> void vector<T>::push_back(const T&) { } +void f() { + +} + +int foo(); + +void g() { + vector<int>(foo(), foo()); +} + +struct X { + void f() const; +}; + +void X::f() const { + +} + +namespace N { + int x; + class C { + int member; + + int f(int param) { + return member; + } + }; +} + +// RUN: c-index-test -code-completion-at=%s:20:2 %s -std=c++0x | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:20:2 -std=c++0x %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText alignof}{LeftParen (}{Placeholder type}{RightParen )} (40) +// CHECK-CC1: NotImplemented:{ResultType bool}{TypedText noexcept}{LeftParen (}{Placeholder expression}{RightParen )} (40) +// CHECK-CC1: NotImplemented:{ResultType std::nullptr_t}{TypedText nullptr} (40) +// CHECK-CC1: NotImplemented:{TypedText operator} (40) +// CHECK-CC1-NOT: push_back +// CHECK-CC1: ClassDecl:{TypedText string} (50) +// CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{RightParen )} (50) +// CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{RightParen )} (50) +// CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{Comma , }{Placeholder int n}{RightParen )} (50) +// CHECK-CC1: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) +// CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) +// CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50) + +// RUN: c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ClassDecl:{TypedText string} (50) +// CHECK-CC2-NOT: CXXConstructor +// CHECK-CC2: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) + +// RUN: c-index-test -code-completion-at=%s:26:15 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{TypedText float} (50) +// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{RightParen )} (50) +// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{RightParen )} (50) +// CHECK-CC3: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) +// CHECK-CC3: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) +// CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50) + +// RUN: c-index-test -code-completion-at=%s:34:1 %s -std=c++0x | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: NotImplemented:{ResultType const X *}{TypedText this} (40) + +// RUN: c-index-test -code-completion-at=%s:43:14 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: FieldDecl:{ResultType int}{TypedText member} (8) (parent: ClassDecl 'N::C') +// CHECK-CC5: ParmDecl:{ResultType int}{TypedText param} (8) +// CHECK-CC5: StructDecl:{TypedText X} (50) (parent: TranslationUnit '(null)') +// CHECK-CC5: VarDecl:{ResultType int}{TypedText x} (12) (parent: Namespace 'N') diff --git a/clang/test/Index/complete-exprs.m b/clang/test/Index/complete-exprs.m new file mode 100644 index 0000000..c3ff63b --- /dev/null +++ b/clang/test/Index/complete-exprs.m @@ -0,0 +1,49 @@ +typedef signed char BOOL; +#define YES ((BOOL)1) +#define NO ((BOOL)0) +#define bool _Bool +@interface NSArray + (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt; @end +@interface A +- (int)method:(id)param1; +@property int prop1; +@end +__strong id global; +@implementation A +- (int)method:(id)param1 { + void foo(bool (^block)(id x, A* y)); + for(BOOL B = YES; ; ) { } + @[ global ]; + @{ global : global }; +} +@end + +// RUN: c-index-test -code-completion-at=%s:13:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText @[}{HorizontalSpace }{Placeholder objects, ...}{HorizontalSpace }{RightBracket ]} (40) +// CHECK-CC1: NotImplemented:{TypedText @{}{HorizontalSpace }{Placeholder key}{HorizontalSpace }{Colon :}{HorizontalSpace }{Placeholder object, ...}{HorizontalSpace }{RightBrace }} (40) +// CHECK-CC1: NotImplemented:{ResultType SEL}{TypedText _cmd} (80) +// CHECK-CC1: TypedefDecl:{TypedText BOOL} (50) +// CHECK-CC1: macro definition:{TypedText bool} (51) +// CHECK-CC1: macro definition:{TypedText NO} (65) +// CHECK-CC1: NotImplemented:{ResultType A *}{TypedText self} (34) +// CHECK-CC1: macro definition:{TypedText YES} (65) +// RUN: c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:7 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: TypedefDecl:{TypedText BOOL} (50) +// CHECK-CC2: NotImplemented:{TypedText char} (50) +// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// RUN: c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:1 -fobjc-arc -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText foo}{LeftParen (}{Placeholder ^bool(id x, A *y)block}{RightParen )} (34) +// CHECK-CC3: VarDecl:{ResultType id}{TypedText global} (50) +// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34) + +// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: c-index-test -code-completion-at=%s:16:14 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: NotImplemented:{TypedText @[}{HorizontalSpace }{Placeholder objects, ...}{HorizontalSpace }{RightBracket ]} (40) +// CHECK-CC4: NotImplemented:{TypedText @{}{HorizontalSpace }{Placeholder key}{HorizontalSpace }{Colon :}{HorizontalSpace }{Placeholder object, ...}{HorizontalSpace }{RightBrace }} (40) +// CHECK-CC4: NotImplemented:{ResultType SEL}{TypedText _cmd} (80) +// CHECK-CC4: macro definition:{TypedText bool} (51) +// CHECK-CC4: macro definition:{TypedText NO} (65) +// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (34) +// CHECK-CC4: macro definition:{TypedText YES} (65) diff --git a/clang/test/Index/complete-hiding.c b/clang/test/Index/complete-hiding.c new file mode 100644 index 0000000..1da20e6 --- /dev/null +++ b/clang/test/Index/complete-hiding.c @@ -0,0 +1,32 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +struct StructA { }; +struct StructB { }; +struct StructC { }; +int ValueA; +int ValueB; + +void f() { + + int ValueA = 0; + int StructA = 0; + struct StructB { }; + + struct StructA sa = { }; +} + +// RUN: c-index-test -code-completion-at=%s:16:3 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC1 -input-file=%t %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: VarDecl:{ResultType int}{TypedText StructA} (34) +// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueA} (34) +// CHECK-CC1-NOT: VarDecl:{ResultType int}{TypedText ValueA} (50) +// CHECK-CC1: VarDecl:{ResultType int}{TypedText ValueB} (50) +// RUN: c-index-test -code-completion-at=%s:16:10 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s +// CHECK-CC2: StructDecl:{TypedText StructA} (50) +// CHECK-CC2-NOT: StructDecl:{TypedText StructB} (50) +// CHECK-CC2: StructDecl:{TypedText StructC} (50) +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:16:10 %s > %t +// RUN: FileCheck -check-prefix=CHECK-CC2 -input-file=%t %s diff --git a/clang/test/Index/complete-in-invalid-method.m b/clang/test/Index/complete-in-invalid-method.m new file mode 100644 index 0000000..0e6c8e6 --- /dev/null +++ b/clang/test/Index/complete-in-invalid-method.m @@ -0,0 +1,19 @@ +@interface I +-(void)foo; +@end + +struct S { + int x,y; +}; + +@implementation I +-(void) foo { + struct S s; + if (1) { + s. +} +@end + +// RUN: c-index-test -code-completion-at=%s:13:7 -fobjc-nonfragile-abi %s | FileCheck %s +// CHECK: FieldDecl:{ResultType int}{TypedText x} +// CHECK: FieldDecl:{ResultType int}{TypedText y} diff --git a/clang/test/Index/complete-in-stringify.c b/clang/test/Index/complete-in-stringify.c new file mode 100644 index 0000000..d518549 --- /dev/null +++ b/clang/test/Index/complete-in-stringify.c @@ -0,0 +1,17 @@ +const char *func(const char *); + +#define MORE __FILE__ + +#define M(x) "1"#x +#define N(x) func("2"#x MORE) + +void foo(const char *); + +int test() { + foo(M(x())); + foo(N(x())); +} + +// RUN: c-index-test -code-completion-at=%s:11:11 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:12:11 %s | FileCheck %s +// CHECK: Natural language diff --git a/clang/test/Index/complete-interfaces.m b/clang/test/Index/complete-interfaces.m new file mode 100644 index 0000000..2f86c3d --- /dev/null +++ b/clang/test/Index/complete-interfaces.m @@ -0,0 +1,47 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ + +@class Int1, Int2, Int3, Int4; + +@interface Int3 +{ +} +@end + +@interface Int2 : Int3 +{ +} +@end + +@implementation Int2 +@end + +@implementation Int3 +@end + +// RUN: c-index-test -code-completion-at=%s:6:12 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int1} +// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int2} +// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int3} +// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int4} +// RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInterfaceDecl:{TypedText Int1} +// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int2} +// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int3} +// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int4} +// RUN: c-index-test -code-completion-at=%s:11:19 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInterfaceDecl:{TypedText Int1} +// CHECK-CC3-NEXT: ObjCInterfaceDecl:{TypedText Int3} +// CHECK-CC3-NEXT: ObjCInterfaceDecl:{TypedText Int4} +// RUN: c-index-test -code-completion-at=%s:16:17 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInterfaceDecl:{TypedText Int1} +// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int2} +// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int3} +// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int4} +// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: ObjCInterfaceDecl:{TypedText Int1} +// CHECK-CC5-NEXT: ObjCInterfaceDecl:{TypedText Int3} +// CHECK-CC5-NEXT: ObjCInterfaceDecl:{TypedText Int4} + + +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC2 %s diff --git a/clang/test/Index/complete-ivar-access.m b/clang/test/Index/complete-ivar-access.m new file mode 100644 index 0000000..13b43d8 --- /dev/null +++ b/clang/test/Index/complete-ivar-access.m @@ -0,0 +1,69 @@ +@interface Other { +@private + int other_private; +@protected + int other_protected; +@public + int other_public; +} +@end + +@interface Super { +@private + int super_private; +@protected + int super_protected; +@public + int super_public; +} +@end + +@interface Super () { +@private + int super_ext_private; +@protected + int super_ext_protected; +@public + int super_ext_public; +} +@end + +@interface Sub : Super { +@private + int sub_private; +@protected + int sub_protected; +@public + int sub_public; +} +@end + +@implementation Sub +- (void)method:(Sub *)sub with:(Other *)other { + sub->super_protected = 1; + other->other_public = 1; +} + +void f(Sub *sub, Other *other) { + sub->super_protected = 1; + other->other_public = 1; +} +@end + +// RUN: c-index-test -code-completion-at=%s:43:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s +// RUN: c-index-test -code-completion-at=%s:48:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_private} (35) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_protected} (35) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_public} (35) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_private} (35) (inaccessible) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_protected} (35) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_public} (35) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_private} (37) (inaccessible) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_protected} (37) +// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_public} (37) + +// RUN: c-index-test -code-completion-at=%s:44:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s +// RUN: c-index-test -code-completion-at=%s:49:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s +// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_private} (35) (inaccessible) +// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_protected} (35) (inaccessible) +// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_public} (35) diff --git a/clang/test/Index/complete-kvc.m b/clang/test/Index/complete-kvc.m new file mode 100644 index 0000000..62d98a9 --- /dev/null +++ b/clang/test/Index/complete-kvc.m @@ -0,0 +1,105 @@ +// Test for code completions related to Key-Value Coding and Key-Value Observing. +// Since this test is line- and column-sensitive, the run lines are at the end. + +typedef signed char BOOL; + +@interface NSSet +@end + +@interface NSMutableSet : NSSet +@end + +@interface MySet : NSMutableSet +@end + +@interface NSArray +@end + +@interface NSMutableArray : NSArray +@end + +@interface MyArray : NSMutableArray +@end + +@interface MyClass +@property int intProperty; +@property BOOL boolProperty; +@property int* intPointerProperty; + +@property NSSet *setProperty; +@property NSMutableSet *mutableSetProperty; +@property MySet *mySetProperty; + +@property NSArray *arrayProperty; +@property NSMutableArray *mutableArrayProperty; +@property MyArray *myArrayProperty; +@end + +@implementation MyClass +- (int)intProperty { return 0; } +- (void)setIntProperty:(int)newValue { } ++ (NSSet *)keyPathsForValuesAffectingIntProperty { return 0; } +@end + +@interface MySubClass : MyClass +@end + +@interface MySubClass () +@property int intProperty; +@end + +@implementation MySubClass +- (int)intProperty { return 0; } +@end + +// RUN: c-index-test -code-completion-at=%s:39:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText addMutableArrayPropertyObject:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText addMutableSetProperty:}{LeftParen (}{Text NSSet *}{RightParen )}{Text objects} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSArray *}{RightParen )}{TypedText arrayProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSArray *}{RightParen )}{TypedText arrayPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText boolProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSArray *}{RightParen )}{TypedText boolPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSUInteger}{RightParen )}{TypedText countOfArrayProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSUInteger}{RightParen )}{TypedText countOfBoolProperty} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSUInteger}{RightParen )}{TypedText countOfSetProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSEnumerator *}{RightParen )}{TypedText enumeratorOfMutableArrayProperty} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSEnumerator *}{RightParen )}{TypedText enumeratorOfMutableSetProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText getMyArrayProperty:}{LeftParen (}{Placeholder object-type}{Text **}{RightParen )}{Text buffer}{HorizontalSpace }{TypedText range:}{LeftParen (}{Text NSRange}{RightParen )}{Text inRange} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText getMySetProperty:}{LeftParen (}{Placeholder object-type}{Text **}{RightParen )}{Text buffer}{HorizontalSpace }{TypedText range:}{LeftParen (}{Text NSRange}{RightParen )}{Text inRange} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText insertIntProperty:}{LeftParen (}{Text NSArray *}{RightParen )}{Text array}{HorizontalSpace }{TypedText atIndexes:}{LeftParen (}{Placeholder NSIndexSet *}{RightParen )}{Text indexes} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText insertMutableArrayProperty:}{LeftParen (}{Text NSArray *}{RightParen )}{Text array}{HorizontalSpace }{TypedText atIndexes:}{LeftParen (}{Placeholder NSIndexSet *}{RightParen )}{Text indexes} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText insertObject:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object}{HorizontalSpace }{TypedText inMyArrayPropertyAtIndex:}{LeftParen (}{Placeholder NSUInteger}{RightParen )}{Text index} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText insertObject:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object}{HorizontalSpace }{TypedText inMySetPropertyAtIndex:}{LeftParen (}{Placeholder NSUInteger}{RightParen )}{Text index} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText intersectMySetProperty:}{LeftParen (}{Text NSSet *}{RightParen )}{Text objects} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText intersectSetProperty:}{LeftParen (}{Text NSSet *}{RightParen )}{Text objects} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text int *}{RightParen )}{TypedText intPointerProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText intProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText isBoolProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText isIntProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{TypedText memberOfMyArrayProperty:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{TypedText memberOfMySetProperty:}{LeftParen (}{Placeholder object-type}{Text *}{RightParen )}{Text object} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSMutableArray *}{RightParen )}{TypedText mutableArrayProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSMutableSet *}{RightParen )}{TypedText mutableSetProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSArray *}{RightParen )}{TypedText mutableSetPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text MyArray *}{RightParen )}{TypedText myArrayProperty} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text NSArray *}{RightParen )}{TypedText myArrayPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText objectInMutableSetPropertyAtIndex:}{LeftParen (}{Text NSUInteger}{RightParen )}{Text index} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText objectInMyArrayPropertyAtIndex:}{LeftParen (}{Text NSUInteger}{RightParen )}{Text index} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText removeMyArrayPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText removeMySetPropertyAtIndexes:}{LeftParen (}{Text NSIndexSet *}{RightParen )}{Text indexes} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText removeObjectFromIntPropertyAtIndex:}{LeftParen (}{Text NSUInteger}{RightParen )}{Text index} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText removeObjectFromMutableArrayPropertyAtIndex:}{LeftParen (}{Text NSUInteger}{RightParen )}{Text index} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText replaceMyArrayPropertyAtIndexes:}{LeftParen (}{Placeholder NSIndexSet *}{RightParen )}{Text indexes}{HorizontalSpace }{TypedText withMyArrayProperty:}{LeftParen (}{Text NSArray *}{RightParen )}{Text array} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText replaceMySetPropertyAtIndexes:}{LeftParen (}{Placeholder NSIndexSet *}{RightParen )}{Text indexes}{HorizontalSpace }{TypedText withMySetProperty:}{LeftParen (}{Text NSArray *}{RightParen )}{Text array} (55) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText replaceObjectInMyArrayPropertyAtIndex:}{LeftParen (}{Placeholder NSUInteger}{RightParen )}{Text index}{HorizontalSpace }{TypedText withObject:}{LeftParen (}{Text id}{RightParen )}{Text object} (40) +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText replaceObjectInMySetPropertyAtIndex:}{LeftParen (}{Placeholder NSUInteger}{RightParen )}{Text index}{HorizontalSpace }{TypedText withObject:}{LeftParen (}{Text id}{RightParen )}{Text object} (55) + +// RUN: c-index-test -code-completion-at=%s:41:3 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText automaticallyNotifiesObserversOfArrayProperty} (40) +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text BOOL}{RightParen )}{TypedText automaticallyNotifiesObserversOfMutableArrayProperty} (40) +// CHECK-CC2: ObjCClassMethodDecl:{LeftParen (}{Text NSSet *}{RightParen )}{TypedText keyPathsForValuesAffectingMutableArrayProperty} (40) + +// RUN: c-index-test -code-completion-at=%s:52:8 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText countOfIntProperty} (55) +// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText intProperty} (40) +// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText isIntProperty} (40) diff --git a/clang/test/Index/complete-lambdas.cpp b/clang/test/Index/complete-lambdas.cpp new file mode 100644 index 0000000..ba337e4 --- /dev/null +++ b/clang/test/Index/complete-lambdas.cpp @@ -0,0 +1,43 @@ +// This test is line- and column-sensitive. See below for run lines. + +int global; + +struct X { + static int member; + void f(int zed) { + int local; + static int local_static; + [=] { + int inner_local; + [local, this, inner_local] { + } + }(); + } +}; + + +// RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: VarDecl:{ResultType int}{TypedText inner_local} (34) +// CHECK-CC1-NEXT: VarDecl:{ResultType int}{TypedText local} (34) +// CHECK-CC1-NEXT: NotImplemented:{ResultType X *}{TypedText this} (40) +// CHECK-CC1-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34) + +// RUN: c-index-test -code-completion-at=%s:12:15 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: VarDecl:{ResultType int}{TypedText inner_local} (34) +// CHECK-CC2-NEXT: NotImplemented:{ResultType X *}{TypedText this} (40) +// CHECK-CC2-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34) + +// RUN: c-index-test -code-completion-at=%s:12:21 -std=c++11 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: VarDecl:{ResultType int}{TypedText inner_local} (34) +// CHECK-CC3-NEXT: ParmDecl:{ResultType int}{TypedText zed} (34) + +// RUN: c-index-test -code-completion-at=%s:12:8 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: TypedefDecl:{TypedText Class} (50) +// CHECK-CC4: TypedefDecl:{TypedText id} (50) +// CHECK-CC4: VarDecl:{ResultType int}{TypedText inner_local} (34) +// CHECK-CC4: VarDecl:{ResultType int}{TypedText local} (34) +// CHECK-CC4: NotImplemented:{ResultType X *}{TypedText this} (40) +// CHECK-CC4: ParmDecl:{ResultType int}{TypedText zed} (34) + +// RUN: c-index-test -code-completion-at=%s:12:15 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:12:21 -x objective-c++ -std=c++11 %s | FileCheck -check-prefix=CHECK-CC3 %s diff --git a/clang/test/Index/complete-macro-args.c b/clang/test/Index/complete-macro-args.c new file mode 100644 index 0000000..ca36af1 --- /dev/null +++ b/clang/test/Index/complete-macro-args.c @@ -0,0 +1,22 @@ +struct Point { + float x; + float y; + float z; +}; + +#define MACRO2(x) x +#define MACRO(x) MACRO2(x) + +void test(struct Point *p) { + p->x; + MACRO(p->x); +} + +// RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:12:12 %s | FileCheck %s +// CHECK: FieldDecl:{ResultType float}{TypedText x} (35) +// CHECK-NEXT: FieldDecl:{ResultType float}{TypedText y} (35) +// CHECK-NEXT: FieldDecl:{ResultType float}{TypedText z} (35) +// CHECK-NEXT: Completion contexts: +// CHECK-NEXT: Arrow member access +// CHECK-NEXT: Container Kind: StructDecl diff --git a/clang/test/Index/complete-macros.c b/clang/test/Index/complete-macros.c new file mode 100644 index 0000000..df798a8 --- /dev/null +++ b/clang/test/Index/complete-macros.c @@ -0,0 +1,43 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +#define FOO(Arg1,Arg2) foobar +#define nil 0 +void f() { + +} + +void g(int); + +void f2() { + int *ip = nil; + ip = nil; + g(nil); +} + +#define variadic1(...) +#define variadic2(args...) +#define variadic3(args, ...) +#define variadic4(first, second, args, ...) +#define variadic5(first, second, args ...) + +void test_variadic() { + +} + +// RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )} +// RUN: c-index-test -code-completion-at=%s:13:13 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: macro definition:{TypedText nil} (32) +// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: macro definition:{TypedText nil} (65) +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:25:2 %s | FileCheck -check-prefix=CHECK-VARIADIC %s +// CHECK-VARIADIC: macro definition:{TypedText variadic1}{LeftParen (}{Placeholder ...}{RightParen )} (70) +// CHECK-VARIADIC: macro definition:{TypedText variadic2}{LeftParen (}{Placeholder args...}{RightParen )} (70) +// CHECK-VARIADIC: macro definition:{TypedText variadic3}{LeftParen (}{Placeholder args, ...}{RightParen )} (70) +// CHECK-VARIADIC: macro definition:{TypedText variadic4}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second}{Comma , }{Placeholder args, ...}{RightParen )} (70) +// CHECK-VARIADIC: macro definition:{TypedText variadic5}{LeftParen (}{Placeholder first}{Comma , }{Placeholder second}{Comma , }{Placeholder args...}{RightParen )} (70) diff --git a/clang/test/Index/complete-member-access.m b/clang/test/Index/complete-member-access.m new file mode 100644 index 0000000..5e40be1 --- /dev/null +++ b/clang/test/Index/complete-member-access.m @@ -0,0 +1,77 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ + +@protocol MyProtocol +@property float ProtoProp; +@end + +@interface Super { + int SuperIVar; +} +@end +@interface Int : Super<MyProtocol> +{ + int IVar; +} + +@property int prop1; +@end + +void test_props(Int* ptr) { + ptr.prop1 = 0; + ptr->IVar = 0; +} + +@interface Sub : Int +@property int myProp; + +- (int)myProp; +- (int)myOtherPropLikeThing; +- (int)myOtherNonPropThing:(int)value; +@end + +int test_more_props(Sub *s) { + return s.myOtherPropLikeThing; +} + +@interface Other +@property Sub *sub; +@end + +int test_two_levels(Other *other) { + return other.sub.myProp; +} + +// RUN: c-index-test -code-completion-at=%s:21:7 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText prop1} +// CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} +// CHECK-CC1: Completion contexts: +// CHECK-CC1-NEXT: Objective-C property access +// CHECK-CC1-NEXT: Container Kind: ObjCInterfaceDecl +// CHECK-CC1-NEXT: Container is complete +// CHECK-CC1-NEXT: Container USR: c:objc(cs)Int +// RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText IVar} (35) +// CHECK-CC2: ObjCIvarDecl:{ResultType int}{TypedText SuperIVar} (37) +// CHECK-CC2: Completion contexts: +// CHECK-CC2-NEXT: Arrow member access +// CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl +// CHECK-CC2-NEXT: Container is complete +// CHECK-CC2-NEXT: Container USR: c:objc(cs)Int +// RUN: c-index-test -code-completion-at=%s:34:12 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText myOtherPropLikeThing} (37) +// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText myProp} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (35) +// CHECK-CC3: Completion contexts: +// CHECK-CC3-NEXT: Objective-C property access +// CHECK-CC3-NEXT: Container Kind: ObjCInterfaceDecl +// CHECK-CC3-NEXT: Container is complete +// CHECK-CC3-NEXT: Container USR: c:objc(cs)Sub + +// RUN: c-index-test -code-completion-at=%s:42:20 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText myOtherPropLikeThing} (37) +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText myProp} (35) +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText prop1} (35) +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText ProtoProp} (35) + diff --git a/clang/test/Index/complete-memfunc-cvquals.cpp b/clang/test/Index/complete-memfunc-cvquals.cpp new file mode 100644 index 0000000..9068ef8 --- /dev/null +++ b/clang/test/Index/complete-memfunc-cvquals.cpp @@ -0,0 +1,86 @@ +// The run lines are below, because this test is line- and +// column-number sensitive. +struct Foo { + void babble() const volatile; + void bar(); + void baz() const; + void bingo() volatile; + void theend() const volatile; +}; + +template<typename T> +struct smart_ptr { + T *operator->(); + const T* operator->() const; +}; + +void text(Foo f, Foo *fp, const Foo &fc, const Foo *fcp, + smart_ptr<Foo> sf, const smart_ptr<Foo> &sfc, Foo volatile *fvp) { + f.bar(); + fp->bar(); + fc.baz(); + fcp->baz(); + sf->bar(); + sfc->baz(); + fvp->babble(); +} + +void Foo::bar() { + +} + +void Foo::baz() const { + +} + +void Foo::bingo() volatile { + +} + +// Check member access expressions. +// RUN: c-index-test -code-completion-at=%s:19:5 %s | FileCheck -check-prefix=CHECK-NOQUALS %s +// RUN: c-index-test -code-completion-at=%s:20:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s +// RUN: c-index-test -code-completion-at=%s:23:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s +// CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34) +// CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35) +// CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35) +// RUN: c-index-test -code-completion-at=%s:21:6 %s | FileCheck -check-prefix=CHECK-CONST %s +// RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CONST %s +// RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CONST %s +// CHECK-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-CONST-NOT: bar +// CHECK-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34) +// CHECK-CONST-NOT: bingo +// CHECK-CONST: theend +// RUN: c-index-test -code-completion-at=%s:25:8 %s | FileCheck -check-prefix=CHECK-VOLATILE %s +// CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-VOLATILE-NOT: baz +// CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34) + +// Check implicit member access expressions. +// RUN: c-index-test -code-completion-at=%s:29:2 %s | FileCheck -check-prefix=CHECK-IMPLICIT-NOQUALS %s +// CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34) +// CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35) +// CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35) + +// RUN: c-index-test -code-completion-at=%s:33:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-CONST %s +// CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-IMPLICIT-CONST-NOT: bar +// CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34) +// CHECK-IMPLICIT-CONST-NOT: bingo +// CHECK-IMPLICIT-CONST: theend + +// RUN: c-index-test -code-completion-at=%s:37:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-VOLATILE %s +// CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35) +// CHECK-IMPLICIT-VOLATILE-NOT: baz +// CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34) + +// RUN: c-index-test -code-completion-at=%s:4:17 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER %s +// CHECK-CVQUAL-AFTER: NotImplemented:{TypedText const} (40) +// CHECK-CVQUAL-AFTER: NotImplemented:{TypedText volatile} (40) + +// RUN: c-index-test -code-completion-at=%s:4:23 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER2 %s +// CHECK-CVQUAL-AFTER2-NOT: NotImplemented:{TypedText const} (40) +// CHECK-CVQUAL-AFTER2: NotImplemented:{TypedText volatile} (40) diff --git a/clang/test/Index/complete-method-decls.m b/clang/test/Index/complete-method-decls.m new file mode 100644 index 0000000..becb7de --- /dev/null +++ b/clang/test/Index/complete-method-decls.m @@ -0,0 +1,184 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ +#define IBAction void +@protocol P1 +- (id)abc; +- (id)initWithInt:(int)x; +- (id)initWithTwoInts:(inout int)x second:(int)y; +- (int)getInt; +- (id)getSelf; +@end + +@protocol P2<P1> ++ (id)alloc; +@end + +@interface A <P1> +- (id)init; +- (int)getValue; +@end + +@interface B : A<P2> +- (id)initWithInt:(int)x; +- (int)getSecondValue; +- (id)getSelf; +- (int)setValue:(int)x; +@end + +@interface B (FooBar) +- (id)categoryFunction:(int)x; +@end + +@implementation B +- (int)getSecondValue { return 0; } +- (id)init { return self; } +- (id)getSelf { return self; } +- (void)setValue:(int)x { } +- (id)initWithTwoInts:(int)x second:(int)y { return self; } ++ (id)alloc { return 0; } +@end + +@implementation B (FooBar) +- (id)categoryFunction:(int)x { return self; } +@end + +@interface C +- (int)first:(int)x second:(float)y third:(double)z; +- (id)first:(int)xx second2:(float)y2 third:(double)z; +- (void*)first:(int)xxx second3:(float)y3 third:(double)z; +@end + +@interface D +- (int)first:(int)x second2:(float)y third:(double)z; +@end + +@implementation D +- (int)first:(int)x second2:(float)y third:(double)z { } +@end + +@interface Passing +- (oneway void)method:(in id)x; +@end + +@interface Gaps +- (void)method:(int)x :(int)y; +@end + +@implementation Gaps +- (void)method:(int)x :(int)y {} +@end + +@implementation Passing +- (oneway void)method:(in id x) {} +@end + +// RUN: c-index-test -code-completion-at=%s:17:3 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc} (40) (parent: ObjCProtocolDecl 'P1') +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getInt} (40) (parent: ObjCProtocolDecl 'P1') +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf} (40) (parent: ObjCProtocolDecl 'P1') +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x} (40) (parent: ObjCProtocolDecl 'P1') +// CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y} (40) (parent: ObjCProtocolDecl 'P1') +// RUN: c-index-test -code-completion-at=%s:17:7 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText abc} +// CHECK-CC2-NEXT: ObjCInstanceMethodDecl:{TypedText getSelf} +// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x} +// CHECK-CC2: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y} +// RUN: c-index-test -code-completion-at=%s:24:7 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText abc} +// CHECK-CC3-NEXT: ObjCInstanceMethodDecl:{TypedText getSelf} +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText init} +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x} +// CHECK-CC3: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y} +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:33:3 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (42) +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getInt}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getSecondValue}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (40) +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC4: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText setValue}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:33:8 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText getInt}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (42) (parent: ObjCProtocolDecl 'P1') +// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText getSecondValue}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (40) (parent: ObjCInterfaceDecl 'B') +// CHECK-CC5-NOT: {TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC5: ObjCInstanceMethodDecl:{TypedText setValue}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:37:7 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText abc}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (40) +// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText initWithInt}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC6: ObjCInstanceMethodDecl:{TypedText initWithTwoInts}{TypedText :}{LeftParen (}{Text inout }{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second:}{LeftParen (}{Text int}{RightParen )}{Text y}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:42:3 %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (42) +// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText categoryFunction}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{LeftBrace {}{VerticalSpace +// CHECK-CC7: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText getSelf}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Text return}{HorizontalSpace }{Placeholder expression}{SemiColon ;}{VerticalSpace }{RightBrace }} (42) +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:21 %s | FileCheck -check-prefix=CHECK-CC8 %s +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{TypedText second2:}{Text (float)y2}{HorizontalSpace }{TypedText third:}{Text (double)z} (35) +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType void *}{Informative first:}{TypedText second3:}{Text (float)y3}{HorizontalSpace }{TypedText third:}{Text (double)z} (35) +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second:}{Text (float)y}{HorizontalSpace }{TypedText third:}{Text (double)z} (8) +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:19 %s | FileCheck -check-prefix=CHECK-CC9 %s +// CHECK-CC9: NotImplemented:{TypedText x} (40) +// CHECK-CC9: NotImplemented:{TypedText xx} (40) +// CHECK-CC9: NotImplemented:{TypedText xxx} (40) +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:52:36 %s | FileCheck -check-prefix=CHECK-CCA %s +// CHECK-CCA: NotImplemented:{TypedText y2} (40) +// RUN: c-index-test -code-completion-at=%s:56:3 %s | FileCheck -check-prefix=CHECK-CCB %s +// CHECK-CCB: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText first}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second2:}{LeftParen (}{Text float}{RightParen )}{Text y}{HorizontalSpace }{TypedText third:}{LeftParen (}{Text double}{RightParen )}{Text z} (40) +// RUN: c-index-test -code-completion-at=%s:56:8 %s | FileCheck -check-prefix=CHECK-CCC %s +// CHECK-CCC: ObjCInstanceMethodDecl:{TypedText first}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText second2:}{LeftParen (}{Text float}{RightParen )}{Text y}{HorizontalSpace }{TypedText third:}{LeftParen (}{Text double}{RightParen )}{Text z} (40) +// RUN: c-index-test -code-completion-at=%s:56:21 %s | FileCheck -check-prefix=CHECK-CCD %s +// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{TypedText second2:}{Text (float)y2}{HorizontalSpace }{TypedText third:}{Text (double)z} (35) +// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second2:}{Text (float)y}{HorizontalSpace }{TypedText third:}{Text (double)z} (8) +// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType void *}{Informative first:}{TypedText second3:}{Text (float)y3}{HorizontalSpace }{TypedText third:}{Text (double)z} (35) +// CHECK-CCD: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{TypedText second:}{Text (float)y}{HorizontalSpace }{TypedText third:}{Text (double)z} (8) +// RUN: c-index-test -code-completion-at=%s:56:38 %s | FileCheck -check-prefix=CHECK-CCE %s +// CHECK-CCE: ObjCInstanceMethodDecl:{ResultType id}{Informative first:}{Informative second2:}{TypedText third:}{Text (double)z} (35) +// CHECK-CCE: ObjCInstanceMethodDecl:{ResultType int}{Informative first:}{Informative second2:}{TypedText third:}{Text (double)z} (8) +// RUN: c-index-test -code-completion-at=%s:60:4 %s | FileCheck -check-prefix=CHECK-CCF %s +// CHECK-CCF: ObjCInterfaceDecl:{TypedText A} (50) +// CHECK-CCF: ObjCInterfaceDecl:{TypedText B} (50) +// CHECK-CCF: NotImplemented:{TypedText bycopy} (40) +// CHECK-CCF: NotImplemented:{TypedText byref} (40) +// CHECK-CCF: NotImplemented:{TypedText in} (40) +// CHECK-CCF: NotImplemented:{TypedText inout} (40) +// CHECK-CCF: NotImplemented:{TypedText oneway} (40) +// CHECK-CCF: NotImplemented:{TypedText out} (40) +// CHECK-CCF: NotImplemented:{TypedText unsigned} (50) +// CHECK-CCF: NotImplemented:{TypedText void} (50) +// CHECK-CCF: NotImplemented:{TypedText volatile} (50) +// RUN: c-index-test -code-completion-at=%s:60:11 %s | FileCheck -check-prefix=CHECK-CCG %s +// CHECK-CCG: ObjCInterfaceDecl:{TypedText A} (50) +// CHECK-CCG: ObjCInterfaceDecl:{TypedText B} (50) +// CHECK-CCG-NOT: NotImplemented:{TypedText bycopy} (40) +// CHECK-CCG-NOT: NotImplemented:{TypedText byref} (40) +// CHECK-CCG: NotImplemented:{TypedText in} (40) +// CHECK-CCG: NotImplemented:{TypedText inout} (40) +// CHECK-CCG-NOT: NotImplemented:{TypedText oneway} (40) +// CHECK-CCG: NotImplemented:{TypedText out} (40) +// CHECK-CCG: NotImplemented:{TypedText unsigned} (50) +// CHECK-CCG: NotImplemented:{TypedText void} (50) +// CHECK-CCG: NotImplemented:{TypedText volatile} (50) +// RUN: c-index-test -code-completion-at=%s:60:24 %s | FileCheck -check-prefix=CHECK-CCF %s +// RUN: c-index-test -code-completion-at=%s:60:26 %s | FileCheck -check-prefix=CHECK-CCH %s +// CHECK-CCH: ObjCInterfaceDecl:{TypedText A} (50) +// CHECK-CCH: ObjCInterfaceDecl:{TypedText B} (50) +// CHECK-CCH: NotImplemented:{TypedText bycopy} (40) +// CHECK-CCH: NotImplemented:{TypedText byref} (40) +// CHECK-CCH-NOT: NotImplemented:{TypedText in} (40) +// CHECK-CCH: NotImplemented:{TypedText inout} (40) +// CHECK-CCH: NotImplemented:{TypedText oneway} (40) +// CHECK-CCH: NotImplemented:{TypedText out} (40) +// CHECK-CCH: NotImplemented:{TypedText unsigned} (50) +// CHECK-CCH: NotImplemented:{TypedText void} (50) +// CHECK-CCH: NotImplemented:{TypedText volatile} (50) + +// IBAction completion +// RUN: c-index-test -code-completion-at=%s:5:4 %s | FileCheck -check-prefix=CHECK-IBACTION %s +// CHECK-IBACTION: NotImplemented:{TypedText IBAction}{RightParen )}{Placeholder selector}{Colon :}{LeftParen (}{Text id}{RightParen )}{Text sender} (40) + +// <rdar://problem/8939352> +// RUN: c-index-test -code-completion-at=%s:68:9 %s | FileCheck -check-prefix=CHECK-8939352 %s +// CHECK-8939352: ObjCInstanceMethodDecl:{TypedText method}{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text x}{HorizontalSpace }{TypedText :}{LeftParen (}{Text int}{RightParen )}{Text y} (40) + + +// RUN: c-index-test -code-completion-at=%s:72:2 %s | FileCheck -check-prefix=CHECK-ONEWAY %s +// CHECK-ONEWAY: ObjCInstanceMethodDecl:{LeftParen (}{Text oneway }{Text void}{RightParen )}{TypedText method}{TypedText :}{LeftParen (}{Text in }{Text id}{RightParen )}{Text x} (40) (parent: ObjCInterfaceDecl 'Passing') diff --git a/clang/test/Index/complete-modules.m b/clang/test/Index/complete-modules.m new file mode 100644 index 0000000..b82430d --- /dev/null +++ b/clang/test/Index/complete-modules.m @@ -0,0 +1,14 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +@__experimental_modules_import LibA.Extensions; + +// RUN: rm -rf %t +// RUN: c-index-test -code-completion-at=%s:4:32 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-TOP-LEVEL %s +// CHECK-TOP-LEVEL: NotImplemented:{TypedText Framework} (50) +// CHECK-TOP-LEVEL: NotImplemented:{TypedText LibA} (50) +// CHECK-TOP-LEVEL: NotImplemented:{TypedText nested} (50) + +// RUN: c-index-test -code-completion-at=%s:4:37 -fmodule-cache-path %t -fmodules -F %S/Inputs/Frameworks -I %S/Inputs/Headers %s | FileCheck -check-prefix=CHECK-LIBA %s +// CHECK-LIBA: NotImplemented:{TypedText Extensions} (50) + diff --git a/clang/test/Index/complete-natural.m b/clang/test/Index/complete-natural.m new file mode 100644 index 0000000..326b8a7 --- /dev/null +++ b/clang/test/Index/complete-natural.m @@ -0,0 +1,57 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +const char *in_string = "string"; +char in_char = 'a'; +// in comment +/* in comment */ +#warning blarg +#error blarg +#pragma mark this is the spot +// RUN: c-index-test -code-completion-at=%s:4:32 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// CHECK-CC1: Completion contexts: +// CHECK-CC1-NEXT: Natural language +// CHECK-CC1-NEXT: DONE +// RUN: c-index-test -code-completion-at=%s:5:18 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:6:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:7:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:8:10 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:9:9 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: c-index-test -code-completion-at=%s:10:19 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t + +// Same tests as above, but with completion caching. +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:4:32 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:5:18 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:6:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:7 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:8:10 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:9 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:10:19 %s > %t +// RUN: echo "DONE" >> %t +// RUN: FileCheck -check-prefix=CHECK-CC1 %s < %t diff --git a/clang/test/Index/complete-objc-message-id.m b/clang/test/Index/complete-objc-message-id.m new file mode 100644 index 0000000..415e0ff --- /dev/null +++ b/clang/test/Index/complete-objc-message-id.m @@ -0,0 +1,74 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +@interface A ++ (id)alloc; ++ (id)init; ++ (id)new; ++ (Class)class; ++ (Class)superclass; +- (id)retain; +- (id)autorelease; +- (id)superclass; +@end + +@interface B : A +- (int)B_method; +@end + +@interface Unrelated ++ (id)icky; +@end + +void message_id(B *b) { + [[A alloc] init]; + [[b retain] B_method]; + [[b superclass] B_method]; +} + +@implementation Unrelated ++ (id)alloc { + return [A alloc]; +} +@end + +@protocol P1 +- (int)P1_method1; ++ (int)P1_method2; +@end + +@protocol P2 <P1> +- (int)P2_method1; ++ (int)P2_method2; +@end + +void message_qualified_id(id<P2> ip2) { + [ip2 P1_method]; + ip2 P1_method]; +} + +// RUN: c-index-test -code-completion-at=%s:24:14 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease} +// CHECK-CC1-NOT: B_method +// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain} +// RUN: c-index-test -code-completion-at=%s:25:15 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease} +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText B_method} +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain} +// RUN: c-index-test -code-completion-at=%s:26:19 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText autorelease} +// CHECK-CC3-NOT: B_method +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType id}{TypedText retain} + + +// RUN: c-index-test -code-completion-at=%s:31:13 %s | FileCheck -check-prefix=CHECK-SELECTOR-PREF %s +// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText alloc} (32) +// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText class} (35) +// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText init} (35) +// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType id}{TypedText new} (35) +// CHECK-SELECTOR-PREF: ObjCClassMethodDecl:{ResultType Class}{TypedText superclass} (35) + +// RUN: c-index-test -code-completion-at=%s:46:7 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s +// RUN: c-index-test -code-completion-at=%s:47:7 %s | FileCheck -check-prefix=CHECK-INSTANCE-QUAL-ID %s +// CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P1_method1} (37) +// CHECK-INSTANCE-QUAL-ID: ObjCInstanceMethodDecl:{ResultType int}{TypedText P2_method1} (35) diff --git a/clang/test/Index/complete-objc-message.m b/clang/test/Index/complete-objc-message.m new file mode 100644 index 0000000..1835c3e --- /dev/null +++ b/clang/test/Index/complete-objc-message.m @@ -0,0 +1,336 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. +#define nil (void*)0 +@protocol FooTestProtocol ++ protocolClassMethod; +- protocolInstanceMethod : (int)value; +@end +@interface Foo <FooTestProtocol> { + void *isa; +} ++ (int)classMethod1:a withKeyword:(int)b; ++ (void)classMethod2; ++ new; +- instanceMethod1; +@end + +@interface Foo (FooTestCategory) ++ categoryClassMethod; +- categoryInstanceMethod; +@end + +void func() { + Foo *obj = [Foo new]; + [obj xx]; +} + +@interface MyClass { } ++ (int)MyClassMethod:(id)obj; +- (int)MyInstMethod:(id)x second:(id)y; +@end + +@interface MySubClass : MyClass { } ++ (int)MySubClassMethod; +- (int)MySubInstMethod; +@end + +@implementation MyClass ++ (int)MyClassMethod:(id)obj { + return 0; +} + ++ (int)MyPrivateMethod { + return 1; +} + +- (int)MyInstMethod:(id)x second:(id)y { + return 2; +} + +- (int)MyPrivateInstMethod { + return 3; +} +@end +MyClass *getMyClass(); +@implementation MySubClass ++ (int)MySubClassMethod { + return 2; +} + ++ (int)MySubPrivateMethod { + return [super MyPrivateMethod]; +} + +- (int)MySubInstMethod:(id)obj { + return [super MyInstMethod: obj second:obj]; +} + +- (int)MyInstMethod:(id)x second:(id)y { + return 3; +} +@end + +void test_super_var(MySubClass *super) { + [super MyInstMethod: super second:super]; +} + +@protocol FooTestProtocol2 +- (int)secondProtocolInstanceMethod; +@end + +void test_qual_id(id<FooTestProtocol,FooTestProtocol2> ptr) { + [ptr protocolInstanceMethod:1]; +} + +@interface Overload +- (int)Method:(int)i; +- (int)Method; +- (int)Method:(float)f Arg1:(int)i1 Arg2:(int)i2; +- (int)Method:(float)f Arg1:(int)i1 OtherArg:(id)obj; +- (int)Method:(float)f SomeArg:(int)i1 OtherArg:(id)obj; +- (int)OtherMethod:(float)f Arg1:(int)i1 Arg2:(int)i2; +@end + +void test_overload(Overload *ovl) { + [ovl Method:1 Arg1:1 OtherArg:ovl]; +} + +@interface Ellipsis +- (int)Method:(int)i, ...; +- (int)SentinelMethod:(int)i, ... __attribute__((sentinel(0,1))); +@end +void f(Ellipsis *e) { + [e Method:1, 2, 3]; +} + +@interface Overload2 ++ (int)Method:(int)i; ++ (int)Method; ++ (int)Method:(float)f Arg1:(int)i1 Arg2:(int)i2; ++ (int)Method:(float)f Arg1:(int)i1 OtherArg:(id)obj; ++ (int)Method:(float)f SomeArg:(int)i1 OtherArg:(id)obj; ++ (int)OtherMethod:(float)f Arg1:(int)i1 Arg2:(int)i2; +@end + +void test_overload2(void) { + [Overload2 Method:1 Arg1:1 OtherArg:ovl]; +} + +void msg_id(id x) { + [x Method:1 Arg1:1 OtherArg:ovl]; + [[x blarg] Method:1 Arg1:1 OtherArg:ovl]; + [id Method:1 Arg1:1 OtherArg:ovl]; +} + +@interface A +- (void)method1; +@end + +@interface B : A +- (void)method2; +@end + +void test_ranking(B *b) { + [b method1]; + b method1]; +} + +void test_overload3(Overload *ovl) { + ovl Method:1 Arg1:1 OtherArg:ovl]; + Overload2 Method:1 Arg1:1 OtherArg:ovl]; + (Overload2 Method:1 Arg1:1 OtherArg:ovl]); +} + +@interface C : B +- (void)method2; +- (void)method3; +@end + +void test_redundancy(C *c) { + [c method2]; +}; + +@protocol P +- (Class)class; +@end + +@interface A () <P> +@end + +@interface A () ++ (void)class_method3; +@end + +@interface A (Cat) ++ (void)class_method4; +@end + +@implementation A +- (void)method5:(A*)a { + [[self class] class_method4]; +} +@end + +void test_missing_open_more() { + A *a = A class_method3]; +} + +void test_block_invoke(A *(^block1)(int), + int (^block2)(int), + id (^block3)(int)) { + [block1(5) init]; +} + +@interface DO +- (void)method:(in bycopy A*)ain result:(out byref A**)aout; +@end + +void test_DO(DO *d, A* a) { + [d method:a aout:&a]; +} + +// RUN: c-index-test -code-completion-at=%s:23:19 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: {TypedText categoryClassMethod} (35) (parent: ObjCCategoryDecl 'Foo(FooTestCategory)') +// CHECK-CC1: {TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} (35) (parent: ObjCInterfaceDecl 'Foo') +// CHECK-CC1: {TypedText classMethod2} (35) (parent: ObjCInterfaceDecl 'Foo') +// CHECK-CC1: {TypedText new} (35) (parent: ObjCInterfaceDecl 'Foo') +// CHECK-CC1: {TypedText protocolClassMethod} (37) (parent: ObjCProtocolDecl 'FooTestProtocol') +// CHECK-CC1: Completion contexts: +// CHECK-CC1-NEXT: Objective-C class method +// CHECK-CC1-NEXT: Container Kind: ObjCInterfaceDecl +// CHECK-CC1-NEXT: Container is complete +// CHECK-CC1-NEXT: Container USR: c:objc(cs)Foo +// RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: {TypedText categoryInstanceMethod} +// CHECK-CC2: {TypedText instanceMethod1} +// CHECK-CC2: {TypedText protocolInstanceMethod:}{Placeholder (int)} +// CHECK-CC2: Completion contexts: +// CHECK-CC2-NEXT: Objective-C instance method +// CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl +// CHECK-CC2-NEXT: Container is complete +// CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo +// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)} +// CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod} +// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod} +// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} +// CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod} +// RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInstanceMethodDecl:{ResultType id}{TypedText protocolInstanceMethod:}{Placeholder (int)} +// CHECK-CC6: ObjCInstanceMethodDecl:{ResultType int}{TypedText secondProtocolInstanceMethod} +// RUN: c-index-test -code-completion-at=%s:95:8 %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method} +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// RUN: c-index-test -code-completion-at=%s:95:17 %s | FileCheck -check-prefix=CHECK-CC8 %s +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CC8-NOT: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText } +// RUN: c-index-test -code-completion-at=%s:95:24 %s | FileCheck -check-prefix=CHECK-CC9 %s +// CHECK-CC9: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText Arg2:}{Placeholder (int)} +// CHECK-CC9: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CC9: Objective-C selector: Method:Arg1: +// RUN: c-index-test -code-completion-at=%s:61:11 %s | FileCheck -check-prefix=CHECK-CCA %s +// CHECK-CCA: TypedefDecl:{TypedText Class} +// CHECK-CCA-NEXT: ObjCInterfaceDecl:{TypedText Foo} +// CHECK-CCA-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} +// CHECK-CCA:FunctionDecl:{ResultType MyClass *}{TypedText getMyClass}{LeftParen (}{RightParen )} +// CHECK-CCA: TypedefDecl:{TypedText id} +// CHECK-CCA: ObjCInterfaceDecl:{TypedText MyClass} +// CHECK-CCA: ObjCInterfaceDecl:{TypedText MySubClass} +// CHECK-CCA: {ResultType Class}{TypedText self} +// CHECK-CCA: {TypedText super} +// RUN: c-index-test -code-completion-at=%s:103:6 %s | FileCheck -check-prefix=CHECK-CCB %s +// CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int), ...} +// CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText SentinelMethod:}{Placeholder (int), ...}{Text , nil} +// RUN: c-index-test -code-completion-at=%s:116:14 %s | FileCheck -check-prefix=CHECK-CCC %s +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method} +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// RUN: c-index-test -code-completion-at=%s:116:23 %s | FileCheck -check-prefix=CHECK-CCD %s +// CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} +// CHECK-CCD-NOT: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText } +// CHECK-CCD: Objective-C selector: Method: +// RUN: c-index-test -code-completion-at=%s:116:30 %s | FileCheck -check-prefix=CHECK-CCE %s +// CHECK-CCE: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText Arg2:}{Placeholder (int)} +// CHECK-CCE: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText OtherArg:}{Placeholder (id)} +// RUN: c-index-test -code-completion-at=%s:61:11 %s | FileCheck -check-prefix=CHECK-CCF %s +// CHECK-CCF: TypedefDecl:{TypedText Class} +// CHECK-CCF: ObjCInterfaceDecl:{TypedText Foo} +// CHECK-CCF-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} +// CHECK-CCF: TypedefDecl:{TypedText id} +// CHECK-CCF: ObjCInterfaceDecl:{TypedText MyClass} +// CHECK-CCF: ObjCInterfaceDecl:{TypedText MySubClass} +// CHECK-CCF: {ResultType Class}{TypedText self} +// CHECK-CCF: {TypedText super} +// RUN: c-index-test -code-completion-at=%s:120:6 %s | FileCheck -check-prefix=CHECK-CCG %s +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText categoryInstanceMethod} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText instanceMethod1} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText protocolInstanceMethod:}{Placeholder (int)} +// CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText secondProtocolInstanceMethod} +// RUN: c-index-test -code-completion-at=%s:121:14 %s | FileCheck -check-prefix=CHECK-CCG %s +// RUN: c-index-test -code-completion-at=%s:122:7 %s | FileCheck -check-prefix=CHECK-CCH %s +// CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText categoryClassMethod} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType void}{TypedText classMethod2} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText Method} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MySubClassMethod} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MySubPrivateMethod} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText new} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} +// CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText protocolClassMethod} +// RUN: c-index-test -code-completion-at=%s:134:6 %s | FileCheck -check-prefix=CHECK-CCI %s +// CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method1} (37) +// CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} (35) + +// RUN: c-index-test -code-completion-at=%s:150:5 %s | FileCheck -check-prefix=CHECK-REDUNDANT %s +// CHECK-REDUNDANT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} (35) +// CHECK-REDUNDANT-NOT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} +// CHECK-REDUNDANT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method3} (35) + +// RUN: c-index-test -code-completion-at=%s:170:16 %s | FileCheck -check-prefix=CHECK-CLASS-RESULT %s +// CHECK-CLASS-RESULT: ObjCClassMethodDecl:{ResultType void}{TypedText class_method3} (35) +// CHECK-CLASS-RESULT: ObjCClassMethodDecl:{ResultType void}{TypedText class_method4} (35) (parent: ObjCCategoryDecl 'A(Cat)') + +// RUN: c-index-test -code-completion-at=%s:181:4 %s | FileCheck -check-prefix=CHECK-BLOCK-RECEIVER %s +// CHECK-BLOCK-RECEIVER: ObjCInterfaceDecl:{TypedText A} (50) +// CHECK-BLOCK-RECEIVER: ObjCInterfaceDecl:{TypedText B} (50) +// CHECK-BLOCK-RECEIVER: ParmDecl:{ResultType A *(^)(int)}{TypedText block1} (34) +// CHECK-BLOCK-RECEIVER-NEXT: ParmDecl:{ResultType id (^)(int)}{TypedText block3} (34) + +// Test code completion with a missing opening bracket: +// RUN: c-index-test -code-completion-at=%s:135:5 %s | FileCheck -check-prefix=CHECK-CCI %s +// RUN: c-index-test -code-completion-at=%s:139:7 %s | FileCheck -check-prefix=CHECK-CC7 %s +// RUN: c-index-test -code-completion-at=%s:139:16 %s | FileCheck -check-prefix=CHECK-CC8 %s +// RUN: c-index-test -code-completion-at=%s:139:23 %s | FileCheck -check-prefix=CHECK-CC9 %s + +// RUN: c-index-test -code-completion-at=%s:140:14 %s | FileCheck -check-prefix=CHECK-CCC %s +// RUN: c-index-test -code-completion-at=%s:140:23 %s | FileCheck -check-prefix=CHECK-CCD %s +// RUN: c-index-test -code-completion-at=%s:140:30 %s | FileCheck -check-prefix=CHECK-CCE %s +// RUN: c-index-test -code-completion-at=%s:141:14 %s | FileCheck -check-prefix=CHECK-CCC %s +// RUN: c-index-test -code-completion-at=%s:141:23 %s | FileCheck -check-prefix=CHECK-CCD %s +// RUN: c-index-test -code-completion-at=%s:141:30 %s | FileCheck -check-prefix=CHECK-CCE %s + +// RUN: c-index-test -code-completion-at=%s:175:12 %s | FileCheck -check-prefix=CHECK-CLASS-RESULT %s + +// RUN: c-index-test -code-completion-at=%s:189:6 %s | FileCheck -check-prefix=CHECK-DISTRIB-OBJECTS %s +// CHECK-DISTRIB-OBJECTS: ObjCInstanceMethodDecl:{ResultType void}{TypedText method:}{Placeholder (in bycopy A *)}{HorizontalSpace }{TypedText result:}{Placeholder (out byref A **)} (35) diff --git a/clang/test/Index/complete-pch.m b/clang/test/Index/complete-pch.m new file mode 100644 index 0000000..517d49c --- /dev/null +++ b/clang/test/Index/complete-pch.m @@ -0,0 +1,26 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +@interface C +- (int)instanceMethod3:(int)x; ++ (int)classMethod3:(float)f; +@end + +void msg_id(id x) { + [id classMethod1:1.0]; + [x instanceMethod1:5]; +} + +// Build the precompiled header +// RUN: %clang -x objective-c-header -o %t.h.pch %S/Inputs/complete-pch.h + +// Run the actual tests +// RUN: c-index-test -code-completion-at=%s:10:7 -include %t.h %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCClassMethodDecl:{ResultType int}{TypedText classMethod1:}{Placeholder (double)} +// CHECK-CC1: ObjCClassMethodDecl:{ResultType int}{TypedText classMethod2:}{Placeholder (float)} +// CHECK-CC1: ObjCClassMethodDecl:{ResultType int}{TypedText classMethod3:}{Placeholder (float)} + +// RUN: c-index-test -code-completion-at=%s:11:6 -include %t.h %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText instanceMethod1:}{Placeholder (int)} +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText instanceMethod2:}{Placeholder (int)} +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText instanceMethod3:}{Placeholder (int)} diff --git a/clang/test/Index/complete-preprocessor.m b/clang/test/Index/complete-preprocessor.m new file mode 100644 index 0000000..bea9d32 --- /dev/null +++ b/clang/test/Index/complete-preprocessor.m @@ -0,0 +1,80 @@ +// The line and column layout of this test is significant. Run lines +// are at the end. + +#if 1 +#endif + +#define FOO(a, b) a##b +#define BAR +#ifdef FOO +#endif +#if defined(FOO) +#endif + +FOO(in,t) value; + +// RUN: c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC1-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (40) +// RUN: c-index-test -code-completion-at=%s:5:2 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro}{LeftParen (}{Placeholder args}{RightParen )} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText elif}{HorizontalSpace }{Placeholder condition} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText else} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText endif} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText error}{HorizontalSpace }{Placeholder message} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText if}{HorizontalSpace }{Placeholder condition} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText ifdef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText ifndef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText import}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text "}{Placeholder header}{Text "} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText include_next}{HorizontalSpace }{Text <}{Placeholder header}{Text >} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText line}{HorizontalSpace }{Placeholder number}{HorizontalSpace }{Text "}{Placeholder filename}{Text "} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (40) +// CHECK-CC2-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (40) +// RUN: c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{TypedText BAR} (40) +// CHECK-CC3: NotImplemented:{TypedText FOO} (40) +// RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:11:13 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:11:5 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: macro definition:{TypedText BAR} (70) +// CHECK-CC4: macro definition:{TypedText FOO}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (70) +// RUN: c-index-test -code-completion-at=%s:14:5 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: NotImplemented:{TypedText const} (50) +// CHECK-CC5: NotImplemented:{TypedText double} (50) +// CHECK-CC5: NotImplemented:{TypedText enum} (50) +// CHECK-CC5: NotImplemented:{TypedText extern} (40) +// CHECK-CC5: NotImplemented:{TypedText float} (50) +// CHECK-CC5: macro definition:{TypedText FOO}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (70) +// CHECK-CC5: TypedefDecl:{TypedText id} (50) +// CHECK-CC5: NotImplemented:{TypedText inline} (40) +// CHECK-CC5: NotImplemented:{TypedText int} (50) +// CHECK-CC5: NotImplemented:{TypedText long} (50) + +// Same tests as above, but with completion caching. +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:5:2 %s | FileCheck -check-prefix=CHECK-CC2 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:11:5 %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:5 %s | FileCheck -check-prefix=CHECK-CC5 %s diff --git a/clang/test/Index/complete-properties.m b/clang/test/Index/complete-properties.m new file mode 100644 index 0000000..ce1870e --- /dev/null +++ b/clang/test/Index/complete-properties.m @@ -0,0 +1,82 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ +@class MyClass; +@interface I1 +{ + id StoredProp3; + int RandomIVar; +} +@property int Prop0; +@property int Prop1; +@property float Prop2; +@end + +@interface I2 : I1 +@property id Prop3; +@property id Prop4; +@end + +@implementation I2 +@synthesize Prop2, Prop1, Prop3 = StoredProp3; +@dynamic Prop4; +@end + +@interface I3 : I2 +@property id Prop3; +@end + +id test(I3 *i3) { + return i3.Prop3; +} + +@interface I4 +@property id Prop2; +@end + +@interface I4 () { + I4 *Prop1; +} +@end + +@implementation I4 { + id Prop2_; +} + +@synthesize Prop2 = Prop2_; +@end + +// RUN: c-index-test -code-completion-at=%s:20:13 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} +// CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} +// CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} +// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} +// CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} +// RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} +// CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} +// CHECK-CC2-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} +// CHECK-CC2: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} +// RUN: c-index-test -code-completion-at=%s:20:35 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText _Prop3} (36) +// CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText RandomIVar} (35) +// CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText StoredProp3} (8) + +// RUN: c-index-test -code-completion-at=%s:21:10 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} +// CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} + +// RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s +// CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (35) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (35) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (35) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35) +// CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35) + +// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50) + + +// RUN: c-index-test -code-completion-at=%s:45:21 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7-NOT: ObjCIvarDecl:{ResultType id}{TypedText _Prop2} +// CHECK-CC7: ObjCIvarDecl:{ResultType I4 *}{TypedText Prop1} (17) +// CHECK-CC7: ObjCIvarDecl:{ResultType id}{TypedText Prop2_} (7) diff --git a/clang/test/Index/complete-property-flags.m b/clang/test/Index/complete-property-flags.m new file mode 100644 index 0000000..f2e08c3 --- /dev/null +++ b/clang/test/Index/complete-property-flags.m @@ -0,0 +1,26 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +@interface Foo { + void *isa; +} +@property(copy) Foo *myprop; +@property(retain, nonatomic) id xx; +// RUN: c-index-test -code-completion-at=%s:7:11 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: {TypedText assign} +// CHECK-CC1-NEXT: {TypedText atomic} +// CHECK-CC1-NEXT: {TypedText copy} +// CHECK-CC1-NEXT: {TypedText getter}{Text = }{Placeholder method} +// CHECK-CC1-NEXT: {TypedText nonatomic} +// CHECK-CC1-NEXT: {TypedText readonly} +// CHECK-CC1-NEXT: {TypedText readwrite} +// CHECK-CC1-NEXT: {TypedText retain} +// CHECK-CC1-NEXT: {TypedText setter}{Text = }{Placeholder method} +// CHECK-CC1-NEXT: {TypedText strong} +// CHECK-CC1-NEXT: {TypedText unsafe_unretained} +// RUN: c-index-test -code-completion-at=%s:8:18 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: {TypedText getter}{Text = }{Placeholder method} +// CHECK-CC2-NEXT: {TypedText nonatomic} +// CHECK-CC2-NEXT: {TypedText readwrite} +// CHECK-CC2-NEXT: {TypedText setter}{Text = }{Placeholder method} +@end diff --git a/clang/test/Index/complete-property-getset.m b/clang/test/Index/complete-property-getset.m new file mode 100644 index 0000000..f4424ce --- /dev/null +++ b/clang/test/Index/complete-property-getset.m @@ -0,0 +1,41 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +@interface Super { } +- (int)getter1; ++ (int)getter2_not_instance; +- (int)getter2_not:(int)x; +- (int)getter3; +- (void)setter1:(int)x; ++ (void)setter2_not_inst:(int)x; ++ (void)setter2_many_args:(int)x second:(int)y; +- (void)setter3:(int)y; +@property (getter = getter1, setter = setter1:) int blah; +@end + +@interface Sub : Super { } +- (int)getter4; +- (void)setter4:(int)x; +@property (getter = getter4, setter = setter1:) int blarg; +@end + +// RUN: c-index-test -code-completion-at=%s:13:21 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter1} +// CHECK-CC1-NOT: getter2 +// CHECK-CC1: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter3} +// RUN: c-index-test -code-completion-at=%s:13:39 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter2_not:} +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType void}{TypedText setter1:} +// CHECK-CC2-NOT: setter2 +// CHECK-CC2: ObjCInstanceMethodDecl:{ResultType void}{TypedText setter3:} +// RUN: c-index-test -code-completion-at=%s:19:21 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter1} +// CHECK-CC3-NOT: getter2 +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter3} +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter4} +// RUN: c-index-test -code-completion-at=%s:19:39 %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText getter2_not:}{Informative (int)x} +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType void}{TypedText setter1:}{Informative (int)x} +// CHECK-CC4-NOT: setter2 +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType void}{TypedText setter3:}{Informative (int)y} +// CHECK-CC4: ObjCInstanceMethodDecl:{ResultType void}{TypedText setter4:}{Informative (int)x} diff --git a/clang/test/Index/complete-protocols.m b/clang/test/Index/complete-protocols.m new file mode 100644 index 0000000..6af0198 --- /dev/null +++ b/clang/test/Index/complete-protocols.m @@ -0,0 +1,27 @@ +/* Note: the RUN lines are near the end of the file, since line/column + matter for this test. */ + +@protocol Protocol1 +@end + +@protocol Protocol2; + +void f(id<Protocol1,Protocol2>); + +@protocol Protocol0; +@protocol NewProtocol +{ +} +@end + +// RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: ObjCProtocolDecl:{TypedText Protocol1} +// CHECK-CC1-NEXT: ObjCProtocolDecl:{TypedText Protocol2} +// RUN: c-index-test -code-completion-at=%s:9:21 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2-NOT: ObjCProtocolDecl:{TypedText Protocol1} +// CHECK-CC2: ObjCProtocolDecl:{TypedText Protocol2} +// RUN: c-index-test -code-completion-at=%s:12:11 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCProtocolDecl:{TypedText Protocol0} +// CHECK-CC3-NEXT: ObjCProtocolDecl:{TypedText Protocol2} + +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC1 %s diff --git a/clang/test/Index/complete-qualified.cpp b/clang/test/Index/complete-qualified.cpp new file mode 100644 index 0000000..f5c032c --- /dev/null +++ b/clang/test/Index/complete-qualified.cpp @@ -0,0 +1,20 @@ +template <typename X, typename Y> +class C +{ +}; + +class Foo +{ +public: + C<Foo, class Bar> c; +}; + +void foo() +{ + Foo:: + +// RUN: c-index-test -code-completion-at=%s:14:8 %s -o - | FileCheck -check-prefix=CC1 %s +// CHECK-CC1: FieldDecl:{ResultType C<Foo, class Bar>}{TypedText c} (35) (parent: ClassDecl 'Foo') +// CHECK-CC1: ClassDecl:{TypedText Foo} (35) (parent: ClassDecl 'Foo') +// CHECK-CC1: CXXMethod:{ResultType Foo &}{TypedText operator=}{LeftParen (}{Placeholder const Foo &}{RightParen )} (35) (parent: ClassDecl 'Foo') +// CHECK-CC1: CXXDestructor:{ResultType void}{TypedText ~Foo}{LeftParen (}{RightParen )} (35) (parent: ClassDecl 'Foo') diff --git a/clang/test/Index/complete-recovery.m b/clang/test/Index/complete-recovery.m new file mode 100644 index 0000000..19de0fb --- /dev/null +++ b/clang/test/Index/complete-recovery.m @@ -0,0 +1,38 @@ +/* Run lines are at the end, since line/column matter in this test. */ + +@interface A +- (void)method:(int)x; +@end + +@implementation A +- (void)method:(int)x { + A *a = [A method:1]; + blarg * blah = wibble; + A *a2; + z = [a2 method:1]; + blah ? blech : [a2 method:1]; + (a * a2)([a2 method:1]); + B *a = [a2 method:1]; +} +@end + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s 2>%t | FileCheck -check-prefix=CHECK-CC1 %s +// RUN: not grep error %t +// CHECK-CC1: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC1-NOT: NotImplemented:{TypedText _Bool} +// CHECK-CC1: VarDecl:{ResultType A *}{TypedText a} +// CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} + +// Test case for fix comitted in r145441. +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )} +// CHECK-CC2: NotImplemented:{TypedText _Bool} +// CHECK-CC2: VarDecl:{ResultType A *}{TypedText a} +// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:12:11 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType void}{TypedText method:}{Placeholder (int)} (32) +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:13:22 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:14:16 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:15:14 %s | FileCheck -check-prefix=CHECK-CC3 %s diff --git a/clang/test/Index/complete-stmt.c b/clang/test/Index/complete-stmt.c new file mode 100644 index 0000000..e39431e --- /dev/null +++ b/clang/test/Index/complete-stmt.c @@ -0,0 +1,16 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + + +void f(int x) { + if (x) { + } +} + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE %s +// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Placeholder statements}{VerticalSpace }{RightBrace }} (40) +// CHECK-IF-ELSE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )}{HorizontalSpace }{LeftBrace {}{VerticalSpace }{Placeholder statements}{VerticalSpace }{RightBrace }} (40) + +// RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-IF-ELSE-SIMPLE %s +// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else} (40) +// CHECK-IF-ELSE-SIMPLE: NotImplemented:{TypedText else}{HorizontalSpace }{Text if}{HorizontalSpace }{LeftParen (}{Placeholder expression}{RightParen )} (40) diff --git a/clang/test/Index/complete-super.cpp b/clang/test/Index/complete-super.cpp new file mode 100644 index 0000000..9ffa7c8 --- /dev/null +++ b/clang/test/Index/complete-super.cpp @@ -0,0 +1,42 @@ +// The run lines are below, because this test is line- and +// column-number sensitive. + +struct A { + virtual void foo(int x, int y); + virtual void bar(double x); + virtual void bar(float x); +}; + +struct B : A { + void foo(int a, int b); + void bar(float real); +}; + +void B::foo(int a, int b) { + A::foo(a, b); +} + +void B::bar(float real) { + A::bar(real); +} + +// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-FOO-UNQUAL %s +// CHECK-FOO-UNQUAL: CXXMethod:{Text A::}{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (20) + +// RUN: c-index-test -code-completion-at=%s:20:3 %s | FileCheck -check-prefix=CHECK-BAR-UNQUAL %s +// CHECK-BAR-UNQUAL: CXXMethod:{Text A::}{TypedText bar}{LeftParen (}{Placeholder real}{RightParen )} (20) +// CHECK-BAR-UNQUAL: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{Placeholder float real}{RightParen )} (34) +// CHECK-BAR-UNQUAL: CXXMethod:{ResultType void}{Text A::}{TypedText bar}{LeftParen (}{Placeholder double x}{RightParen )} (36) + +// RUN: c-index-test -code-completion-at=%s:16:6 %s | FileCheck -check-prefix=CHECK-FOO-QUAL %s +// CHECK-FOO-QUAL: CXXMethod:{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (20) + +// RUN: c-index-test -code-completion-at=%s:5:1 %s | FileCheck -check-prefix=CHECK-ACCESS %s +// CHECK-ACCESS: NotImplemented:{TypedText private} (40) +// CHECK-ACCESS: NotImplemented:{TypedText protected} (40) +// CHECK-ACCESS: NotImplemented:{TypedText public} (40) + +// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:5:1 %s | FileCheck -check-prefix=CHECK-ACCESS-PATTERN %s +// CHECK-ACCESS-PATTERN: NotImplemented:{TypedText private}{Colon :} (40) +// CHECK-ACCESS-PATTERN: NotImplemented:{TypedText protected}{Colon :} (40) +// CHECK-ACCESS-PATTERN: NotImplemented:{TypedText public}{Colon :} (40) diff --git a/clang/test/Index/complete-super.m b/clang/test/Index/complete-super.m new file mode 100644 index 0000000..6c2daa8 --- /dev/null +++ b/clang/test/Index/complete-super.m @@ -0,0 +1,81 @@ +// Note: the run lines follow their respective tests, since line/column +// matter in this test. + +typedef int Bool; + +@interface A +- (void)add:(int)x to:(int)y; ++ (void)select:(Bool)condition first:(int)x second:(int)y; +- (void)last; ++ (void)last; +@end + +@interface B : A +- (void)add:(int)x to:(int)y; ++ (void)select:(Bool)condition first:(int)x second:(int)y; +@end + +@implementation B +- (void)add:(int)a to:(int)b { + [super add:a to:b]; +} + ++ (void)select:(Bool)condition first:(int)a second:(int)b { + [super selector:condition first:a second:b]; + super selector:condition first:a second:b]; +} +@end + +@interface A (Cat) +- (void)multiply:(int)x by:(int)y; +@end + +@interface C : A +@end + +@implementation C +- (void)multiply:(int)a by:(int)b { + [super multiply:a by:b]; +} +@end + +// Check "super" completion as a message receiver. +// RUN: c-index-test -code-completion-at=%s:20:4 %s | FileCheck -check-prefix=CHECK-ADD-RECEIVER %s +// CHECK-ADD-RECEIVER: ObjCInstanceMethodDecl:{ResultType void}{TypedText super}{HorizontalSpace }{Text add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20) + +// RUN: c-index-test -code-completion-at=%s:24:4 %s | FileCheck -check-prefix=CHECK-SELECT-RECEIVER %s +// CHECK-SELECT-RECEIVER: ObjCClassMethodDecl:{ResultType void}{TypedText super}{HorizontalSpace }{Text select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) + +// Check "super" completion at the first identifier +// RUN: c-index-test -code-completion-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-ADD-ADD %s +// CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20) +// CHECK-ADD-ADD-NOT: add +// CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) + +// RUN: c-index-test -code-completion-at=%s:24:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s +// CHECK-SELECTOR-SELECTOR-NOT: x +// CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText last} (35) +// CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) + +// Check "super" completion at the second identifier +// RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s +// CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20) + +// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s +// CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) + +// Check "super" completion at the third identifier +// RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s +// CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20) + +// Check "super" completion with missing '['. +// RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s +// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s +// RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s + +// Check "super" completion for a method declared in a category. +// RUN: c-index-test -code-completion-at=%s:38:10 %s | FileCheck -check-prefix=CHECK-IN-CATEGORY %s +// CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText add:}{Placeholder (int)}{HorizontalSpace }{TypedText to:}{Placeholder (int)} (35) +// CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) +// CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText multiply:}{Placeholder a}{HorizontalSpace }{Text by:}{Placeholder b} (20) + diff --git a/clang/test/Index/complete-synthesized.m b/clang/test/Index/complete-synthesized.m new file mode 100644 index 0000000..8c848fc --- /dev/null +++ b/clang/test/Index/complete-synthesized.m @@ -0,0 +1,46 @@ +// Note: this test is line- and column-sensitive. Test commands are at +// the end. + + +@interface A +@property int prop1; +@end + +@interface B : A { + float _prop2; +} +@property float prop2; +@property short prop3; +@end + +@interface B () +@property double prop4; +@end + +@implementation B +@synthesize prop2 = _prop2; + +- (int)method { + return _prop2; +} + +@dynamic prop3; + +- (short)method2 { + return _prop4; +} + +- (short)method3 { + return prop3; +} +@end + +// RUN: c-index-test -code-completion-at=%s:24:1 -target x86_64-apple-macosx10.7 -fobjc-nonfragile-abi %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:30:2 -target x86_64-apple-macosx10.7 -fobjc-nonfragile-abi %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:34:2 -target x86_64-apple-macosx10.7 -fobjc-nonfragile-abi %s | FileCheck %s + +// CHECK: NotImplemented:{TypedText _Bool} (50) +// CHECK: ObjCIvarDecl:{ResultType float}{TypedText _prop2} (35) +// CHECK-NOT: prop2 +// CHECK-NOT: prop3 +// CHECK: ObjCIvarDecl:{ResultType double}{TypedText _prop4} (35) diff --git a/clang/test/Index/complete-tabs.c b/clang/test/Index/complete-tabs.c new file mode 100644 index 0000000..f3313bf --- /dev/null +++ b/clang/test/Index/complete-tabs.c @@ -0,0 +1,9 @@ +// Test code-completion in the presence of tabs +struct Point { int x, y; }; + +void f(struct Point *p) { + p-> + +// RUN: c-index-test -code-completion-at=%s:5:5 %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: {TypedText x} +// CHECK-CC1: {TypedText y} diff --git a/clang/test/Index/complete-templates.cpp b/clang/test/Index/complete-templates.cpp new file mode 100644 index 0000000..d2279b1 --- /dev/null +++ b/clang/test/Index/complete-templates.cpp @@ -0,0 +1,19 @@ +// Tests are line- and column-sensive, so run lines are below. + +template<typename T> +class X { + X(); + X(const X&); + + template<typename U> X(U); +}; + +template<typename T> void f(T); + +void test() { + +} + +// RUN: c-index-test -code-completion-at=%s:14:2 %s | FileCheck %s +// CHECK: FunctionTemplate:{ResultType void}{TypedText f}{LeftParen (}{Placeholder T}{RightParen )} (50) +// CHECK: ClassTemplate:{TypedText X}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) diff --git a/clang/test/Index/complete-type-factors.m b/clang/test/Index/complete-type-factors.m new file mode 100644 index 0000000..e5aa893 --- /dev/null +++ b/clang/test/Index/complete-type-factors.m @@ -0,0 +1,137 @@ +/* Run lines are at the end, since line/column matter in this test. */ + +enum Color { + Red, Green, Blue +}; + +enum Priority { + Low, + High +}; + +int func1(enum Color); +enum Priority func2(int); +void func3(float); +enum Priority test1(enum Priority priority, enum Color color, int integer) { + int i = integer; + enum Color c = color; + return priority; + func1(c); + void (^block)(enum Color, int); + block(c, 17); + c = color; +} + +@interface A ++ (void)method:(enum Color)color priority:(enum Priority)priority; +- (void)method:(enum Color)color priority:(enum Priority)priority; +@end + +void test2(A *a) { + [a method:Red priority:High]; + [A method:Red priority:Low]; +} + +// RUN: c-index-test -code-completion-at=%s:16:11 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (32) +// CHECK-CC1: ParmDecl:{ResultType enum Color}{TypedText color} (17) +// CHECK-CC1: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (12) +// CHECK-CC1: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (25) +// CHECK-CC1: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (32) +// CHECK-CC1: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (32) +// CHECK-CC1: VarDecl:{ResultType int}{TypedText i} (8) +// CHECK-CC1: ParmDecl:{ResultType int}{TypedText integer} (8) +// CHECK-CC1: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (32) +// CHECK-CC1: ParmDecl:{ResultType enum Priority}{TypedText priority} (17) +// CHECK-CC1: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (32) +// CHECK-CC1: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// CHECK-CC1: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (25) +// RUN: c-index-test -code-completion-at=%s:17:18 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (16) +// CHECK-CC2: VarDecl:{ResultType enum Color}{TypedText c} (8) +// CHECK-CC2: ParmDecl:{ResultType enum Color}{TypedText color} (8) +// CHECK-CC2: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC2: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC2: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (16) +// CHECK-CC2: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (65) +// CHECK-CC2: VarDecl:{ResultType int}{TypedText i} (17) +// CHECK-CC2: ParmDecl:{ResultType int}{TypedText integer} (17) +// CHECK-CC2: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (65) +// CHECK-CC2: ParmDecl:{ResultType enum Priority}{TypedText priority} (34) +// CHECK-CC2: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (16) +// CHECK-CC2: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// CHECK-CC2: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (50) +// RUN: c-index-test -code-completion-at=%s:18:10 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (65) +// CHECK-CC3: VarDecl:{ResultType enum Color}{TypedText c} (34) +// CHECK-CC3: ParmDecl:{ResultType enum Color}{TypedText color} (34) +// CHECK-CC3: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC3: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (12) +// CHECK-CC3: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50) +// CHECK-CC3: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (65) +// CHECK-CC3: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (16) +// CHECK-CC3: VarDecl:{ResultType int}{TypedText i} (17) +// CHECK-CC3: ParmDecl:{ResultType int}{TypedText integer} (17) +// CHECK-CC3: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (16) +// CHECK-CC3: ParmDecl:{ResultType enum Priority}{TypedText priority} (8) +// CHECK-CC3: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (65) +// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// CHECK-CC3: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (12) +// RUN: c-index-test -code-completion-at=%s:19:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s +// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (16) +// CHECK-CC4: VarDecl:{ResultType enum Color}{TypedText c} (8) +// CHECK-CC4: ParmDecl:{ResultType enum Color}{TypedText color} (8) +// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC4: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC4: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50) +// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (16) +// CHECK-CC4: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (65) +// CHECK-CC4: VarDecl:{ResultType int}{TypedText i} (17) +// CHECK-CC4: ParmDecl:{ResultType int}{TypedText integer} (17) +// CHECK-CC4: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (65) +// CHECK-CC4: ParmDecl:{ResultType enum Priority}{TypedText priority} (34) +// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (16) +// CHECK-CC4: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// CHECK-CC4: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (50) +// RUN: c-index-test -code-completion-at=%s:21:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s +// RUN: c-index-test -code-completion-at=%s:22:7 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s +// CHECK-CC6: VarDecl:{ResultType void (^)(enum Color, int)}{TypedText block} (34) +// CHECK-CC6: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (16) +// CHECK-CC6: VarDecl:{ResultType enum Color}{TypedText c} (8) +// CHECK-CC6: ParmDecl:{ResultType enum Color}{TypedText color} (8) +// CHECK-CC6: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC6: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC6: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50) +// CHECK-CC6: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (16) +// CHECK-CC6: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (65) +// CHECK-CC6: VarDecl:{ResultType int}{TypedText i} (17) +// CHECK-CC6: ParmDecl:{ResultType int}{TypedText integer} (17) +// CHECK-CC6: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (65) +// CHECK-CC6: ParmDecl:{ResultType enum Priority}{TypedText priority} (34) +// CHECK-CC6: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (16) +// CHECK-CC6: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40) +// CHECK-CC6: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (50) +// RUN: c-index-test -code-completion-at=%s:31:13 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s +// RUN: c-index-test -code-completion-at=%s:32:13 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC7 %s +// CHECK-CC7: ParmDecl:{ResultType A *}{TypedText a} (34) +// CHECK-CC7: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (16) +// CHECK-CC7: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC7: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC7: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50) +// CHECK-CC7: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (16) +// CHECK-CC7: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (65) +// CHECK-CC7: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (65) +// CHECK-CC7: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (16) +// CHECK-CC7: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (50) +// RUN: c-index-test -code-completion-at=%s:31:26 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC8 %s +// RUN: c-index-test -code-completion-at=%s:32:26 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC8 %s +// CHECK-CC8: ParmDecl:{ResultType A *}{TypedText a} (34) +// CHECK-CC8: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (65) +// CHECK-CC8: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25) +// CHECK-CC8: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (12) +// CHECK-CC8: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50) +// CHECK-CC8: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (65) +// CHECK-CC8: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (16) +// CHECK-CC8: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (16) +// CHECK-CC8: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (65) +// CHECK-CC8: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (12) diff --git a/clang/test/Index/complete-unterminated.c b/clang/test/Index/complete-unterminated.c new file mode 100644 index 0000000..56e6ae1 --- /dev/null +++ b/clang/test/Index/complete-unterminated.c @@ -0,0 +1,30 @@ +typedef int Integer; + +#if 0 + + +#endif + +/* blah */ + +void f0(const char*); +void f1(char); + +const char *hello = "Hello, world"; +const char a = 'a'; + +#define FOO(a, b) a b + +FOO(int, x); + +// RUN: c-index-test -code-completion-at=%s:5:1 -pedantic %s 2> %t.err | FileCheck %s +// RUN: not grep error %t.err +// CHECK: {TypedText Integer} +// RUN: c-index-test -code-completion-at=%s:8:6 -pedantic %s 2> %t.err +// RUN: not grep error %t.err +// RUN: c-index-test -code-completion-at=%s:10:28 -pedantic %s 2> %t.err +// RUN: not grep unterminated %t.err +// RUN: c-index-test -code-completion-at=%s:11:17 -pedantic %s 2> %t.err +// RUN: not grep unterminated %t.err +// RUN: c-index-test -code-completion-at=%s:18:10 -pedantic %s 2> %t.err +// RUN: not grep unterminated %t.err diff --git a/clang/test/Index/complete-with-annotations.cpp b/clang/test/Index/complete-with-annotations.cpp new file mode 100644 index 0000000..afa8d9e --- /dev/null +++ b/clang/test/Index/complete-with-annotations.cpp @@ -0,0 +1,23 @@ +class X { + void doSomething(); + + int field __attribute((annotate("one"), annotate("two"), annotate("three"))); + +public __attribute__((annotate("some annotation"))): + void func2(); + int member2 __attribute__((annotate("another annotation"))); +}; + +void X::doSomething() { + // RUN: c-index-test -code-completion-at=%s:13:9 %s | FileCheck %s + this->; +} + +// CHECK: CXXMethod:{ResultType void}{TypedText doSomething}{LeftParen (}{RightParen )} (34) +// CHECK: FieldDecl:{ResultType int}{TypedText field} (35) ("three", "two", "one") +// CHECK: CXXMethod:{ResultType void}{TypedText func2}{LeftParen (}{RightParen )} (34) ("some annotation") +// CHECK: FieldDecl:{ResultType int}{TypedText member2} (35) ("another annotation", "some annotation") +// CHECK: CXXMethod:{ResultType X &}{TypedText operator=}{LeftParen (}{Placeholder const X &}{RightParen )} (34) +// CHECK: ClassDecl:{TypedText X}{Text ::} (75) +// CHECK: CXXDestructor:{ResultType void}{TypedText ~X}{LeftParen (}{RightParen )} (34) + diff --git a/clang/test/Index/crash-recovery-code-complete.c b/clang/test/Index/crash-recovery-code-complete.c new file mode 100644 index 0000000..dde90bc --- /dev/null +++ b/clang/test/Index/crash-recovery-code-complete.c @@ -0,0 +1,12 @@ +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_PREAMBLE_FILE=%t-preamble.pch \ +// RUN: not c-index-test -code-completion-at=%s:20:1 \ +// RUN: "-remap-file=%s;%S/Inputs/crash-recovery-code-complete-remap.c" \ +// RUN: %s 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-CODE-COMPLETE-CRASH %s +// RUN: test ! -e %t-preamble.pch +// CHECK-CODE-COMPLETE-CRASH: Unable to perform code completion! +// +// REQUIRES: crash-recovery +// REQUIRES: shell + +#warning parsing original file diff --git a/clang/test/Index/crash-recovery-modules.m b/clang/test/Index/crash-recovery-modules.m new file mode 100644 index 0000000..212923f --- /dev/null +++ b/clang/test/Index/crash-recovery-modules.m @@ -0,0 +1,20 @@ +// Clear out the module cache entirely, so we start from nothing. +// RUN: rm -rf %t + +// Parse the file, such that building the module will cause Clang to crash. +// RUN: not env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers -DCRASH %s 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-CRASH %s +// CHECK-CRASH: crash-recovery-modules.m:16:32:{16:2-16:37}: fatal error: could not build module 'Crash' + +// Parse the file again, without crashing, to make sure that +// subsequent parses do the right thing. +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source all -fmodules -fmodule-cache-path %t -Xclang -fdisable-module-hash -I %S/Inputs/Headers %s + +// REQUIRES: crash-recovery +// REQUIRES: shell + +@__experimental_modules_import Crash; + +void test() { + const char* error = getCrashString(); +} diff --git a/clang/test/Index/crash-recovery-reparse.c b/clang/test/Index/crash-recovery-reparse.c new file mode 100644 index 0000000..06bb76b --- /dev/null +++ b/clang/test/Index/crash-recovery-reparse.c @@ -0,0 +1,12 @@ +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_PREAMBLE_FILE=%t-preamble.pch \ +// RUN: not c-index-test -test-load-source-reparse 1 local \ +// RUN: -remap-file="%s;%S/Inputs/crash-recovery-reparse-remap.c" \ +// RUN: %s 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-REPARSE-SOURCE-CRASH %s +// RUN: test ! -e $t-preamble.pch +// CHECK-REPARSE-SOURCE-CRASH: Unable to reparse translation unit +// +// REQUIRES: crash-recovery +// REQUIRES: shell + +#warning parsing original file diff --git a/clang/test/Index/crash-recovery.c b/clang/test/Index/crash-recovery.c new file mode 100644 index 0000000..b7f6e0b --- /dev/null +++ b/clang/test/Index/crash-recovery.c @@ -0,0 +1,7 @@ +// RUN: not c-index-test -test-load-source all %s 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-LOAD-SOURCE-CRASH %s +// CHECK-LOAD-SOURCE-CRASH: Unable to load translation unit +// +// REQUIRES: crash-recovery + +#pragma clang __debug crash diff --git a/clang/test/Index/cursor-ref-names.cpp b/clang/test/Index/cursor-ref-names.cpp new file mode 100644 index 0000000..26174bc --- /dev/null +++ b/clang/test/Index/cursor-ref-names.cpp @@ -0,0 +1,47 @@ +template <typename T> +struct Base { + void func(); + int operator[](T); +}; + +struct Sub: public Base<int> { + void func(); +}; + +template <typename T> +inline T myMax(T a, T b) +{ return (a > b) ? a : b; } + +int main() +{ + Sub inst; + inst.func(); + inst[1]; + inst.operator[](1); + + inst.Base<int>::operator[](1); + myMax<int>(1, 2); + + return 0; +} + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: cursor-ref-names.cpp:17:5: DeclStmt= Extent=[17:5 - 17:14] +// CHECK: cursor-ref-names.cpp:17:9: VarDecl=inst:17:9 (Definition) Extent=[17:5 - 17:13] +// CHECK: cursor-ref-names.cpp:17:5: TypeRef=struct Sub:7:8 Extent=[17:5 - 17:8] +// CHECK: cursor-ref-names.cpp:17:9: CallExpr=Sub:7:8 Extent=[17:9 - 17:13] +// CHECK: cursor-ref-names.cpp:18:5: CallExpr=func:8:10 Extent=[18:5 - 18:16] +// CHECK: cursor-ref-names.cpp:18:10: MemberRefExpr=func:8:10 SingleRefName=[18:10 - 18:14] RefName=[18:10 - 18:14] Extent=[18:5 - 18:14] +// CHECK: cursor-ref-names.cpp:18:5: DeclRefExpr=inst:17:9 Extent=[18:5 - 18:9] +// CHECK: cursor-ref-names.cpp:19:5: CallExpr=operator[]:4:9 SingleRefName=[19:9 - 19:12] RefName=[19:9 - 19:10] RefName=[19:11 - 19:12] Extent=[19:5 - 19:12] +// CHECK: cursor-ref-names.cpp:19:5: DeclRefExpr=inst:17:9 Extent=[19:5 - 19:9] +// CHECK: cursor-ref-names.cpp:19:9: DeclRefExpr=operator[]:4:9 RefName=[19:9 - 19:10] RefName=[19:11 - 19:12] Extent=[19:9 - 19:12] +// CHECK: cursor-ref-names.cpp:20:5: CallExpr=operator[]:4:9 Extent=[20:5 - 20:23] +// CHECK: cursor-ref-names.cpp:20:10: MemberRefExpr=operator[]:4:9 SingleRefName=[20:10 - 20:20] RefName=[20:10 - 20:18] RefName=[20:18 - 20:19] RefName=[20:19 - 20:20] Extent=[20:5 - 20:20] +// CHECK: cursor-ref-names.cpp:20:5: DeclRefExpr=inst:17:9 Extent=[20:5 - 20:9] +// CHECK: cursor-ref-names.cpp:22:5: CallExpr=operator[]:4:9 Extent=[22:5 - 22:34] +// CHECK: cursor-ref-names.cpp:22:21: MemberRefExpr=operator[]:4:9 SingleRefName=[22:10 - 22:31] RefName=[22:10 - 22:21] RefName=[22:21 - 22:29] RefName=[22:29 - 22:30] RefName=[22:30 - 22:31] Extent=[22:5 - 22:31] +// CHECK: cursor-ref-names.cpp:22:5: DeclRefExpr=inst:17:9 Extent=[22:5 - 22:9] +// CHECK: cursor-ref-names.cpp:22:10: TemplateRef=Base:2:8 Extent=[22:10 - 22:14] +// CHECK: cursor-ref-names.cpp:23:5: CallExpr=myMax:12:10 Extent=[23:5 - 23:21] +// CHECK: cursor-ref-names.cpp:23:5: DeclRefExpr=myMax:12:10 RefName=[23:5 - 23:10] RefName=[23:10 - 23:15] Extent=[23:5 - 23:15] diff --git a/clang/test/Index/cxx-operator-overload.cpp b/clang/test/Index/cxx-operator-overload.cpp new file mode 100644 index 0000000..8647448 --- /dev/null +++ b/clang/test/Index/cxx-operator-overload.cpp @@ -0,0 +1,28 @@ +// Run lines are sensitive to line numbers and come below the code. +// FIXME: re-enable this when we can serialize more C++ ASTs +class Cls { +public: + Cls operator +(const Cls &RHS); +}; + +static void bar() { + Cls x1, x2, x3; + Cls x4 = x1 + x2 + x3; +} + +Cls Cls::operator +(const Cls &RHS) { while (1) {} } + +// RUN: %clang_cc1 -emit-pch %s -o %t.ast + +// RUNx: index-test %t.ast -point-at %s:10:17 -print-decls > %t && +// RUNx: cat %t | count 2 && +// RUNx: grep ':5:9,' %t && +// RUNx: grep ':13:10,' %t && + +// Yep, we can show references of '+' plus signs that are overloaded, w00t! +// RUNx: index-test %t.ast -point-at %s:5:15 -print-refs > %t && +// RUNx: cat %t | count 2 && +// RUNx: grep ':10:17,' %t && +// RUNx: grep ':10:22,' %t && + +// RUNx: index-test %t.ast -point-at %s:10:14 | grep 'DeclRefExpr x1' diff --git a/clang/test/Index/cxx11-lambdas.cpp b/clang/test/Index/cxx11-lambdas.cpp new file mode 100644 index 0000000..93db022 --- /dev/null +++ b/clang/test/Index/cxx11-lambdas.cpp @@ -0,0 +1,33 @@ +// Test is line- and column-sensitive; see below. + +typedef int Integer; +struct X { + void f() { + int localA, localB; + auto lambda = [&localA, localB] (Integer x) -> Integer { + return localA + localB + x; + }; + } +}; + +// RUN: c-index-test -test-load-source all -std=c++11 %s | FileCheck -check-prefix=CHECK-LOAD %s +// CHECK-LOAD: cxx11-lambdas.cpp:7:19: LambdaExpr= Extent=[7:19 - 9:6] +// CHECK-LOAD: cxx11-lambdas.cpp:7:21: VariableRef=localA:6:9 Extent=[7:21 - 7:27] +// CHECK-LOAD: cxx11-lambdas.cpp:7:29: VariableRef=localB:6:17 Extent=[7:29 - 7:35] +// CHECK-LOAD: cxx11-lambdas.cpp:7:52: TypeRef=Integer:3:13 Extent=[7:52 - 7:59] +// CHECK-LOAD: cxx11-lambdas.cpp:7:46: ParmDecl=x:7:46 (Definition) Extent=[7:38 - 7:47] +// CHECK-LOAD: cxx11-lambdas.cpp:7:38: TypeRef=Integer:3:13 Extent=[7:38 - 7:45] +// CHECK-LOAD: cxx11-lambdas.cpp:7:60: CompoundStmt= Extent=[7:60 - 9:6] +// CHECK-LOAD: cxx11-lambdas.cpp:8:7: ReturnStmt= Extent=[8:7 - 8:33] +// CHECK-LOAD: cxx11-lambdas.cpp:8:14: DeclRefExpr=localA:6:9 Extent=[8:14 - 8:20] +// CHECK-LOAD: cxx11-lambdas.cpp:8:23: DeclRefExpr=localB:6:17 Extent=[8:23 - 8:29] +// CHECK-LOAD: cxx11-lambdas.cpp:8:32: DeclRefExpr=x:7:46 Extent=[8:32 - 8:33] + +// RUN: env CINDEXTEST_INDEXLOCALSYMBOLS=1 c-index-test -index-file -std=c++11 %s | FileCheck -check-prefix=CHECK-INDEX %s +// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localA | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localA | lang: C | cursor: VariableRef=localA:6:9 | loc: 7:21 +// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localB | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localB | lang: C | cursor: VariableRef=localB:6:17 | loc: 7:29 +// CHECK-INDEX: [indexEntityReference]: kind: typedef | name: Integer | USR: c:cxx11-lambdas.cpp@51@T@Integer | lang: C | cursor: TypeRef=Integer:3:13 | loc: 7:52 +// CHECK-INDEX: [indexEntityReference]: kind: typedef | name: Integer | USR: c:cxx11-lambdas.cpp@51@T@Integer | lang: C | cursor: TypeRef=Integer:3:13 | loc: 7:38 +// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localA | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localA | lang: C | cursor: DeclRefExpr=localA:6:9 | loc: 8:14 +// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localB | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localB | lang: C | cursor: DeclRefExpr=localB:6:17 | loc: 8:23 +// CHECK-INDEX: [indexEntityReference]: kind: variable | name: x | USR: c:cxx11-lambdas.cpp@157@S@X@F@f#@Ca@F@operator()#I#1@x | lang: C | cursor: DeclRefExpr=x:7:46 | loc: 8:32 diff --git a/clang/test/Index/error-on-deserialized.c b/clang/test/Index/error-on-deserialized.c new file mode 100644 index 0000000..8ba8283 --- /dev/null +++ b/clang/test/Index/error-on-deserialized.c @@ -0,0 +1,13 @@ + +#include "targeted-top.h" + +// This tests that we will correctly error out on the deserialized decl. + +// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h +// RUN: env CINDEXTEST_FAILONERROR=1 not c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 2>&1 \ +// RUN: | FileCheck %s + +// CHECK: error: NestedVar1 was deserialized diff --git a/clang/test/Index/file-macro-refs.c b/clang/test/Index/file-macro-refs.c new file mode 100644 index 0000000..ed01cf5 --- /dev/null +++ b/clang/test/Index/file-macro-refs.c @@ -0,0 +1,12 @@ +#define FOO + +FOO +FOO + +// RUN: c-index-test -file-refs-at=%s:3:2 %s | FileCheck %s +// RUN: env CINDEXTEST_EDITING=1 c-index-test -file-refs-at=%s:3:2 %s | FileCheck %s + +// CHECK: macro expansion=FOO:1:9 +// CHECK-NEXT: macro definition=FOO =[1:9 - 1:12] +// CHECK-NEXT: macro expansion=FOO:1:9 =[3:1 - 3:4] +// CHECK-NEXT: macro expansion=FOO:1:9 =[4:1 - 4:4] diff --git a/clang/test/Index/file-refs-subscripting.m b/clang/test/Index/file-refs-subscripting.m new file mode 100644 index 0000000..493d93d --- /dev/null +++ b/clang/test/Index/file-refs-subscripting.m @@ -0,0 +1,65 @@ +@interface NSArray +- (id)objectAtIndexedSubscript:(int)index; ++ (id)arrayWithObjects:(id *)objects count:(unsigned)count; +@end + +@interface NSMutableArray : NSArray +- (id)objectAtIndexedSubscript:(int)index; +- (void)setObject:(id)object atIndexedSubscript:(int)index; +@end + +@interface NSDictionary +- (id)objectForKeyedSubscript:(id)key; ++ (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count; +@end + +@interface NSMutableDictionary : NSDictionary +- (void)setObject:(id)object forKeyedSubscript:(id)key; +@end + +@class NSString; + +id testArray(int index, id p) { + NSMutableArray *array; + array[3] = 0; + NSArray *arr = @[ p, p ]; + return array[index]; +} + +void testDict() { + NSMutableDictionary *dictionary; + NSString *key; + id newObject, oldObject; + oldObject = dictionary[key]; + dictionary[key] = newObject; + NSDictionary *dict = @{ key: newObject, key: oldObject }; +} + +// RUN: c-index-test \ + +// RUN: -file-refs-at=%s:22:21 \ +// CHECK: ParmDecl=index:22:18 +// CHECK-NEXT: ParmDecl=index:22:18 (Definition) =[22:18 - 22:23] +// CHECK-NEXT: DeclRefExpr=index:22:18 =[26:16 - 26:21] + +// RUN: -file-refs-at=%s:22:28 \ +// CHECK-NEXT: ParmDecl=p:22:28 +// CHECK-NEXT: ParmDecl=p:22:28 (Definition) =[22:28 - 22:29] +// CHECK-NEXT: DeclRefExpr=p:22:28 =[25:21 - 25:22] +// CHECK-NEXT: DeclRefExpr=p:22:28 =[25:24 - 25:25] + +// RUN: -file-refs-at=%s:34:16 \ +// CHECK-NEXT: DeclRefExpr=key:31:13 +// CHECK-NEXT: VarDecl=key:31:13 (Definition) =[31:13 - 31:16] +// CHECK-NEXT: DeclRefExpr=key:31:13 =[33:26 - 33:29] +// CHECK-NEXT: DeclRefExpr=key:31:13 =[34:14 - 34:17] +// CHECK-NEXT: DeclRefExpr=key:31:13 =[35:27 - 35:30] +// CHECK-NEXT: DeclRefExpr=key:31:13 =[35:43 - 35:46] + +// RUN: -file-refs-at=%s:35:35 \ +// CHECK-NEXT: DeclRefExpr=newObject:32:6 +// CHECK-NEXT: VarDecl=newObject:32:6 (Definition) =[32:6 - 32:15] +// CHECK-NEXT: DeclRefExpr=newObject:32:6 =[34:21 - 34:30] +// CHECK-NEXT: DeclRefExpr=newObject:32:6 =[35:32 - 35:41] + +// RUN: -target x86_64-apple-macosx10.7 %s | FileCheck %s diff --git a/clang/test/Index/file-refs.c b/clang/test/Index/file-refs.c new file mode 100644 index 0000000..23042ea --- /dev/null +++ b/clang/test/Index/file-refs.c @@ -0,0 +1,57 @@ +enum { + VALUE = 3 +}; + +extern int glob_x; + +int f(int x) { + return x+glob_x+VALUE; +} + +typedef struct { + int x; + int y; +} Vector; + +int vector_get_x(Vector v) { + int x = v.x; + return x; +} + +int f(int); +int f(int); + +// RUN: c-index-test \ + +// RUN: -file-refs-at=%s:2:5 \ +// CHECK: EnumConstantDecl=VALUE:2:3 (Definition) +// CHECK-NEXT: EnumConstantDecl=VALUE:2:3 (Definition) =[2:3 - 2:8] +// CHECK-NEXT: DeclRefExpr=VALUE:2:3 =[8:19 - 8:24] + +// RUN: -file-refs-at=%s:8:15 \ +// CHECK-NEXT: DeclRefExpr=glob_x:5:12 +// CHECK-NEXT: VarDecl=glob_x:5:12 =[5:12 - 5:18] +// CHECK-NEXT: DeclRefExpr=glob_x:5:12 =[8:12 - 8:18] + +// RUN: -file-refs-at=%s:8:10 \ +// CHECK-NEXT: DeclRefExpr=x:7:11 +// CHECK-NEXT: ParmDecl=x:7:11 (Definition) =[7:11 - 7:12] +// CHECK-NEXT: DeclRefExpr=x:7:11 =[8:10 - 8:11] + +// RUN: -file-refs-at=%s:12:7 \ +// CHECK-NEXT: FieldDecl=x:12:7 (Definition) +// CHECK-NEXT: FieldDecl=x:12:7 (Definition) =[12:7 - 12:8] +// CHECK-NEXT: MemberRefExpr=x:12:7 {{.*}} =[17:13 - 17:14] + +// RUN: -file-refs-at=%s:16:21 \ +// CHECK-NEXT: TypeRef=Vector:14:3 +// CHECK-NEXT: TypedefDecl=Vector:14:3 (Definition) =[14:3 - 14:9] +// CHECK-NEXT: TypeRef=Vector:14:3 =[16:18 - 16:24] + +// RUN: -file-refs-at=%s:21:5 \ +// CHECK-NEXT: FunctionDecl=f:21:5 +// CHECK-NEXT: FunctionDecl=f:7:5 (Definition) =[7:5 - 7:6] +// CHECK-NEXT: FunctionDecl=f:21:5 =[21:5 - 21:6] +// CHECK-NEXT: FunctionDecl=f:22:5 =[22:5 - 22:6] + +// RUN: %s | FileCheck %s diff --git a/clang/test/Index/file-refs.cpp b/clang/test/Index/file-refs.cpp new file mode 100644 index 0000000..a96d27c --- /dev/null +++ b/clang/test/Index/file-refs.cpp @@ -0,0 +1,104 @@ +namespace NS { + class C { + public: + C() { } + void m(); + }; +} + +void NS::C::m() { + C c; + c.m(); +} + +void f() { + NS::C c1(); + NS::C c2 = NS::C(); +} + +void over(int); +void over(float); + +void test_over() { + over(0); + over(0.0f); +} + +template <typename T> +T tf(T t) { + return t; +} + +namespace Test2 { + +struct S { + S(int x, int y); + S(); +}; + +typedef S Cake; + +void f() { + Cake p; + p = Test2::S(0,2); + p = Test2::Cake(0,2); +} + +} + +// RUN: c-index-test \ + +// RUN: -file-refs-at=%s:9:7 \ +// CHECK: NamespaceRef=NS:1:11 +// CHECK-NEXT: Namespace=NS:1:11 (Definition) =[1:11 - 1:13] +// CHECK-NEXT: NamespaceRef=NS:1:11 =[9:6 - 9:8] +// CHECK-NEXT: NamespaceRef=NS:1:11 =[15:3 - 15:5] +// CHECK-NEXT: NamespaceRef=NS:1:11 =[16:3 - 16:5] +// CHECK-NEXT: NamespaceRef=NS:1:11 =[16:14 - 16:16] + +// RUN: -file-refs-at=%s:2:9 \ +// CHECK-NEXT: ClassDecl=C:2:9 (Definition) +// CHECK-NEXT: ClassDecl=C:2:9 (Definition) =[2:9 - 2:10] +// CHECK-NEXT: CXXConstructor=C:4:5 (Definition) =[4:5 - 4:6] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[9:10 - 9:11] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[10:3 - 10:4] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[15:7 - 15:8] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:7 - 16:8] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:18 - 16:19] + +// RUN: -file-refs-at=%s:16:18 \ +// CHECK-NEXT: CallExpr=C:4:5 +// CHECK-NEXT: ClassDecl=C:2:9 (Definition) =[2:9 - 2:10] +// CHECK-NEXT: CXXConstructor=C:4:5 (Definition) =[4:5 - 4:6] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[9:10 - 9:11] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[10:3 - 10:4] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[15:7 - 15:8] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:7 - 16:8] +// CHECK-NEXT: TypeRef=class NS::C:2:9 =[16:18 - 16:19] + +// RUN: -file-refs-at=%s:20:8 \ +// CHECK-NEXT: FunctionDecl=over:20:6 +// CHECK-NEXT: FunctionDecl=over:20:6 =[20:6 - 20:10] +// CHECK-NEXT: DeclRefExpr=over:20:6 =[24:3 - 24:7] + +// RUN: -file-refs-at=%s:28:1 \ +// CHECK-NEXT: TypeRef=T:27:20 +// FIXME: Missing TemplateTypeParameter=T:27:20 (Definition) +// CHECK-NEXT: TypeRef=T:27:20 =[28:1 - 28:2] +// CHECK-NEXT: TypeRef=T:27:20 =[28:6 - 28:7] + +// RUN: -file-refs-at=%s:43:14 \ +// CHECK-NEXT: CallExpr=S:35:3 +// CHECK-NEXT: StructDecl=S:34:8 (Definition) =[34:8 - 34:9] +// CHECK-NEXT: CXXConstructor=S:35:3 =[35:3 - 35:4] +// CHECK-NEXT: CXXConstructor=S:36:3 =[36:3 - 36:4] +// CHECK-NEXT: TypeRef=struct Test2::S:34:8 =[39:9 - 39:10] +// CHECK-NEXT: TypeRef=struct Test2::S:34:8 =[43:14 - 43:15] + +// RUN: -file-refs-at=%s:44:16 \ +// CHECK-NEXT: CallExpr=S:35:3 +// CHECK-NEXT: TypedefDecl=Cake:39:11 (Definition) =[39:11 - 39:15] +// CHECK-NEXT: TypeRef=Cake:39:11 =[42:3 - 42:7] +// CHECK-NEXT: TypeRef=Cake:39:11 =[44:14 - 44:18] + +// RUN: %s | FileCheck %s diff --git a/clang/test/Index/file-refs.m b/clang/test/Index/file-refs.m new file mode 100644 index 0000000..3f21c9e --- /dev/null +++ b/clang/test/Index/file-refs.m @@ -0,0 +1,91 @@ +@class Foo; + +@interface Foo +-(id)setWithInt:(int)i andFloat:(float)f; +@end + +@implementation Foo +-(id)setWithInt:(int)i andFloat:(float)f { + return self; +} +@end + +void test(Foo *foo) { + [foo setWithInt:0 andFloat:0]; + [foo setWithInt: 2 andFloat: 3]; +} + +@protocol Prot1 +-(void)protMeth; +@end + +@protocol Prot2<Prot1> +@end + +@interface Base<Prot2> +@end + +@interface Sub : Base +-(void)protMeth; +@end + +@implementation Sub +-(void)protMeth {} +@end + +void test2(Sub *s, id<Prot1> p) { + [s protMeth]; + [p protMeth]; +} + + +// RUN: c-index-test \ + +// RUN: -file-refs-at=%s:7:18 \ +// CHECK: ObjCImplementationDecl=Foo:7:17 (Definition) + +// FIXME: There should not be 2 for the same range. +// CHECK-NEXT: ObjCInterfaceDecl=Foo:1:8 =[1:8 - 1:11] +// CHECK-NEXT: ObjCClassRef=Foo:3:12 =[1:8 - 1:11] + +// CHECK-NEXT: ObjCInterfaceDecl=Foo:3:12 =[3:12 - 3:15] +// CHECK-NEXT: ObjCImplementationDecl=Foo:7:17 (Definition) =[7:17 - 7:20] +// CHECK-NEXT: ObjCClassRef=Foo:3:12 =[13:11 - 13:14] + +// RUN: -file-refs-at=%s:4:10 \ +// CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 +// CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 =[4:6 - 4:16] +// CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::8:6 (Definition) =[8:6 - 8:16] +// CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[14:8 - 14:18] +// CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[15:8 - 15:18] + +// RUN: -file-refs-at=%s:15:27 \ +// CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 +// CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 =[4:24 - 4:32] +// CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::8:6 (Definition) =[8:24 - 8:32] +// CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[14:21 - 14:29] +// CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[15:22 - 15:30] + +// RUN: -file-refs-at=%s:18:13 \ +// CHECK-NEXT: ObjCProtocolDecl=Prot1:18:11 (Definition) +// CHECK-NEXT: ObjCProtocolDecl=Prot1:18:11 (Definition) =[18:11 - 18:16] +// CHECK-NEXT: ObjCProtocolRef=Prot1:18:11 =[22:17 - 22:22] +// CHECK-NEXT: ObjCProtocolRef=Prot1:18:11 =[36:23 - 36:28] + +// RUN: -file-refs-at=%s:38:10 \ +// CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:19:8 =[19:8 - 19:16] +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:29:8 [Overrides @19:8] =[29:8 - 29:16] +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] =[33:8 - 33:16] +// CHECK-NEXT: ObjCMessageExpr=protMeth:29:8 =[37:6 - 37:14] +// CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 =[38:6 - 38:14] + +// RUN: -file-refs-at=%s:33:12 \ +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:19:8 =[19:8 - 19:16] +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:29:8 [Overrides @19:8] =[29:8 - 29:16] +// CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] =[33:8 - 33:16] +// CHECK-NEXT: ObjCMessageExpr=protMeth:29:8 =[37:6 - 37:14] +// CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 =[38:6 - 38:14] + +// RUN: %s | FileCheck %s diff --git a/clang/test/Index/fix-its.c b/clang/test/Index/fix-its.c new file mode 100644 index 0000000..d5cb1af --- /dev/null +++ b/clang/test/Index/fix-its.c @@ -0,0 +1,27 @@ +// RUN: c-index-test -test-load-source all -fspell-checking %s 2> %t +// RUN: FileCheck %s < %t +struct X { + int wibble; +}; + +#define MACRO(X) X + +void f(struct X *x) { + // CHECK: error: no member named 'wobble' in 'struct X'; did you mean 'wibble'? + // CHECK: FIX-IT: Replace [13:12 - 13:18] with "wibble" + // CHECK: note: 'wibble' declared here + MACRO(x->wobble = 17); + // CHECK: error: no member named 'wabble' in 'struct X'; did you mean 'wibble'? + // CHECK: FIX-IT: Replace [17:6 - 17:12] with "wibble" + // CHECK: note: 'wibble' declared here + x->wabble = 17; +} + +int printf(const char *restrict, ...); + +void f2() { + unsigned long index; + // CHECK: warning: format specifies type 'int' but the argument has type 'unsigned long' + // CHECK: FIX-IT: Replace [26:17 - 26:19] with "%ld" + MACRO(printf("%d", index)); +} diff --git a/clang/test/Index/get-cursor-includes.c b/clang/test/Index/get-cursor-includes.c new file mode 100644 index 0000000..68d64f1 --- /dev/null +++ b/clang/test/Index/get-cursor-includes.c @@ -0,0 +1,7 @@ +#include "get-cursor-includes-2.h" +#include "get-cursor-includes-2.h" + +// RUN: c-index-test -write-pch %t.h.pch -I%S/Inputs -Xclang -detailed-preprocessing-record %S/Inputs/get-cursor-includes-2.h +// RUN: c-index-test -cursor-at=%S/Inputs/get-cursor-includes-2.h:1:5 -I%S/Inputs -include %t.h %s | FileCheck %s + +// CHECK: inclusion directive=get-cursor-includes-1.h diff --git a/clang/test/Index/get-cursor-macro-args.h b/clang/test/Index/get-cursor-macro-args.h new file mode 100644 index 0000000..40ec8dc --- /dev/null +++ b/clang/test/Index/get-cursor-macro-args.h @@ -0,0 +1,16 @@ +@interface MyClass ++(void)meth; +@end + +#define MACRO2(x) x +#define MACRO(x) MACRO2(x) + +void test() { + MACRO([MyClass meth]); +} + +#define INVOKE(METHOD, CLASS) [CLASS METHOD] + +void test2() { + INVOKE(meth, MyClass); +} diff --git a/clang/test/Index/get-cursor-macro-args.m b/clang/test/Index/get-cursor-macro-args.m new file mode 100644 index 0000000..4945fd3 --- /dev/null +++ b/clang/test/Index/get-cursor-macro-args.m @@ -0,0 +1,19 @@ +// Test without PCH +// RUN: c-index-test -cursor-at=%S/get-cursor-macro-args.h:9:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:21 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:20 \ +// RUN: %s -include get-cursor-macro-args.h | FileCheck %s + +// Test with PCH +// RUN: c-index-test -write-pch %t.pch -x objective-c-header %S/get-cursor-macro-args.h +// RUN: c-index-test -cursor-at=%S/get-cursor-macro-args.h:9:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:21 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:20 \ +// RUN: %s -include-pch %t.pch | FileCheck %s + +// CHECK: ObjCClassRef=MyClass:1:12 +// CHECK-NEXT: ObjCMessageExpr=meth:2:8 +// CHECK-NEXT: ObjCMessageExpr=meth:2:8 +// CHECK-NEXT: ObjCClassRef=MyClass:1:12 diff --git a/clang/test/Index/get-cursor.c b/clang/test/Index/get-cursor.c new file mode 100644 index 0000000..23a4b5c --- /dev/null +++ b/clang/test/Index/get-cursor.c @@ -0,0 +1,14 @@ +struct _MyS { + int foo; +} MyS; + +struct _MyS ww; + +// RUN: c-index-test -cursor-at=%s:1:9 \ +// RUN: -cursor-at=%s:2:9 \ +// RUN: -cursor-at=%s:5:9 \ +// RUN: %s | FileCheck %s + +// CHECK: StructDecl=_MyS:1:8 (Definition) +// CHECK: FieldDecl=foo:2:7 (Definition) +// CHECK: TypeRef=struct _MyS:1:8 diff --git a/clang/test/Index/get-cursor.cpp b/clang/test/Index/get-cursor.cpp new file mode 100644 index 0000000..e1e6835 --- /dev/null +++ b/clang/test/Index/get-cursor.cpp @@ -0,0 +1,95 @@ +// Test is line- and column-sensitive. Run lines are below. + +struct X { + X(); + X(int); + X(int, int); + X(const X&); +}; + +X getX(int value) { + switch (value) { + case 1: return X(value); + case 2: return X(value, value); + case 3: return (X)value; + default: break; + } + return X(); +} + +struct Y { + int member; + + X getX(); +}; + +X Y::getX() { + return member; +} + +struct YDerived : Y { + X getAnotherX() { return member; } +}; + +void test() { + X foo; + + try { + } catch (X e) { + X x; + } +} + +// RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s +// CHECK-COMPLETION-1: CXXConstructor=X:6:3 +// CHECK-COMPLETION-1-NEXT: Completion string: {TypedText X}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{RightParen )} + +// RUN: c-index-test -cursor-at=%s:31:16 %s | FileCheck -check-prefix=CHECK-COMPLETION-2 %s +// CHECK-COMPLETION-2: CXXMethod=getAnotherX:31:5 (Definition) +// CHECK-COMPLETION-2-NEXT: Completion string: {ResultType X}{TypedText getAnotherX}{LeftParen (}{RightParen )} + +// RUN: c-index-test -cursor-at=%s:12:20 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s +// RUN: c-index-test -cursor-at=%s:13:21 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s +// RUN: c-index-test -cursor-at=%s:13:28 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s +// RUN: c-index-test -cursor-at=%s:14:23 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s +// CHECK-VALUE-REF: DeclRefExpr=value:10:12 + +// RUN: c-index-test -cursor-at=%s:12:18 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR1 %s +// RUN: c-index-test -cursor-at=%s:13:18 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR2 %s +// RUN: c-index-test -cursor-at=%s:14:19 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR1 %s +// RUN: c-index-test -cursor-at=%s:17:10 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR3 %s +// CHECK-TYPE-REF: TypeRef=struct X:3:8 +// CHECK-CONSTRUCTOR1: CallExpr=X:5:3 +// CHECK-CONSTRUCTOR2: CallExpr=X:6:3 +// CHECK-CONSTRUCTOR3: CallExpr=X:4:3 + +// RUN: c-index-test -cursor-at=%s:23:3 %s | FileCheck -check-prefix=CHECK-RETTYPE %s +// RUN: c-index-test -cursor-at=%s:26:1 %s | FileCheck -check-prefix=CHECK-RETTYPE %s +// CHECK-RETTYPE: TypeRef=struct X:3:8 + +// RUN: c-index-test -cursor-at=%s:23:7 %s | FileCheck -check-prefix=CHECK-MEMFUNC-DECL %s +// CHECK-MEMFUNC-DECL: CXXMethod=getX:23:5 +// RUN: c-index-test -cursor-at=%s:26:7 %s | FileCheck -check-prefix=CHECK-MEMFUNC-DEF %s +// CHECK-MEMFUNC-DEF: CXXMethod=getX:26:6 + +// RUN: c-index-test -cursor-at=%s:26:3 %s | FileCheck -check-prefix=CHECK-TYPEREF-Y %s +// CHECK-TYPEREF-Y: TypeRef=struct Y:20:8 + +// RUN: c-index-test -cursor-at=%s:27:10 %s | FileCheck -check-prefix=CHECK-IMPLICIT-MEMREF %s +// RUN: c-index-test -cursor-at=%s:31:28 %s | FileCheck -check-prefix=CHECK-IMPLICIT-MEMREF %s +// CHECK-IMPLICIT-MEMREF: MemberRefExpr=member:21:7 + +// RUN: c-index-test -cursor-at=%s:35:5 %s | FileCheck -check-prefix=CHECK-DECL %s +// CHECK-DECL: VarDecl=foo:35:5 + +// RUN: c-index-test -cursor-at=%s:21:3 %s | FileCheck -check-prefix=CHECK-MEMBER %s +// CHECK-MEMBER: FieldDecl=member:21:7 (Definition) +// CHECK-MEMBER-NEXT: Completion string: {ResultType int}{TypedText member} + +// RUN: c-index-test -cursor-at=%s:38:12 -cursor-at=%s:39:5 %s | FileCheck -check-prefix=CHECK-CXXCATCH %s +// CHECK-CXXCATCH: TypeRef=struct X:3:8 +// CHECK-CXXCATCH-NEXT: TypeRef=struct X:3:8 + +// RUN: c-index-test -test-load-source-usrs local %s | FileCheck -check-prefix=CHECK-USR %s +// CHECK-USR: get-cursor.cpp c:get-cursor.cpp@472@F@test#@e Extent=[38:12 - 38:15] +// CHECK-USR: get-cursor.cpp c:get-cursor.cpp@483@F@test#@x Extent=[39:5 - 39:8] diff --git a/clang/test/Index/get-cursor.m b/clang/test/Index/get-cursor.m new file mode 100644 index 0000000..5ac3375 --- /dev/null +++ b/clang/test/Index/get-cursor.m @@ -0,0 +1,104 @@ +// Test is line- and column-sensitive. Run lines are below. + +@interface rdar9771715 +@property (readonly) int foo1; +@property (readwrite) int foo2; +@end + +@class Foo; + +@interface rdar9535717 { + __weak Foo *foo; +} +@end + +@interface Test1 { + id _name; +} +@end +@interface Test1 () +- (id)name; +@end +@interface Test1 () +@property (copy) id name; +@end +@implementation Test1 +@synthesize name = _name; +@end + +@interface rdar10902015 +@end + +@implementation rdar10902015 + +struct S { int x; }; + +-(void)mm:(struct S*)s { + rdar10902015 *i = 0; + s->x = 0; + Test1 *test1; + test1.name = 0; +} +@end + +@interface Test2 +-(int)implicitProp; +-(void)setImplicitProp:(int)x; +@end + +void foo1(Test2 *test2) { + int x = test2.implicitProp; + test2.implicitProp = x; + ++test2.implicitProp; +} + +@interface Test3 +-(void)setFoo:(int)x withBar:(int)y; +@end + +void foo3(Test3 *test3) { + [test3 setFoo:2 withBar:4]; +} + +@interface Test4 +@end +@interface Test4(Dido) +@end +@implementation Test4(Dido) +@end + +@class Forw1, Forw2, Forw3; + +// RUN: c-index-test -cursor-at=%s:4:28 -cursor-at=%s:5:28 %s | FileCheck -check-prefix=CHECK-PROP %s +// CHECK-PROP: ObjCPropertyDecl=foo1:4:26 +// CHECK-PROP: ObjCPropertyDecl=foo2:5:27 + +// RUN: c-index-test -cursor-at=%s:11:11 %s -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s +// CHECK-WITH-WEAK: ObjCClassRef=Foo:8:8 + +// RUN: c-index-test -cursor-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-METHOD %s +// CHECK-METHOD: 20:7 ObjCInstanceMethodDecl=name:20:7 Extent=[20:1 - 20:12] + +// RUN: c-index-test -cursor-at=%s:37:17 %s | FileCheck -check-prefix=CHECK-IN-IMPL %s +// CHECK-IN-IMPL: VarDecl=i:37:17 + +// RUN: c-index-test -cursor-at=%s:38:6 -cursor-at=%s:40:11 \ +// RUN: -cursor-at=%s:50:20 -cursor-at=%s:51:15 -cursor-at=%s:52:20 %s | FileCheck -check-prefix=CHECK-MEMBERREF %s +// CHECK-MEMBERREF: 38:6 MemberRefExpr=x:34:16 SingleRefName=[38:6 - 38:7] RefName=[38:6 - 38:7] Extent=[38:3 - 38:7] +// CHECK-MEMBERREF: 40:9 MemberRefExpr=name:23:21 Extent=[40:3 - 40:13] Spelling=name ([40:9 - 40:13]) +// CHECK-MEMBERREF: 50:17 MemberRefExpr=implicitProp:45:7 Extent=[50:11 - 50:29] Spelling=implicitProp ([50:17 - 50:29]) +// CHECK-MEMBERREF: 51:9 MemberRefExpr=setImplicitProp::46:8 Extent=[51:3 - 51:21] Spelling=setImplicitProp: ([51:9 - 51:21]) +// CHECK-MEMBERREF: 52:11 MemberRefExpr=setImplicitProp::46:8 Extent=[52:5 - 52:23] Spelling=setImplicitProp: ([52:11 - 52:23]) + +// RUN: c-index-test -cursor-at=%s:56:24 -cursor-at=%s:60:14 \ +// RUN: -cursor-at=%s:65:20 -cursor-at=%s:67:25 \ +// RUN: -cursor-at=%s:70:10 -cursor-at=%s:70:16 -cursor-at=%s:70:25 \ +// RUN: %s | FileCheck -check-prefix=CHECK-SPELLRANGE %s +// CHECK-SPELLRANGE: 56:8 ObjCInstanceMethodDecl=setFoo:withBar::56:8 Extent=[56:1 - 56:37] Spelling=setFoo:withBar: ([56:8 - 56:14][56:22 - 56:29]) Selector index=1 +// CHECK-SPELLRANGE: 60:3 ObjCMessageExpr=setFoo:withBar::56:8 Extent=[60:3 - 60:29] Spelling=setFoo:withBar: ([60:10 - 60:16][60:19 - 60:26]) Selector index=0 +// CHECK-SPELLRANGE: 65:12 ObjCCategoryDecl=Dido:65:12 Extent=[65:1 - 66:5] Spelling=Dido ([65:18 - 65:22]) +// CHECK-SPELLRANGE: 67:17 ObjCCategoryImplDecl=Dido:67:17 (Definition) Extent=[67:1 - 68:2] Spelling=Dido ([67:23 - 67:27]) + +// CHECK-SPELLRANGE: 70:8 ObjCClassRef=Forw1:70:8 Extent=[70:8 - 70:13] Spelling=Forw1 ([70:8 - 70:13]) +// CHECK-SPELLRANGE: 70:15 ObjCClassRef=Forw2:70:15 Extent=[70:15 - 70:20] Spelling=Forw2 ([70:15 - 70:20]) +// CHECK-SPELLRANGE: 70:22 ObjCClassRef=Forw3:70:22 Extent=[70:22 - 70:27] Spelling=Forw3 ([70:22 - 70:27]) diff --git a/clang/test/Index/getcursor-pp-pch.c b/clang/test/Index/getcursor-pp-pch.c new file mode 100644 index 0000000..d68384c --- /dev/null +++ b/clang/test/Index/getcursor-pp-pch.c @@ -0,0 +1,43 @@ + + + +typedef int T; +void OBSCURE(func)(int x) { + OBSCURE(T) DECORATION value; +} + + +// Without PCH +// RUN: c-index-test -cursor-at=%s.h:1:11 \ +// RUN: -cursor-at=%s.h:2:14 \ +// RUN: -cursor-at=%s.h:4:5 \ +// RUN: -cursor-at=%s.h:5:5 \ +// RUN: -cursor-at=%s.h:5:14 \ +// RUN: -cursor-at=%s:5:7 \ +// RUN: -cursor-at=%s:6:6 \ +// RUN: -cursor-at=%s:6:19 \ +// RUN: -include %s.h %s | FileCheck %s + +// With PCH +// RUN: c-index-test -write-pch %t.h.pch %s.h -Xclang -detailed-preprocessing-record +// RUN: c-index-test -cursor-at=%s.h:1:11 \ +// RUN: -cursor-at=%s.h:2:14 \ +// RUN: -cursor-at=%s.h:4:5 \ +// RUN: -cursor-at=%s.h:5:5 \ +// RUN: -cursor-at=%s.h:5:14 \ +// RUN: -cursor-at=%s:5:7 \ +// RUN: -cursor-at=%s:6:6 \ +// RUN: -cursor-at=%s:6:19 \ +// RUN: -include %t.h %s | FileCheck %s + +// From header +// CHECK: macro definition=OBSCURE +// CHECK: macro definition=DECORATION +// CHECK: macro expansion=DECORATION:2:9 +// CHECK: macro expansion=OBSCURE:1:9 +// CHECK: macro expansion=DECORATION:2:9 + +// From main file +// CHECK: macro expansion=OBSCURE:1:9 +// CHECK: macro expansion=OBSCURE:1:9 +// CHECK: macro expansion=DECORATION:2:9 diff --git a/clang/test/Index/getcursor-pp-pch.c.h b/clang/test/Index/getcursor-pp-pch.c.h new file mode 100644 index 0000000..c24a39c --- /dev/null +++ b/clang/test/Index/getcursor-pp-pch.c.h @@ -0,0 +1,5 @@ +#define OBSCURE(X) X +#define DECORATION + +DECORATION +OBSCURE(DECORATION) diff --git a/clang/test/Index/in-class-init.cpp b/clang/test/Index/in-class-init.cpp new file mode 100644 index 0000000..61431ca --- /dev/null +++ b/clang/test/Index/in-class-init.cpp @@ -0,0 +1,6 @@ +struct S { + int field = 2; +}; + +// RUN: c-index-test -test-load-source all -std=c++11 %s | FileCheck %s +// CHECK: 2:7: FieldDecl=field:2:7 (Definition) Extent=[2:3 - 2:16] diff --git a/clang/test/Index/include_test.h b/clang/test/Index/include_test.h new file mode 100644 index 0000000..3c40c8d --- /dev/null +++ b/clang/test/Index/include_test.h @@ -0,0 +1 @@ +#include "include_test_2.h" diff --git a/clang/test/Index/include_test_2.h b/clang/test/Index/include_test_2.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/clang/test/Index/include_test_2.h diff --git a/clang/test/Index/index-attrs.m b/clang/test/Index/index-attrs.m new file mode 100644 index 0000000..09c52ba --- /dev/null +++ b/clang/test/Index/index-attrs.m @@ -0,0 +1,17 @@ +@class Foo; +@interface Bar +@property (retain) __attribute__((iboutletcollection(Foo))) Foo *prop; +@end + +@interface I +-(id)prop __attribute__((annotate("anno"))); +-(void)setProp:(id)p __attribute__((annotate("anno"))); +@property (assign) id prop __attribute__((annotate("anno"))); +@end + +// RUN: c-index-test -index-file %s | FileCheck %s +// CHECK: <attribute>: attribute(iboutletcollection)= [IBOutletCollection=ObjCInterface] + +// CHECK: <attribute>: attribute(annotate)=anno +// CHECK: <getter>: kind: objc-instance-method | name: prop | {{.*}} <attribute>: attribute(annotate)=anno +// CHECK: <setter>: kind: objc-instance-method | name: setProp: | {{.*}} <attribute>: attribute(annotate)=anno diff --git a/clang/test/Index/index-decls.m b/clang/test/Index/index-decls.m new file mode 100644 index 0000000..9e4e620 --- /dev/null +++ b/clang/test/Index/index-decls.m @@ -0,0 +1,30 @@ +@interface I +@property (readonly) id prop; + -(id)prop; +@end + +@interface I() +@property (assign,readwrite) id prop; +@end + +@implementation I +@synthesize prop = _prop; +@end + +rdar://11015325 +@interface I1 +__attribute__((something)) @interface I2 @end +@end + +// RUN: c-index-test -index-file %s > %t +// RUN: FileCheck %s -input-file=%t +// CHECK: [indexDeclaration]: kind: objc-class | name: I | {{.*}} | loc: 1:12 +// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 3:2 +// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 2:25 +// CHECK: [indexDeclaration]: kind: objc-category | name: | {{.*}} | loc: 6:12 +// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 7:33 +// CHECK: [indexDeclaration]: kind: objc-property | name: prop | {{.*}} | loc: 7:33 + +// CHECK: [indexDeclaration]: kind: objc-ivar | name: _prop | {{.*}} | loc: 11:20 +// CHECK: [indexDeclaration]: kind: objc-instance-method | name: prop | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17] +// CHECK: [indexDeclaration]: kind: objc-instance-method | name: setProp: | {{.*}} | loc: 11:13 | {{.*}} | lexical-container: [I:10:17] diff --git a/clang/test/Index/index-invalid-code.m b/clang/test/Index/index-invalid-code.m new file mode 100644 index 0000000..9084533 --- /dev/null +++ b/clang/test/Index/index-invalid-code.m @@ -0,0 +1,8 @@ +struct S { + int { +}; +typedef struct S S; + +// RUN: c-index-test -index-file %s | FileCheck %s +// CHECK: [indexDeclaration]: kind: struct | name: S | +// CHECK-NOT: [indexDeclaration]: kind: struct | name: S | diff --git a/clang/test/Index/index-many-logical-ops.c b/clang/test/Index/index-many-logical-ops.c new file mode 100644 index 0000000..67017de --- /dev/null +++ b/clang/test/Index/index-many-logical-ops.c @@ -0,0 +1,2011 @@ +// RUN: c-index-test -index-file %s | FileCheck %s + +// rdar://10941790 +// Check that we don't get stack overflow trying to index a huge number of +// logical operators. + +// CHECK: [indexDeclaration]: kind: function | name: foo +int foo(int x) { + return + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x && + x; +} diff --git a/clang/test/Index/index-refs.cpp b/clang/test/Index/index-refs.cpp new file mode 100644 index 0000000..77e2af7 --- /dev/null +++ b/clang/test/Index/index-refs.cpp @@ -0,0 +1,121 @@ + +namespace NS { + extern int gx; + typedef int MyInt; +} + +enum { + EnumVal = 1 +}; + +NS::MyInt NS::gx = EnumVal; + +void foo() { + NS::MyInt x; +} + +enum { + SecondVal = EnumVal +}; + +struct S { + S& operator++(); + int operator*(); + S& operator=(int x); + S& operator!=(int x); + S& operator()(int x); +}; + +void foo2(S &s) { + (void)++s; + (void)*s; + s = 3; + (void)(s != 3); + s(3); +} + +namespace NS { + namespace Inn {} + typedef int Foo; +} + +using namespace NS; +using namespace NS::Inn; +using NS::Foo; + +template <typename T1, typename T2> +struct TS { }; + +template <typename T> +struct TS<T, int> { + typedef int MyInt; +}; + +void foo3() { + TS<int, int> s; +} + +const int array_size = 3; +typedef int some_arr[array_size]; + +const int default_param = 3; +void foo4(int p = default_param); + +struct S2 { + int x,y; +}; + +void foo5() { + struct S2 s = { .y = 1, .x = 4}; +} + +// RUN: c-index-test -index-file %s | FileCheck %s +// CHECK: [indexDeclaration]: kind: namespace | name: NS +// CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx +// CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt +// CHECK-NEXT: [indexDeclaration]: kind: enum +// CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: EnumVal +// CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS +// CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS +// CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS +// CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt +// CHECK-NEXT: [indexDeclaration]: kind: enum +// CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: SecondVal +// CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal + +// CHECK: [indexDeclaration]: kind: function | name: foo2 +// CHECK: [indexEntityReference]: kind: c++-instance-method | name: operator++ +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator* +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator= +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator!= +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator() + +// CHECK: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 42:17 +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 43:17 +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: Inn | {{.*}} | loc: 43:21 +// CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 44:7 +// CHECK-NEXT: [indexEntityReference]: kind: typedef | name: Foo | {{.*}} | loc: 44:11 + +// CHECK: [indexDeclaration]: kind: c++-class-template | name: TS | {{.*}} | loc: 47:8 +// CHECK-NEXT: [indexDeclaration]: kind: struct-template-partial-spec | name: TS | USR: c:@SP>1#T@TS>#t0.0#I | {{.*}} | loc: 50:8 +// CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt | USR: c:index-refs.cpp@593@SP>1#T@TS>#t0.0#I@T@MyInt | {{.*}} | loc: 51:15 | semantic-container: [TS:50:8] | lexical-container: [TS:50:8] +/* when indexing implicit instantiations + [indexDeclaration]: kind: struct-template-spec | name: TS | USR: c:@S@TS>#I | {{.*}} | loc: 50:8 + [indexDeclaration]: kind: typedef | name: MyInt | USR: c:index-refs.cpp@593@S@TS>#I@T@MyInt | {{.*}} | loc: 51:15 | semantic-container: [TS:50:8] | lexical-container: [TS:50:8] + */ +// CHECK-NEXT: [indexDeclaration]: kind: function | name: foo3 +/* when indexing implicit instantiations + [indexEntityReference]: kind: struct-template-spec | name: TS | USR: c:@S@TS>#I | {{.*}} | loc: 55:3 +*/ +// CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: TS | USR: c:@ST>2#T#T@TS | {{.*}} | loc: 55:3 + +// CHECK: [indexEntityReference]: kind: variable | name: array_size | {{.*}} | loc: 59:22 +// CHECK: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19 +// CHECK-NOT: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19 + +// CHECK: [indexEntityReference]: kind: field | name: y | {{.*}} | loc: 69:20 +// CHECK-NEXT: [indexEntityReference]: kind: field | name: x | {{.*}} | loc: 69:28 diff --git a/clang/test/Index/index-subscripting-literals.m b/clang/test/Index/index-subscripting-literals.m new file mode 100644 index 0000000..4ecad0b --- /dev/null +++ b/clang/test/Index/index-subscripting-literals.m @@ -0,0 +1,66 @@ +@interface NSArray +- (id)objectAtIndexedSubscript:(int)index; ++ (id)arrayWithObjects:(id *)objects count:(unsigned)count; +@end + +@interface NSMutableArray : NSArray +- (id)objectAtIndexedSubscript:(int)index; +- (void)setObject:(id)object atIndexedSubscript:(int)index; +@end + +@interface NSDictionary +- (id)objectForKeyedSubscript:(id)key; ++ (id)dictionaryWithObjects:(id *)objects forKeys:(id *)keys count:(unsigned)count; +@end + +@interface NSMutableDictionary : NSDictionary +- (void)setObject:(id)object forKeyedSubscript:(id)key; +@end + +@class NSString; + +int idx; +id p; + +id testArray() { + NSMutableArray *array; + array[idx] = p; + NSArray *arr = @[ p, p ]; + return array[idx]; +} + +NSString *key; +id newObject, oldObject; + +void testDict() { + NSMutableDictionary *dictionary; + oldObject = dictionary[key]; + dictionary[key] = newObject; + NSDictionary *dict = @{ key: newObject, key: oldObject }; +} + +// RUN: c-index-test -index-file -target x86_64-apple-macosx10.7 %s | FileCheck %s + +// CHECK: [indexEntityReference]: kind: variable | name: idx | USR: c:@idx | lang: C | cursor: DeclRefExpr=idx:22:5 | loc: 27:9 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: p | USR: c:@p | lang: C | cursor: DeclRefExpr=p:23:4 | loc: 27:16 | <parent>:: kind: function | name: testArray | USR: c:@F@testArray | lang: C | container: [testArray:25:4] | refkind: direct +// CHECK-NEXT: [indexEntityReference]: kind: objc-instance-method | name: setObject:atIndexedSubscript: +// CHECK-NEXT: [indexEntityReference]: kind: objc-class | name: NSArray +// CHECK-NEXT: [indexEntityReference]: kind: objc-class-method | name: arrayWithObjects:count: +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: p | USR: c:@p | lang: C | cursor: DeclRefExpr=p:23:4 | loc: 28:21 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: p | USR: c:@p | lang: C | cursor: DeclRefExpr=p:23:4 | loc: 28:24 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: idx | USR: c:@idx | lang: C | cursor: DeclRefExpr=idx:22:5 | loc: 29:16 +// CHECK-NEXT: [indexEntityReference]: kind: objc-instance-method | name: objectAtIndexedSubscript: +// CHECK-NEXT: [indexDeclaration]: kind: variable | name: key + +// CHECK: [indexEntityReference]: kind: variable | name: oldObject +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: key | USR: c:@key | lang: C | cursor: DeclRefExpr=key:32:11 | loc: 37:26 +// CHECK-NEXT: [indexEntityReference]: kind: objc-instance-method | name: objectForKeyedSubscript: +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: key | USR: c:@key | lang: C | cursor: DeclRefExpr=key:32:11 | loc: 38:14 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: newObject | USR: c:@newObject | lang: C | cursor: DeclRefExpr=newObject:33:4 | loc: 38:21 +// CHECK-NEXT: [indexEntityReference]: kind: objc-instance-method | name: setObject:forKeyedSubscript: +// CHECK-NEXT: [indexEntityReference]: kind: objc-class | name: NSDictionary +// CHECK-NEXT: [indexEntityReference]: kind: objc-class-method | name: dictionaryWithObjects:forKeys:count: +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: key | USR: c:@key | lang: C | cursor: DeclRefExpr=key:32:11 | loc: 39:27 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: newObject | USR: c:@newObject | lang: C | cursor: DeclRefExpr=newObject:33:4 | loc: 39:32 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: key | USR: c:@key | lang: C | cursor: DeclRefExpr=key:32:11 | loc: 39:43 +// CHECK-NEXT: [indexEntityReference]: kind: variable | name: oldObject | USR: c:@oldObject | lang: C | cursor: DeclRefExpr=oldObject:33:15 | loc: 39:48 diff --git a/clang/test/Index/index-suppress-refs.cpp b/clang/test/Index/index-suppress-refs.cpp new file mode 100644 index 0000000..113dd40 --- /dev/null +++ b/clang/test/Index/index-suppress-refs.cpp @@ -0,0 +1,12 @@ + +#include "index-suppress-refs.hpp" + +class Sub : B1, B2 { + typedef B1 Base1; + typedef B2 Base2; +}; + +// RUN: env CINDEXTEST_SUPPRESSREFS=1 c-index-test -index-file %s | FileCheck %s +// CHECK: [indexDeclaration]: kind: c++-class | name: Sub +// CHECK-NOT: [indexEntityReference]: kind: c++-class | name: B1 +// CHECK-NOT: [indexEntityReference]: kind: c++-class | name: B2 diff --git a/clang/test/Index/index-suppress-refs.h b/clang/test/Index/index-suppress-refs.h new file mode 100644 index 0000000..03c5624 --- /dev/null +++ b/clang/test/Index/index-suppress-refs.h @@ -0,0 +1,9 @@ + +@interface I +@end + +@interface B +@end + +@protocol P +@end diff --git a/clang/test/Index/index-suppress-refs.hpp b/clang/test/Index/index-suppress-refs.hpp new file mode 100644 index 0000000..4aab08b --- /dev/null +++ b/clang/test/Index/index-suppress-refs.hpp @@ -0,0 +1,3 @@ + +class B1 {}; +class B2 {}; diff --git a/clang/test/Index/index-suppress-refs.m b/clang/test/Index/index-suppress-refs.m new file mode 100644 index 0000000..46420ee --- /dev/null +++ b/clang/test/Index/index-suppress-refs.m @@ -0,0 +1,44 @@ + +#include "index-suppress-refs.h" + +#define TYPEDEF(x) typedef int x +TYPEDEF(MyInt); + +MyInt gx; + +@class I; + +@interface I(cat) +-(I*)meth; +@end + +@class I; + +@interface S : B<P> +-(void)meth:(B*)b :(id<P>)p; +@end + +// RUN: env CINDEXTEST_SUPPRESSREFS=1 c-index-test -index-file %s | FileCheck %s +// CHECK: [indexDeclaration]: kind: objc-class | name: I +// CHECK-NEXT: <ObjCContainerInfo>: kind: interface +// CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: B +// CHECK-NEXT: <ObjCContainerInfo>: kind: interface +// CHECK-NEXT: [indexDeclaration]: kind: objc-protocol | name: P +// CHECK-NEXT: <ObjCContainerInfo>: kind: interface +// CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt +// CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx +// CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: I +// CHECK-NEXT: <ObjCContainerInfo>: kind: forward-ref +// CHECK-NEXT: [indexDeclaration]: kind: objc-category | name: cat +// CHECK-NEXT: <ObjCContainerInfo>: kind: interface +// CHECK-NEXT: <ObjCCategoryInfo>: class: kind: objc-class | name: I +// CHECK-NEXT: [indexDeclaration]: kind: objc-instance-method | name: meth +// CHECK-NOT: [indexEntityReference]: kind: objc-class | name: I +// CHECK-NOT: [indexDeclaration]: kind: objc-class | name: I +// CHECK-NEXT: [indexDeclaration]: kind: objc-class | name: S +// CHECK-NEXT: <ObjCContainerInfo>: kind: interface +// CHECK-NEXT: <base>: kind: objc-class | name: B +// CHECK-NEXT: <protocol>: kind: objc-protocol | name: P +// CHECK-NEXT: [indexDeclaration]: kind: objc-instance-method | name: meth:: +// CHECK-NOT: [indexEntityReference]: kind: objc-class | name: B +// CHECK-NOT: [indexEntityReference]: kind: objc-protocol | name: P
\ No newline at end of file diff --git a/clang/test/Index/index-templates.cpp b/clang/test/Index/index-templates.cpp new file mode 100644 index 0000000..05068df --- /dev/null +++ b/clang/test/Index/index-templates.cpp @@ -0,0 +1,207 @@ +// Test is line- and column-sensitive. See run lines below. + +template<typename T, T Value, template<typename U, U ValU> class X> +void f(X<T, Value> x); + +template<typename T> class allocator; + +template<typename T, typename Alloc = allocator<T> > +class vector { + void clear(); +}; + +template<typename T> +class vector<T*> { }; + +struct Z1 { }; + +template class vector<Z1>; + +struct Z2 { }; + +template<> +class vector<Z2> { + void clear(); +}; + +template<typename T, typename U> +struct Y { + using typename T::type; + using U::operator Z2; +}; + +struct Z3 { }; + +const unsigned OneDimension = 1; +template<typename T, unsigned Dimensions = OneDimension> +struct array { }; + +template<template<typename, unsigned> class DataStructure = array> +struct storage { }; + +typedef unsigned Unsigned; + +template<typename T, Unsigned Value> +struct value_c; + +template class vector<int*>; + +struct Z4 { + template<typename T> T getAs(); +}; + +void template_exprs() { + f<Unsigned, OneDimension, array>(array<Unsigned, OneDimension>()); + Z4().getAs<Unsigned>(); +} + +template<typename T> void swap(T&, T&); +template<typename T, typename U> void swap(Y<T, U>&, Y<T, U>&); +void swap(Z4&, Z4&); + +struct Z5 { + int f(int); + float f(float); +}; + +template<typename T> +void unresolved_exprs(T &x) { + swap(x, x); + Z5 z5; + z5.f(x); + swap<T>(x, x); +} + +template<typename T, typename U> +struct Pair { + T first; + U second; +}; + +template<typename T, typename U> +void init_list(T t, U u) { + typedef U second_type; + + Pair<T, U> p = { t, second_type(u) }; +} + +template<typename T> +struct compare { }; + +template<typename Key, typename Value, + typename Comparison = compare<Pair<Key, Value> >, + typename Allocator = allocator<Pair<Key, Value> > > +struct map; + +void f(map<Z4, Pair<int, Z4> >); + +template class Pair<int, int>; + +template<typename T, typename U> +struct SuperPair : Pair<int, int>, Pair<T, U> { }; + +// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing %s | FileCheck -check-prefix=CHECK-LOAD %s +// CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22] +// CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:10 - 3:20] +// CHECK-LOAD: index-templates.cpp:3:24: NonTypeTemplateParameter=Value:3:24 (Definition) Extent=[3:22 - 3:29] +// FIXME: Need the template type parameter here +// CHECK-LOAD: index-templates.cpp:3:66: TemplateTemplateParameter=X:3:66 (Definition) Extent=[3:31 - 3:67] +// CHECK-LOAD: index-templates.cpp:4:20: ParmDecl=x:4:20 (Definition) Extent=[4:8 - 4:21] +// CHECK-LOAD: index-templates.cpp:4:8: TemplateRef=X:3:66 Extent=[4:8 - 4:9] +// FIXME: Need the template type parameter here +// CHECK-LOAD: index-templates.cpp:4:13: DeclRefExpr=Value:3:24 Extent=[4:13 - 4:18] +// CHECK-LOAD: index-templates.cpp:6:28: ClassTemplate=allocator:6:28 Extent=[6:1 - 6:37] +// CHECK-LOAD: index-templates.cpp:6:19: TemplateTypeParameter=T:6:19 (Definition) Extent=[6:10 - 6:20] +// CHECK-LOAD: index-templates.cpp:9:7: ClassTemplate=vector:9:7 (Definition) Extent=[8:1 - 11:2] +// CHECK-LOAD: index-templates.cpp:8:19: TemplateTypeParameter=T:8:19 (Definition) Extent=[8:10 - 8:20] +// CHECK-LOAD: index-templates.cpp:8:31: TemplateTypeParameter=Alloc:8:31 (Definition) Extent=[8:22 - 8:51] +// CHECK-LOAD: index-templates.cpp:8:39: TemplateRef=allocator:6:28 Extent=[8:39 - 8:48] +// CHECK-LOAD: index-templates.cpp:10:8: CXXMethod=clear:10:8 Extent=[10:3 - 10:15] +// CHECK-LOAD: index-templates.cpp:14:7: ClassTemplatePartialSpecialization=vector:14:7 (Definition) [Specialization of vector:9:7] Extent=[13:1 - 14:21] +// CHECK-LOAD: index-templates.cpp:13:19: TemplateTypeParameter=T:13:19 (Definition) Extent=[13:10 - 13:20] +// CHECK-LOAD: index-templates.cpp:16:8: StructDecl=Z1:16:8 (Definition) Extent=[16:1 - 16:14] +// CHECK-LOAD: index-templates.cpp:18:16: ClassDecl=vector:18:16 (Definition) [Specialization of vector:9:7] Extent=[18:1 - 18:26] +// CHECK-LOAD: index-templates.cpp:18:23: TypeRef=struct Z1:16:8 Extent=[18:23 - 18:25] +// CHECK-LOAD-NOT: CXXMethod=clear +// CHECK-LOAD: index-templates.cpp:20:8: StructDecl=Z2:20:8 (Definition) Extent=[20:1 - 20:14] +// CHECK-LOAD: index-templates.cpp:23:7: ClassDecl=vector:23:7 (Definition) [Specialization of vector:9:7] Extent=[22:1 - 25:2] +// CHECK-LOAD: index-templates.cpp:23:14: TypeRef=struct Z2:20:8 Extent=[23:14 - 23:16] +// CHECK-LOAD: index-templates.cpp:24:8: CXXMethod=clear:24:8 Extent=[24:3 - 24:15] +// CHECK-LOAD: index-templates.cpp:28:8: ClassTemplate=Y:28:8 (Definition) Extent=[27:1 - 31:2] +// CHECK-LOAD: index-templates.cpp:27:19: TemplateTypeParameter=T:27:19 (Definition) Extent=[27:10 - 27:20] +// CHECK-LOAD: index-templates.cpp:27:31: TemplateTypeParameter=U:27:31 (Definition) Extent=[27:22 - 27:32] +// CHECK-LOAD: index-templates.cpp:29:21: UsingDeclaration=type:29:21 Extent=[29:3 - 29:25] +// CHECK-LOAD: index-templates.cpp:30:12: UsingDeclaration=operator Z2:30:12 Extent=[30:3 - 30:23] +// CHECK-LOAD: index-templates.cpp:30:21: TypeRef=struct Z2:20:8 Extent=[30:21 - 30:23] +// CHECK-LOAD: index-templates.cpp:35:16: VarDecl=OneDimension:35:16 (Definition) Extent=[35:1 - 35:32] +// CHECK-LOAD: index-templates.cpp:35:31: UnexposedExpr= Extent=[35:31 - 35:32] +// CHECK-LOAD: index-templates.cpp:35:31: IntegerLiteral= Extent=[35:31 - 35:32] +// CHECK-LOAD: index-templates.cpp:37:8: ClassTemplate=array:37:8 (Definition) Extent=[36:1 - 37:17] +// CHECK-LOAD: index-templates.cpp:36:19: TemplateTypeParameter=T:36:19 (Definition) Extent=[36:10 - 36:20] +// CHECK-LOAD: index-templates.cpp:36:31: NonTypeTemplateParameter=Dimensions:36:31 (Definition) Extent=[36:22 - 36:56] +// CHECK-LOAD: index-templates.cpp:36:44: DeclRefExpr=OneDimension:35:16 Extent=[36:44 - 36:56] +// CHECK-LOAD: index-templates.cpp:40:8: ClassTemplate=storage:40:8 (Definition) Extent=[39:1 - 40:19] +// CHECK-LOAD: index-templates.cpp:39:45: TemplateTemplateParameter=DataStructure:39:45 (Definition) Extent=[39:10 - 39:66] +// CHECK-LOAD: index-templates.cpp:39:19: TemplateTypeParameter=:39:19 (Definition) Extent=[39:19 - 39:27] +// CHECK-LOAD: index-templates.cpp:39:37: NonTypeTemplateParameter=:39:37 (Definition) Extent=[39:29 - 39:38] +// CHECK-LOAD: index-templates.cpp:39:61: TemplateRef=array:37:8 Extent=[39:61 - 39:66] +// CHECK-LOAD: index-templates.cpp:42:18: TypedefDecl=Unsigned:42:18 (Definition) Extent=[42:1 - 42:26] +// CHECK-LOAD: index-templates.cpp:45:8: ClassTemplate=value_c:45:8 Extent=[44:1 - 45:15] +// CHECK-LOAD: index-templates.cpp:44:19: TemplateTypeParameter=T:44:19 (Definition) Extent=[44:10 - 44:20] +// CHECK-LOAD: index-templates.cpp:44:31: NonTypeTemplateParameter=Value:44:31 (Definition) Extent=[44:22 - 44:36] +// CHECK-LOAD: index-templates.cpp:44:22: TypeRef=Unsigned:42:18 Extent=[44:22 - 44:30] +// CHECK-LOAD: index-templates.cpp:47:16: ClassDecl=vector:47:16 (Definition) [Specialization of vector:14:7] Extent=[47:1 - 47:28] +// CHECK-LOAD: index-templates.cpp:49:8: StructDecl=Z4:49:8 (Definition) Extent=[49:1 - 51:2] +// CHECK-LOAD: index-templates.cpp:50:26: FunctionTemplate=getAs:50:26 Extent=[50:3 - 50:33] +// CHECK-LOAD: index-templates.cpp:50:21: TemplateTypeParameter=T:50:21 (Definition) Extent=[50:12 - 50:22] +// CHECK-LOAD: index-templates.cpp:53:6: FunctionDecl=template_exprs:53:6 (Definition) +// CHECK-LOAD: index-templates.cpp:54:3: CallExpr=f:4:6 Extent=[54:3 - 54:68] +// CHECK-LOAD: index-templates.cpp:54:3: UnexposedExpr=f:4:6 Extent=[54:3 - 54:35] +// CHECK-LOAD: index-templates.cpp:54:3: DeclRefExpr=f:4:6 RefName=[54:3 - 54:4] RefName=[54:4 - 54:35] Extent=[54:3 - 54:35] +// CHECK-LOAD: index-templates.cpp:54:5: TypeRef=Unsigned:42:18 Extent=[54:5 - 54:13] +// CHECK-LOAD: index-templates.cpp:54:15: DeclRefExpr=OneDimension:35:16 Extent=[54:15 - 54:27] +// CHECK-LOAD: index-templates.cpp:54:29: TemplateRef=array:37:8 Extent=[54:29 - 54:34] +// CHECK-LOAD: index-templates.cpp:55:8: MemberRefExpr=getAs:50:26 SingleRefName=[55:8 - 55:13] RefName=[55:8 - 55:13] Extent=[55:3 - 55:23] +// CHECK-LOAD: index-templates.cpp:55:3: CallExpr=Z4:49:8 Extent=[55:3 - 55:7] +// CHECK-LOAD: index-templates.cpp:55:14: TypeRef=Unsigned:42:18 Extent=[55:14 - 55:22] +// CHECK-LOAD: index-templates.cpp:68:6: FunctionTemplate=unresolved_exprs:68:6 (Definition) +// CHECK-LOAD: index-templates.cpp:69:3: OverloadedDeclRef=swap[60:6, 59:39, 58:27] +// CHECK-LOAD: index-templates.cpp:71:6: OverloadedDeclRef=f[63:7, 64:9] +// CHECK-LOAD: index-templates.cpp:72:3: OverloadedDeclRef=swap[58:27, 59:39] +// CHECK-LOAD: index-templates.cpp:82:6: FunctionTemplate=init_list:82:6 (Definition) +// CHECK-LOAD: index-templates.cpp:85:14: VarDecl=p:85:14 (Definition) +// CHECK-LOAD: index-templates.cpp:85:20: DeclRefExpr=t:82:18 Extent=[85:20 - 85:21] +// CHECK-LOAD: index-templates.cpp:85:23: TypeRef=second_type:83:13 Extent=[85:23 - 85:34] +// CHECK-LOAD: index-templates.cpp:85:35: DeclRefExpr=u:82:23 Extent=[85:35 - 85:36] +// CHECK-LOAD: index-templates.cpp:101:8: ClassTemplate=SuperPair:101:8 (Definition) Extent=[100:1 - 101:50] +// CHECK-LOAD: index-templates.cpp:100:19: TemplateTypeParameter=T:100:19 (Definition) Extent=[100:10 - 100:20] +// CHECK-LOAD: index-templates.cpp:100:31: TemplateTypeParameter=U:100:31 (Definition) Extent=[100:22 - 100:32] +// CHECK-LOAD: index-templates.cpp:101:20: C++ base class specifier=Pair<int, int>:98:16 [access=public isVirtual=false] Extent=[101:20 - 101:34] +// CHECK-LOAD: index-templates.cpp:101:36: C++ base class specifier=Pair<T, U>:76:8 [access=public isVirtual=false] Extent=[101:36 - 101:46] + + +// RUN: c-index-test -test-load-source-usrs all -fno-delayed-template-parsing %s | FileCheck -check-prefix=CHECK-USRS %s +// CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22S0_# Extent=[3:1 - 4:22] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@70 Extent=[3:10 - 3:20] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@82 Extent=[3:22 - 3:29] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@91 Extent=[3:31 - 3:67] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@136@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22S0_#@x Extent=[4:8 - 4:21] +// CHECK-USRS: index-templates.cpp c:@CT>1#T@allocator Extent=[6:1 - 6:37] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@162 Extent=[6:10 - 6:20] +// CHECK-USRS: index-templates.cpp c:@CT>2#T#T@vector Extent=[8:1 - 11:2] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@201 Extent=[8:10 - 8:20] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@213 Extent=[8:22 - 8:51] +// CHECK-USRS: index-templates.cpp c:@CT>2#T#T@vector@F@clear# Extent=[10:3 - 10:15] +// CHECK-USRS: index-templates.cpp c:@CP>1#T@vector>#*t0.0#>@CT>1#T@allocator1S0_ Extent=[13:1 - 14:21] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@289 Extent=[13:10 - 13:20] +// CHECK-USRS: index-templates.cpp c:@S@Z1 Extent=[16:1 - 16:14] +// CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z1#$@C@allocator>#S0_ Extent=[18:1 - 18:26] +// CHECK-USRS: index-templates.cpp c:@S@Z2 Extent=[20:1 - 20:14] +// CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z2#$@C@allocator>#S0_ Extent=[22:1 - 25:2] +// CHECK-USRS: index-templates.cpp c:@C@vector>#$@S@Z2#$@C@allocator>#S0_@F@clear# Extent=[24:3 - 24:15] +// CHECK-USRS: index-templates.cpp c:@ST>2#T#T@Y Extent=[27:1 - 31:2] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@443 Extent=[27:10 - 27:20] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@455 Extent=[27:22 - 27:32] +// CHECK-USRS-NOT: type +// CHECK-USRS: index-templates.cpp c:@S@Z3 Extent=[33:1 - 33:14] +// CHECK-USRS: index-templates.cpp c:@F@f#$@S@map>#$@S@Z4#$@S@Pair>#I#S1_#$@S@compare>#$@S@Pair>#S1_#S2_#$@C@allocator>#S4_# diff --git a/clang/test/Index/initializer-memory.cpp b/clang/test/Index/initializer-memory.cpp new file mode 100644 index 0000000..f085c35 --- /dev/null +++ b/clang/test/Index/initializer-memory.cpp @@ -0,0 +1,16 @@ +// RUN: c-index-test -test-load-source-memory-usage none %s 2>&1 | FileCheck %s + +// rdar://9275920 - We would create millions of Exprs to fill out the initializer. + +double data[1000000] = {0}; +double data_empty_init[1000000] = {}; + +struct S { + S(int); + S(); +}; + +S data2[1000000] = {0}; +S data_empty_init2[1000000] = {}; + +// CHECK: TOTAL = {{.*}} (0.{{.*}} MBytes) diff --git a/clang/test/Index/invalid-code-rdar10451854.m b/clang/test/Index/invalid-code-rdar10451854.m new file mode 100644 index 0000000..1562671 --- /dev/null +++ b/clang/test/Index/invalid-code-rdar10451854.m @@ -0,0 +1,15 @@ +struct { + +@implementation Foo + +- (void)finalize { + NSLog(@"bar"); +} + +- (NSArray *)graphics { +} + +@end + +// Test that we don't crash +// RUN: c-index-test -test-load-source-reparse 3 local %s diff --git a/clang/test/Index/invalid-code-rdar_7833619.m b/clang/test/Index/invalid-code-rdar_7833619.m new file mode 100644 index 0000000..0034539 --- /dev/null +++ b/clang/test/Index/invalid-code-rdar_7833619.m @@ -0,0 +1,4 @@ +// RUN: c-index-test -test-load-source all %s +// All we care about in this test is that it doesn't crash. +typedef r7833619_a (*r7833619_b)(r7833619_c *r7833619_d, r7833619_c *r7833619_e); + diff --git a/clang/test/Index/invalid-rdar-8236270.cpp b/clang/test/Index/invalid-rdar-8236270.cpp new file mode 100644 index 0000000..85a0eaa --- /dev/null +++ b/clang/test/Index/invalid-rdar-8236270.cpp @@ -0,0 +1,11 @@ +// RUN: c-index-test -test-load-source all %s | FileCheck %s + +// This test case previously just crashed the frontend. + +struct abc *P; +int main( + +// CHECK: StructDecl=abc:5:8 Extent=[5:1 - 5:11] +// CHECK: VarDecl=P:5:13 (Definition) Extent=[5:1 - 5:14] +// CHECK: VarDecl=main:6:5 (Definition) Extent=[6:1 - 6:9] + diff --git a/clang/test/Index/linkage.c b/clang/test/Index/linkage.c new file mode 100644 index 0000000..41a1fbd --- /dev/null +++ b/clang/test/Index/linkage.c @@ -0,0 +1,30 @@ +// RUN: c-index-test -test-print-linkage-source %s | FileCheck %s + +enum Baz { Qux = 0 }; +int x; +void foo(); +static int w; +void bar(int y) { + static int z; + int k; +} +extern int n; +static int wibble(int); + +void ena(int (*dio)(int tria)); + +// CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External +// CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External +// CHECK: VarDecl=x:4:5linkage=External +// CHECK: FunctionDecl=foo:5:6linkage=External +// CHECK: VarDecl=w:6:12linkage=Internal +// CHECK: FunctionDecl=bar:7:6 (Definition)linkage=External +// CHECK: ParmDecl=y:7:14 (Definition)linkage=NoLinkage +// CHECK: VarDecl=z:8:14 (Definition)linkage=NoLinkage +// CHECK: VarDecl=k:9:7 (Definition)linkage=NoLinkage +// CHECK: VarDecl=n:11:12linkage=External +// CHECK: FunctionDecl=wibble:12:12linkage=Internal +// CHECK: ParmDecl=:12:22 (Definition)linkage=NoLinkage +// CHECK: FunctionDecl=ena:14:6linkage=External +// CHECK: ParmDecl=dio:14:16 (Definition)linkage=NoLinkage +// CHECK: ParmDecl=tria:14:25 (Definition)linkage=NoLinkage diff --git a/clang/test/Index/load-classes.cpp b/clang/test/Index/load-classes.cpp new file mode 100644 index 0000000..5877019 --- /dev/null +++ b/clang/test/Index/load-classes.cpp @@ -0,0 +1,28 @@ +// Test is line- and column-sensitive; see below. + +struct X { + X(int value); + X(const X& x); + ~X(); + operator X*(); +}; + +X::X(int value) { +} + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: load-classes.cpp:3:8: StructDecl=X:3:8 (Definition) Extent=[3:1 - 8:2] +// CHECK: load-classes.cpp:4:3: CXXConstructor=X:4:3 Extent=[4:3 - 4:15] +// FIXME: missing TypeRef in the constructor name +// CHECK: load-classes.cpp:4:9: ParmDecl=value:4:9 (Definition) Extent=[4:5 - 4:14] +// CHECK: load-classes.cpp:5:3: CXXConstructor=X:5:3 Extent=[5:3 - 5:16] +// FIXME: missing TypeRef in the constructor name +// CHECK: load-classes.cpp:5:14: ParmDecl=x:5:14 (Definition) Extent=[5:5 - 5:15] +// CHECK: load-classes.cpp:5:11: TypeRef=struct X:3:8 Extent=[5:11 - 5:12] +// CHECK: load-classes.cpp:6:3: CXXDestructor=~X:6:3 Extent=[6:3 - 6:7] +// FIXME: missing TypeRef in the destructor name +// CHECK: load-classes.cpp:7:3: CXXConversion=operator struct X *:7:3 Extent=[7:3 - 7:16] +// CHECK: load-classes.cpp:7:12: TypeRef=struct X:3:8 Extent=[7:12 - 7:13] +// CHECK: load-classes.cpp:10:4: CXXConstructor=X:10:4 (Definition) Extent=[10:1 - 11:2] +// CHECK: load-classes.cpp:10:1: TypeRef=struct X:3:8 Extent=[10:1 - 10:2] +// CHECK: load-classes.cpp:10:10: ParmDecl=value:10:10 (Definition) Extent=[10:6 - 10:15] diff --git a/clang/test/Index/load-decls.c b/clang/test/Index/load-decls.c new file mode 100644 index 0000000..e0617c0 --- /dev/null +++ b/clang/test/Index/load-decls.c @@ -0,0 +1,15 @@ +enum Color { + Red, + Green, + Blue, + + Rouge = Red +}; + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: load-decls.c:1:6: EnumDecl=Color:1:6 (Definition) Extent=[1:1 - 7:2] +// CHECK: load-decls.c:2:3: EnumConstantDecl=Red:2:3 (Definition) Extent=[2:3 - 2:6] +// CHECK: load-decls.c:3:3: EnumConstantDecl=Green:3:3 (Definition) Extent=[3:3 - 3:8] +// CHECK: load-decls.c:4:3: EnumConstantDecl=Blue:4:3 (Definition) Extent=[4:3 - 4:7] +// CHECK: load-decls.c:6:3: EnumConstantDecl=Rouge:6:3 (Definition) Extent=[6:3 - 6:14] +// CHECK: load-decls.c:6:11: DeclRefExpr=Red:2:3 Extent=[6:11 - 6:14] diff --git a/clang/test/Index/load-exprs.c b/clang/test/Index/load-exprs.c new file mode 100644 index 0000000..a4723d8 --- /dev/null +++ b/clang/test/Index/load-exprs.c @@ -0,0 +1,81 @@ +typedef int T; +struct X { int a, b; }; +void f(void *ptr) { + T* t_ptr = (T *)ptr; + (void)sizeof(T); + struct X x = (struct X){1, 2}; + void *xx = ptr ? : &x; +} + +int test_blocks(int x) { + __block int y = x; + ^{ + static int z = 0; + y = (++z) + x; + ^{ + ++z; + ++y; + }(); + }(); + return y; +} + +struct Y { + struct X array[3]; +}; + +enum { StartIndex = 1 }; + +void test_members(int aval, int bval) { + struct Y y0 = { .array[StartIndex].b = bval, .array[StartIndex].a = aval }; + __builtin_offsetof(struct Y, array[StartIndex].b); +} + +// RUN: c-index-test -test-load-source all %s -fblocks | FileCheck %s +// CHECK: macro definition=__clang__ +// CHECK: load-exprs.c:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:1 - 1:14] +// CHECK: load-exprs.c:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] +// CHECK: load-exprs.c:2:16: FieldDecl=a:2:16 (Definition) Extent=[2:12 - 2:17] +// CHECK: load-exprs.c:2:19: FieldDecl=b:2:19 (Definition) Extent=[2:12 - 2:20] +// CHECK: load-exprs.c:3:6: FunctionDecl=f:3:6 (Definition) Extent=[3:1 - 8:2] +// CHECK: load-exprs.c:3:14: ParmDecl=ptr:3:14 (Definition) Extent=[3:8 - 3:17] +// CHECK: load-exprs.c:4:6: VarDecl=t_ptr:4:6 (Definition) Extent=[4:3 - 4:22] +// CHECK: load-exprs.c:4:3: TypeRef=T:1:13 Extent=[4:3 - 4:4] +// CHECK: load-exprs.c:4:15: TypeRef=T:1:13 Extent=[4:15 - 4:16] +// CHECK: load-exprs.c:4:19: DeclRefExpr=ptr:3:14 Extent=[4:19 - 4:22] +// CHECK: load-exprs.c:5:16: TypeRef=T:1:13 Extent=[5:16 - 5:17] +// CHECK: load-exprs.c:6:12: VarDecl=x:6:12 (Definition) Extent=[6:3 - 6:32] +// CHECK: load-exprs.c:6:10: TypeRef=struct X:2:8 Extent=[6:10 - 6:11] +// CHECK: load-exprs.c:6:24: TypeRef=struct X:2:8 Extent=[6:24 - 6:25] +// CHECK: load-exprs.c:7:9: VarDecl=xx:7:9 (Definition) Extent=[7:3 - 7:24] +// CHECK: load-exprs.c:7:14: DeclRefExpr=ptr:3:14 Extent=[7:14 - 7:17] +// CHECK: load-exprs.c:7:23: DeclRefExpr=x:6:12 Extent=[7:23 - 7:24] +// CHECK: load-exprs.c:10:5: FunctionDecl=test_blocks:10:5 (Definition) Extent=[10:1 - 21:2] +// CHECK: load-exprs.c:10:21: ParmDecl=x:10:21 (Definition) Extent=[10:17 - 10:22] +// CHECK: load-exprs.c:11:15: VarDecl=y:11:15 (Definition) Extent=[11:3 - 11:20] +// CHECK: load-exprs.c:11:19: DeclRefExpr=x:10:21 Extent=[11:19 - 11:20] +// CHECK: load-exprs.c:12:3: CallExpr= Extent=[12:3 - 19:7] +// CHECK: load-exprs.c:13:17: VarDecl=z:13:17 (Definition) Extent=[13:6 - 13:22] +// CHECK: load-exprs.c:14:6: DeclRefExpr=y:11:15 Extent=[14:6 - 14:7] +// CHECK: load-exprs.c:14:13: DeclRefExpr=z:13:17 Extent=[14:13 - 14:14] +// CHECK: load-exprs.c:14:18: DeclRefExpr=x:10:21 Extent=[14:18 - 14:19] +// CHECK: load-exprs.c:15:6: CallExpr= Extent=[15:6 - 18:9] +// CHECK: load-exprs.c:16:10: DeclRefExpr=z:13:17 Extent=[16:10 - 16:11] +// CHECK: load-exprs.c:17:10: DeclRefExpr=y:11:15 Extent=[17:10 - 17:11] +// CHECK: load-exprs.c:20:10: DeclRefExpr=y:11:15 Extent=[20:10 - 20:11] +// CHECK: load-exprs.c:29:6: FunctionDecl=test_members:29:6 (Definition) +// CHECK: load-exprs.c:30:12: VarDecl=y0:30:12 (Definition) Extent=[30:3 - 30:77] +// CHECK: load-exprs.c:30:10: TypeRef=struct Y:23:8 Extent=[30:10 - 30:11] +// CHECK: load-exprs.c:30:20: MemberRef=array:24:12 Extent=[30:20 - 30:25] +// CHECK: load-exprs.c:30:26: DeclRefExpr=StartIndex:27:8 Extent=[30:26 - 30:36] +// CHECK: load-exprs.c:30:38: MemberRef=b:2:19 Extent=[30:38 - 30:39] +// CHECK: load-exprs.c:30:42: DeclRefExpr=bval:29:33 Extent=[30:42 - 30:46] +// CHECK: load-exprs.c:30:49: MemberRef=array:24:12 Extent=[30:49 - 30:54] +// CHECK: load-exprs.c:30:55: DeclRefExpr=StartIndex:27:8 Extent=[30:55 - 30:65] +// CHECK: load-exprs.c:30:67: MemberRef=a:2:16 Extent=[30:67 - 30:68] +// CHECK: load-exprs.c:30:71: DeclRefExpr=aval:29:23 Extent=[30:71 - 30:75] +// CHECK: load-exprs.c:31:29: TypeRef=struct Y:23:8 Extent=[31:29 - 31:30] +// CHECK: load-exprs.c:31:32: MemberRef=array:24:12 Extent=[31:32 - 31:37] +// CHECK: load-exprs.c:31:38: DeclRefExpr=StartIndex:27:8 Extent=[31:38 - 31:48] +// CHECK: load-exprs.c:31:50: MemberRef=b:2:19 Extent=[31:50 - 31:51] + diff --git a/clang/test/Index/load-namespaces.cpp b/clang/test/Index/load-namespaces.cpp new file mode 100644 index 0000000..49de66a --- /dev/null +++ b/clang/test/Index/load-namespaces.cpp @@ -0,0 +1,50 @@ +// Test is line- and column-sensitive; see below. + +namespace std { + namespace rel_ops { + void f(); + } +} + +namespace std { + void g(); +} + +namespace std98 = std; +namespace std0x = std98; + +using namespace std0x; + +namespace std { + int g(int); +} + +using std::g; + +void std::g() { +} + +namespace my_rel_ops = std::rel_ops; + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Extent=[3:1 - 7:2] +// CHECK: load-namespaces.cpp:4:13: Namespace=rel_ops:4:13 (Definition) Extent=[4:3 - 6:4] +// CHECK: load-namespaces.cpp:5:10: FunctionDecl=f:5:10 Extent=[5:5 - 5:13] +// CHECK: load-namespaces.cpp:9:11: Namespace=std:9:11 (Definition) Extent=[9:1 - 11:2] +// CHECK: load-namespaces.cpp:10:8: FunctionDecl=g:10:8 Extent=[10:3 - 10:11] +// CHECK: load-namespaces.cpp:13:11: NamespaceAlias=std98:13:11 Extent=[13:1 - 13:22] +// CHECK: load-namespaces.cpp:13:19: NamespaceRef=std:3:11 Extent=[13:19 - 13:22] +// CHECK: load-namespaces.cpp:14:11: NamespaceAlias=std0x:14:11 Extent=[14:1 - 14:24] +// CHECK: load-namespaces.cpp:14:19: NamespaceRef=std98:13:11 Extent=[14:19 - 14:24] +// CHECK: load-namespaces.cpp:16:17: UsingDirective=:16:17 Extent=[16:1 - 16:22] +// CHECK: load-namespaces.cpp:16:17: NamespaceRef=std0x:14:11 Extent=[16:17 - 16:22] +// CHECK: load-namespaces.cpp:18:11: Namespace=std:18:11 (Definition) Extent=[18:1 - 20:2] +// CHECK: load-namespaces.cpp:19:7: FunctionDecl=g:19:7 Extent=[19:3 - 19:13] +// CHECK: load-namespaces.cpp:19:12: ParmDecl=:19:12 (Definition) Extent=[19:9 - 19:13] +// CHECK: load-namespaces.cpp:22:12: UsingDeclaration=g[19:7, 10:8] Extent=[22:1 - 22:13] +// CHECK: load-namespaces.cpp:22:7: NamespaceRef=std:18:11 Extent=[22:7 - 22:10] +// CHECK: load-namespaces.cpp:24:11: FunctionDecl=g:24:11 (Definition) Extent=[24:1 - 25:2] +// CHECK: load-namespaces.cpp:24:6: NamespaceRef=std:18:11 Extent=[24:6 - 24:9] +// CHECK: load-namespaces.cpp:27:11: NamespaceAlias=my_rel_ops:27:11 Extent=[27:1 - 27:36] +// CHECK: load-namespaces.cpp:27:24: NamespaceRef=std:18:11 Extent=[27:24 - 27:27] +// CHECK: load-namespaces.cpp:27:29: NamespaceRef=rel_ops:4:13 Extent=[27:29 - 27:36] diff --git a/clang/test/Index/load-stmts.cpp b/clang/test/Index/load-stmts.cpp new file mode 100644 index 0000000..ed0debd --- /dev/null +++ b/clang/test/Index/load-stmts.cpp @@ -0,0 +1,231 @@ +typedef int T; +struct X { int a, b; }; +void f(int x) { + for (T y = x; T z = x; ++x) { + } + if (T *z2 = &x) { } + while (T *z3 = &x) { } + switch (T z4 = x) { + case 17: break; + } +} + +// Test handling of C++ base specifiers. +class A { + void doA(); +}; + +class B { + void doB(); +}; + +class C : public A, private B { + void doC(); +}; + +class D : virtual public C, virtual private A {}; + +namespace std { + class type_info { }; +} + +void test_exprs(C *c) { + int typeid_marker; + typeid(C); + typeid(c); + typedef int Integer; + Integer *int_ptr; + int_ptr->Integer::~Integer(); +} + +namespace N { + int f(int); + float f(float); + + template<typename T> T g(T); + template<typename T> T g(T*); +} + +template<typename T> +void test_dependent_exprs(T t) { + N::f(t); + typedef T type; + N::g<type>(t); + type::template f<type*>(t); + t->type::template f<type*>(); +} + +struct Y { + int f(int); + float f(float); + + template<typename T> T g(T); + template<typename T> T g(T*); +}; + +template<typename T> +void test_more_dependent_exprs(T t, Y y) { + y.Y::f(t); + typedef T type; + y.g<type>(t); +} + +struct Pair { + Pair(int, int); +}; + +void *operator new(__SIZE_TYPE__, void*) throw(); + +void test_more_exprs(void *mem, int i, int j) { + new (mem) Pair(i, j); + typedef int Integer; + (void)Integer(i); + (Integer)i; + Integer(); +} + +template<typename T> +void test_even_more_dependent_exprs(T t, Y y) { + typedef T type; + (void)type(t, y); + (void)__has_nothrow_assign(type); +} + +struct Base { + Base(int); +}; + +struct Derived : public Base { + Derived(int x); + int member; +}; + +Derived::Derived(int x) + : member(x), Base(x) { +} + +void considered_harmful(int x) { + start_over: + void *ptr = &&start_over; + if (x > 17) + goto *ptr; + else + goto start_over; +} + +void casts(int *ip) { + (void)reinterpret_cast<float *>(ip); +} + +// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing %s | FileCheck %s +// CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:1 - 1:14] +// CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23] +// CHECK: load-stmts.cpp:2:16: FieldDecl=a:2:16 (Definition) Extent=[2:12 - 2:17] +// CHECK: load-stmts.cpp:2:19: FieldDecl=b:2:19 (Definition) Extent=[2:12 - 2:20] +// CHECK: load-stmts.cpp:3:6: FunctionDecl=f:3:6 (Definition) Extent=[3:1 - 11:2] +// CHECK: load-stmts.cpp:3:12: ParmDecl=x:3:12 (Definition) Extent=[3:8 - 3:13] +// CHECK: load-stmts.cpp:4:10: VarDecl=y:4:10 (Definition) Extent=[4:8 - 4:15] +// CHECK: load-stmts.cpp:4:8: TypeRef=T:1:13 Extent=[4:8 - 4:9] +// CHECK: load-stmts.cpp:4:14: DeclRefExpr=x:3:12 Extent=[4:14 - 4:15] +// CHECK: load-stmts.cpp:4:19: VarDecl=z:4:19 (Definition) Extent=[4:17 - 4:24] +// CHECK: load-stmts.cpp:4:17: TypeRef=T:1:13 Extent=[4:17 - 4:18] +// CHECK: load-stmts.cpp:4:23: DeclRefExpr=x:3:12 Extent=[4:23 - 4:24] +// CHECK: load-stmts.cpp:4:19: UnexposedExpr=z:4:19 Extent=[4:19 - 4:20] +// CHECK: load-stmts.cpp:4:19: DeclRefExpr=z:4:19 Extent=[4:19 - 4:20] +// CHECK: load-stmts.cpp:4:26: UnaryOperator= Extent=[4:26 - 4:29] +// CHECK: load-stmts.cpp:4:28: DeclRefExpr=x:3:12 Extent=[4:28 - 4:29] +// CHECK: load-stmts.cpp:6:10: VarDecl=z2:6:10 (Definition) Extent=[6:7 - 6:17] +// CHECK: load-stmts.cpp:6:7: TypeRef=T:1:13 Extent=[6:7 - 6:8] +// CHECK: load-stmts.cpp:6:15: UnaryOperator= Extent=[6:15 - 6:17] +// CHECK: load-stmts.cpp:6:16: DeclRefExpr=x:3:12 Extent=[6:16 - 6:17] +// CHECK: load-stmts.cpp:6:10: UnexposedExpr=z2:6:10 Extent=[6:10 - 6:12] +// CHECK: load-stmts.cpp:6:10: DeclRefExpr=z2:6:10 Extent=[6:10 - 6:12] +// CHECK: load-stmts.cpp:7:13: VarDecl=z3:7:13 (Definition) Extent=[7:10 - 7:20] +// CHECK: load-stmts.cpp:7:10: TypeRef=T:1:13 Extent=[7:10 - 7:11] +// CHECK: load-stmts.cpp:7:18: UnaryOperator= Extent=[7:18 - 7:20] +// CHECK: load-stmts.cpp:7:19: DeclRefExpr=x:3:12 Extent=[7:19 - 7:20] +// CHECK: load-stmts.cpp:7:13: UnexposedExpr=z3:7:13 Extent=[7:13 - 7:15] +// CHECK: load-stmts.cpp:7:13: DeclRefExpr=z3:7:13 Extent=[7:13 - 7:15] +// CHECK: load-stmts.cpp:8:13: VarDecl=z4:8:13 (Definition) Extent=[8:11 - 8:19] +// CHECK: load-stmts.cpp:8:11: TypeRef=T:1:13 Extent=[8:11 - 8:12] +// CHECK: load-stmts.cpp:8:18: DeclRefExpr=x:3:12 Extent=[8:18 - 8:19] +// CHECK: load-stmts.cpp:8:13: DeclRefExpr=z4:8:13 Extent=[8:13 - 8:15] +// CHECK: load-stmts.cpp:9:8: IntegerLiteral= Extent=[9:8 - 9:10] +// CHECK: load-stmts.cpp:14:7: ClassDecl=A:14:7 (Definition) Extent=[14:1 - 16:2] +// CHECK: load-stmts.cpp:15:8: CXXMethod=doA:15:8 Extent=[15:3 - 15:13] +// CHECK: load-stmts.cpp:18:7: ClassDecl=B:18:7 (Definition) Extent=[18:1 - 20:2] +// CHECK: load-stmts.cpp:19:8: CXXMethod=doB:19:8 Extent=[19:3 - 19:13] +// CHECK: load-stmts.cpp:22:7: ClassDecl=C:22:7 (Definition) Extent=[22:1 - 24:2] +// CHECK: load-stmts.cpp:22:18: C++ base class specifier=class A:14:7 [access=public isVirtual=false] +// CHECK: load-stmts.cpp:22:29: C++ base class specifier=class B:18:7 [access=private isVirtual=false] +// CHECK: load-stmts.cpp:23:8: CXXMethod=doC:23:8 Extent=[23:3 - 23:13] +// CHECK: load-stmts.cpp:26:7: ClassDecl=D:26:7 (Definition) Extent=[26:1 - 26:49] +// CHECK: load-stmts.cpp:26:26: C++ base class specifier=class C:22:7 [access=public isVirtual=true] +// CHECK: load-stmts.cpp:26:45: C++ base class specifier=class A:14:7 [access=private isVirtual=true] +// CHECK: load-stmts.cpp:33:7: VarDecl=typeid_marker:33:7 (Definition) +// CHECK: load-stmts.cpp:34:10: TypeRef=class C:22:7 Extent=[34:10 - 34:11] +// CHECK: load-stmts.cpp:35:10: DeclRefExpr=c:32:20 Extent=[35:10 - 35:11] +// CHECK: load-stmts.cpp:37:12: VarDecl=int_ptr:37:12 (Definition) Extent=[37:3 - 37:19] +// CHECK: load-stmts.cpp:37:3: TypeRef=Integer:36:15 Extent=[37:3 - 37:10] +// CHECK: load-stmts.cpp:38:3: DeclRefExpr=int_ptr:37:12 Extent=[38:3 - 38:10] +// CHECK: load-stmts.cpp:38:12: TypeRef=Integer:36:15 Extent=[38:12 - 38:19] +// CHECK: load-stmts.cpp:38:22: TypeRef=Integer:36:15 Extent=[38:22 - 38:29] +// CHECK: load-stmts.cpp:50:6: FunctionTemplate=test_dependent_exprs:50:6 (Definition) +// CHECK: load-stmts.cpp:51:3: CallExpr= Extent=[51:3 - 51:10] +// CHECK: load-stmts.cpp:51:3: NamespaceRef=N:41:11 Extent=[51:3 - 51:4] +// CHECK: load-stmts.cpp:51:8: DeclRefExpr=t:50:29 Extent=[51:8 - 51:9] +// CHECK: load-stmts.cpp:52:13: TypedefDecl=type:52:13 (Definition) Extent=[52:3 - 52:17] +// CHECK: load-stmts.cpp:53:3: CallExpr= Extent=[53:3 - 53:16] +// CHECK: load-stmts.cpp:53:3: NamespaceRef=N:41:11 Extent=[53:3 - 53:4] +// CHECK: load-stmts.cpp:53:8: TypeRef=type:52:13 Extent=[53:8 - 53:12] +// CHECK: load-stmts.cpp:53:14: DeclRefExpr=t:50:29 Extent=[53:14 - 53:15] +// CHECK: load-stmts.cpp:54:3: CallExpr= Extent=[54:3 - 54:29] +// CHECK: load-stmts.cpp:54:3: TypeRef=type:52:13 Extent=[54:3 - 54:7] +// CHECK: load-stmts.cpp:54:20: TypeRef=type:52:13 Extent=[54:20 - 54:24] +// CHECK: load-stmts.cpp:54:27: DeclRefExpr=t:50:29 Extent=[54:27 - 54:28] +// CHECK: load-stmts.cpp:55:3: CallExpr= Extent=[55:3 - 55:31] +// CHECK: load-stmts.cpp:55:3: DeclRefExpr=t:50:29 Extent=[55:3 - 55:4] +// CHECK: load-stmts.cpp:55:23: TypeRef=type:52:13 Extent=[55:23 - 55:27] +// CHECK: load-stmts.cpp:67:6: FunctionTemplate=test_more_dependent_exprs:67:6 (Definition) +// CHECK: load-stmts.cpp:68:3: CallExpr= Extent=[68:3 - 68:12] +// CHECK: load-stmts.cpp:68:3: DeclRefExpr=y:67:39 Extent=[68:3 - 68:4] +// CHECK: load-stmts.cpp:68:5: TypeRef=struct Y:58:8 Extent=[68:5 - 68:6] +// CHECK: load-stmts.cpp:68:10: DeclRefExpr=t:67:34 Extent=[68:10 - 68:11] +// CHECK: load-stmts.cpp:70:3: CallExpr= Extent=[70:3 - 70:15] +// CHECK: load-stmts.cpp:70:3: DeclRefExpr=y:67:39 Extent=[70:3 - 70:4] +// CHECK: load-stmts.cpp:70:7: TypeRef=type:69:13 Extent=[70:7 - 70:11] +// CHECK: load-stmts.cpp:70:13: DeclRefExpr=t:67:34 Extent=[70:13 - 70:14] +// CHECK: load-stmts.cpp:79:6: FunctionDecl=test_more_exprs:79:6 (Definition) +// CHECK: load-stmts.cpp:80:8: DeclRefExpr=mem:79:28 Extent=[80:8 - 80:11] +// CHECK: load-stmts.cpp:80:13: TypeRef=struct Pair:73:8 Extent=[80:13 - 80:17] +// CHECK: load-stmts.cpp:80:18: DeclRefExpr=i:79:37 Extent=[80:18 - 80:19] +// CHECK: load-stmts.cpp:80:21: DeclRefExpr=j:79:44 Extent=[80:21 - 80:22] +// CHECK: load-stmts.cpp:82:9: TypeRef=Integer:81:15 Extent=[82:9 - 82:16] +// CHECK: load-stmts.cpp:82:17: DeclRefExpr=i:79:37 Extent=[82:17 - 82:18] +// CHECK: load-stmts.cpp:83:3: CStyleCastExpr= Extent=[83:3 - 83:13] +// CHECK: load-stmts.cpp:83:4: TypeRef=Integer:81:15 Extent=[83:4 - 83:11] +// CHECK: load-stmts.cpp:83:12: UnexposedExpr=i:79:37 Extent=[83:12 - 83:13] +// CHECK: load-stmts.cpp:83:12: DeclRefExpr=i:79:37 Extent=[83:12 - 83:13] +// CHECK: load-stmts.cpp:84:3: UnexposedExpr= Extent=[84:3 - 84:12] +// CHECK: load-stmts.cpp:84:3: TypeRef=Integer:81:15 Extent=[84:3 - 84:10] +// CHECK: load-stmts.cpp:90:9: TypeRef=type:89:13 Extent=[90:9 - 90:13] +// CHECK: load-stmts.cpp:90:14: DeclRefExpr=t:88:39 Extent=[90:14 - 90:15] +// CHECK: load-stmts.cpp:90:17: DeclRefExpr=y:88:44 Extent=[90:17 - 90:18] +// CHECK: load-stmts.cpp:91:9: UnexposedExpr= Extent=[91:9 - 91:35] +// CHECK: load-stmts.cpp:91:30: TypeRef=type:89:13 Extent=[91:30 - 91:34] +// CHECK: load-stmts.cpp:103:10: CXXConstructor=Derived:103:10 (Definition) +// CHECK: load-stmts.cpp:103:1: TypeRef=struct Derived:98:8 Extent=[103:1 - 103: +// FIXME: Missing TypeRef for constructor name. +// CHECK: load-stmts.cpp:103:22: ParmDecl=x:103:22 (Definition) +// CHECK: load-stmts.cpp:104:5: MemberRef=member:100:7 Extent=[104:5 - 104:11] +// CHECK: load-stmts.cpp:104:12: DeclRefExpr=x:103:22 Extent=[104:12 - 104:13] +// CHECK: load-stmts.cpp:104:16: TypeRef=struct Base:94:8 Extent=[104:16 - 104:2 +// CHECK: load-stmts.cpp:104:16: CallExpr=Base:95:3 Extent=[104:16 - 104:23] +// CHECK: load-stmts.cpp:104:21: DeclRefExpr=x:103:22 Extent=[104:21 - 104:22] +// CHECK: load-stmts.cpp:107:6: FunctionDecl=considered_harmful:107:6 (Definition) +// CHECK: load-stmts.cpp:108:2: LabelStmt=start_over Extent=[108:2 - 109:28] +// CHECK: load-stmts.cpp:109:17: LabelRef=start_over:108:2 Extent=[109:17 - 109:27] +// CHECK: load-stmts.cpp:113:10: LabelRef=start_over:108:2 Extent=[113:10 - 113:20] +// CHECK: load-stmts.cpp:117:35: UnexposedExpr=ip:116:17 Extent=[117:35 - 117:37] +// CHECK: load-stmts.cpp:117:35: DeclRefExpr=ip:116:17 Extent=[117:35 - 117:37] + diff --git a/clang/test/Index/local-symbols.m b/clang/test/Index/local-symbols.m new file mode 100644 index 0000000..b4eb262 --- /dev/null +++ b/clang/test/Index/local-symbols.m @@ -0,0 +1,44 @@ +// RUN: c-index-test -test-load-source local %s | FileCheck %s + +// From: <rdar://problem/7568881> +// The method 'bar' was also being reported outside the @implementation + +@interface Foo { + id x; +} +- (id) bar; +@end + +@implementation Foo +- (id) bar { + return 0; +} +@end + +// From: <rdar://problem/8380046> + +@protocol Prot8380046 +@end + +@interface R8380046 +@end + +@interface R8380046 () <Prot8380046> +@end + +// CHECK: local-symbols.m:6:12: ObjCInterfaceDecl=Foo:6:12 Extent=[6:1 - 10:5] +// CHECK: local-symbols.m:7:6: ObjCIvarDecl=x:7:6 (Definition) Extent=[7:3 - 7:7] +// CHECK: local-symbols.m:7:3: TypeRef=id:0:0 Extent=[7:3 - 7:5] +// CHECK: local-symbols.m:9:8: ObjCInstanceMethodDecl=bar:9:8 Extent=[9:1 - 9:12] +// CHECK: local-symbols.m:9:4: TypeRef=id:0:0 Extent=[9:4 - 9:6] +// CHECK: local-symbols.m:12:17: ObjCImplementationDecl=Foo:12:17 (Definition) Extent=[12:1 - 16:2] +// CHECK: local-symbols.m:13:8: ObjCInstanceMethodDecl=bar:13:8 (Definition) Extent=[13:1 - 15:2] +// CHECK: local-symbols.m:13:4: TypeRef=id:0:0 Extent=[13:4 - 13:6] +// CHECK: local-symbols.m:14:10: UnexposedExpr= Extent=[14:10 - 14:11] +// CHECK: local-symbols.m:14:10: IntegerLiteral= Extent=[14:10 - 14:11] +// CHECK: local-symbols.m:20:11: ObjCProtocolDecl=Prot8380046:20:11 (Definition) Extent=[20:1 - 21:5] +// CHECK: local-symbols.m:23:12: ObjCInterfaceDecl=R8380046:23:12 Extent=[23:1 - 24:5] +// CHECK: local-symbols.m:26:12: ObjCCategoryDecl=:26:12 Extent=[26:1 - 27:5] +// CHECK: local-symbols.m:26:12: ObjCClassRef=R8380046:23:12 Extent=[26:12 - 26:20] +// CHECK: local-symbols.m:26:25: ObjCProtocolRef=Prot8380046:20:11 Extent=[26:25 - 26:36] + diff --git a/clang/test/Index/ms-if-exists.cpp b/clang/test/Index/ms-if-exists.cpp new file mode 100644 index 0000000..0815a03 --- /dev/null +++ b/clang/test/Index/ms-if-exists.cpp @@ -0,0 +1,24 @@ +template<typename T> +void f(T t) { + __if_exists(T::foo) { + { } + t.foo(); + } + + __if_not_exists(T::bar) { + int *i = t; // expected-error{{no viable conversion from 'HasFoo' to 'int *'}} + { } + } +} + +// RUN: c-index-test -test-annotate-tokens=%s:3:1:11:3 -fms-extensions -fno-ms-compatibility -fno-delayed-template-parsing %s | FileCheck %s + +// CHECK: Identifier: "T" [3:15 - 3:16] TypeRef=T:1:19 +// CHECK: Punctuation: "}" [4:7 - 4:8] CompoundStmt= +// CHECK: Identifier: "t" [5:5 - 5:6] DeclRefExpr=t:2:10 +// CHECK: Punctuation: "." [5:6 - 5:7] MemberRefExpr= +// CHECK: Identifier: "foo" [5:7 - 5:10] MemberRefExpr= +// CHECK: Keyword: "int" [9:5 - 9:8] VarDecl=i:9:10 (Definition) +// CHECK: Punctuation: "*" [9:9 - 9:10] VarDecl=i:9:10 (Definition) +// CHECK: Identifier: "i" [9:10 - 9:11] VarDecl=i:9:10 (Definition) +// CHECK: Punctuation: "=" [9:12 - 9:13] VarDecl=i:9:10 (Definition) diff --git a/clang/test/Index/nested-binaryoperators.cpp b/clang/test/Index/nested-binaryoperators.cpp new file mode 100644 index 0000000..57adc6b --- /dev/null +++ b/clang/test/Index/nested-binaryoperators.cpp @@ -0,0 +1,1983 @@ +typedef unsigned int uint; +int foo(uint c) { + return ((c >= 0x41 && c <= 0x5a) + || (c >= 0x61 && c <= 0x7a) + || (c >= 0xc0 && c <= 0xd6) + || (c >= 0xd8 && c <= 0xf6) + || (c >= 0xf8 && c <= 0xff) + || (c >= 0x100 && c <= 0x131) + || (c >= 0x134 && c <= 0x13e) + || (c >= 0x141 && c <= 0x148) + || (c >= 0x14a && c <= 0x17e) + || (c >= 0x180 && c <= 0x1c3) + || (c >= 0x1cd && c <= 0x1f0) + || (c >= 0x1f4 && c <= 0x1f5) + || (c >= 0x1fa && c <= 0x217) + || (c >= 0x250 && c <= 0x2a8) + || (c >= 0x2bb && c <= 0x2c1) + || c == 0x386 || (c >= 0x388 && c <= 0x38a) + || c == 0x38c || (c >= 0x38e && c <= 0x3a1) + || (c >= 0x3a3 && c <= 0x3ce) + || (c >= 0x3d0 && c <= 0x3d6) + || c == 0x3da || c == 0x3dc || c == 0x3de || + c == 0x3e0 || (c >= 0x3e2 && c <= 0x3f3) + || (c >= 0x401 && c <= 0x40c) + || (c >= 0x40e && c <= 0x44f) + || (c >= 0x451 && c <= 0x45c) + || (c >= 0x45e && c <= 0x481) + || (c >= 0x490 && c <= 0x4c4) + || (c >= 0x4c7 && c <= 0x4c8) + || (c >= 0x4cb && c <= 0x4cc) + || (c >= 0x4d0 && c <= 0x4eb) + || (c >= 0x4ee && c <= 0x4f5) + || (c >= 0x4f8 && c <= 0x4f9) + || (c >= 0x531 && c <= 0x556) + || c == 0x559 || (c >= 0x561 && c <= 0x586) + || (c >= 0x5d0 && c <= 0x5ea) + || (c >= 0x5f0 && c <= 0x5f2) + || (c >= 0x621 && c <= 0x63a) + || (c >= 0x641 && c <= 0x64a) + || (c >= 0x671 && c <= 0x6b7) + || (c >= 0x6ba && c <= 0x6be) + || (c >= 0x6c0 && c <= 0x6ce) + || (c >= 0x6d0 && c <= 0x6d3) + || c == 0x6d5 || (c >= 0x6e5 && c <= 0x6e6) + || (c >= 0x905 && c <= 0x939) + || c == 0x93d || (c >= 0x958 && c <= 0x961) + || (c >= 0x985 && c <= 0x98c) + || (c >= 0x98f && c <= 0x990) + || (c >= 0x993 && c <= 0x9a8) + || (c >= 0x9aa && c <= 0x9b0) + || c == 0x9b2 || (c >= 0x9b6 && c <= 0x9b9) + || (c >= 0x9dc && c <= 0x9dd) + || (c >= 0x9df && c <= 0x9e1) + || (c >= 0x9f0 && c <= 0x9f1) + || (c >= 0xa05 && c <= 0xa0a) + || (c >= 0xa0f && c <= 0xa10) + || (c >= 0xa13 && c <= 0xa28) + || (c >= 0xa2a && c <= 0xa30) + || (c >= 0xa32 && c <= 0xa33) + || (c >= 0xa35 && c <= 0xa36) + || (c >= 0xa38 && c <= 0xa39) + || (c >= 0xa59 && c <= 0xa5c) + || c == 0xa5e || (c >= 0xa72 && c <= 0xa74) + || (c >= 0xa85 && c <= 0xa8b) + || c == 0xa8d || (c >= 0xa8f && c <= 0xa91) + || (c >= 0xa93 && c <= 0xaa8) + || (c >= 0xaaa && c <= 0xab0) + || (c >= 0xab2 && c <= 0xab3) + || (c >= 0xab5 && c <= 0xab9) + || c == 0xabd || c == 0xae0 || (c >= 0xb05 && c <= 0xb0c) + || (c >= 0xb0f && c <= 0xb10) + || (c >= 0xb13 && c <= 0xb28) + || (c >= 0xb2a && c <= 0xb30) + || (c >= 0xb32 && c <= 0xb33) + || (c >= 0xb36 && c <= 0xb39) + || c == 0xb3d || (c >= 0xb5c && c <= 0xb5d) + || (c >= 0xb5f && c <= 0xb61) + || (c >= 0xb85 && c <= 0xb8a) + || (c >= 0xb8e && c <= 0xb90) + || (c >= 0xb92 && c <= 0xb95) + || (c >= 0xb99 && c <= 0xb9a) + || c == 0xb9c || (c >= 0xb9e && c <= 0xb9f) + || (c >= 0xba3 && c <= 0xba4) + || (c >= 0xba8 && c <= 0xbaa) + || (c >= 0xbae && c <= 0xbb5) + || (c >= 0xbb7 && c <= 0xbb9) + || (c >= 0xc05 && c <= 0xc0c) + || (c >= 0xc0e && c <= 0xc10) + || (c >= 0xc12 && c <= 0xc28) + || (c >= 0xc2a && c <= 0xc33) + || (c >= 0xc35 && c <= 0xc39) + || (c >= 0xc60 && c <= 0xc61) + || (c >= 0xc85 && c <= 0xc8c) + || (c >= 0xc8e && c <= 0xc90) + || (c >= 0xc92 && c <= 0xca8) + || (c >= 0xcaa && c <= 0xcb3) + || (c >= 0xcb5 && c <= 0xcb9) + || c == 0xcde || (c >= 0xce0 && c <= 0xce1) + || (c >= 0xd05 && c <= 0xd0c) + || (c >= 0xd0e && c <= 0xd10) + || (c >= 0xd12 && c <= 0xd28) + || (c >= 0xd2a && c <= 0xd39) + || (c >= 0xd60 && c <= 0xd61) + || (c >= 0xe01 && c <= 0xe2e) + || c == 0xe30 || (c >= 0xe32 && c <= 0xe33) + || (c >= 0xe40 && c <= 0xe45) + || (c >= 0xe81 && c <= 0xe82) + || c == 0xe84 || (c >= 0xe87 && c <= 0xe88) + || c == 0xe8a || c == 0xe8d || (c >= 0xe94 && c <= 0xe97) + || (c >= 0xe99 && c <= 0xe9f) + || (c >= 0xea1 && c <= 0xea3) + || c == 0xea5 || c == 0xea7 || (c >= 0xeaa && c <= 0xeab) + || (c >= 0xead && c <= 0xeae) + || c == 0xeb0 || (c >= 0xeb2 && c <= 0xeb3) + || c == 0xebd || (c >= 0xec0 && c <= 0xec4) + || (c >= 0xf40 && c <= 0xf47) + || (c >= 0xf49 && c <= 0xf69) + || (c >= 0x10a0 && c <= 0x10c5) + || (c >= 0x10d0 && c <= 0x10f6) + || c == 0x1100 || (c >= 0x1102 && c <= 0x1103) + || (c >= 0x1105 && c <= 0x1107) + || c == 0x1109 || (c >= 0x110b && c <= 0x110c) + || (c >= 0x110e && c <= 0x1112) + || c == 0x113c || c == 0x113e || c == 0x1140 || c == 0x114c || + c == 0x114e || c == 0x1150 || (c >= 0x1154 && c <= 0x1155) + || c == 0x1159 || (c >= 0x115f && c <= 0x1161) + || c == 0x1163 || c == 0x1165 || c == 0x1167 || c == 0x1169 || + (c >= 0x116d && c <= 0x116e) + || (c >= 0x1172 && c <= 0x1173) + || c == 0x1175 || c == 0x119e || c == 0x11a8 || c == 0x11ab || + (c >= 0x11ae && c <= 0x11af) + || (c >= 0x11b7 && c <= 0x11b8) + || c == 0x11ba || (c >= 0x11bc && c <= 0x11c2) + || c == 0x11eb || c == 0x11f0 || c == 0x11f9 || (c >= 0x1e00 && c <= 0x1e9b) + || (c >= 0x1ea0 && c <= 0x1ef9) + || (c >= 0x1f00 && c <= 0x1f15) + || (c >= 0x1f18 && c <= 0x1f1d) + || (c >= 0x1f20 && c <= 0x1f45) + || (c >= 0x1f48 && c <= 0x1f4d) + || (c >= 0x1f50 && c <= 0x1f57) + || c == 0x1f59 || c == 0x1f5b || c == 0x1f5d || (c >= 0x1f5f && c <= 0x1f7d) + || (c >= 0x1f80 && c <= 0x1fb4) + || (c >= 0x1fb6 && c <= 0x1fbc) + || c == 0x1fbe || (c >= 0x1fc2 && c <= 0x1fc4) + || (c >= 0x1fc6 && c <= 0x1fcc) + || (c >= 0x1fd0 && c <= 0x1fd3) + || (c >= 0x1fd6 && c <= 0x1fdb) + || (c >= 0x1fe0 && c <= 0x1fec) + || (c >= 0x1ff2 && c <= 0x1ff4) + || (c >= 0x1ff6 && c <= 0x1ffc) + || c == 0x2126 || (c >= 0x212a && c <= 0x212b) + || c == 0x212e || (c >= 0x2180 && c <= 0x2182) + || (c >= 0x3041 && c <= 0x3094) + || (c >= 0x30a1 && c <= 0x30fa) + || (c >= 0x3105 && c <= 0x312c) + || (c >= 0xac00 && c <= 0xd7a3) + || (c >= 0x4e00 && c <= 0x9fa5) + || c == 0x3007 || (c >= 0x3021 && c <= 0x3029) + || (c >= 0x4e00 && c <= 0x9fa5) + || c == 0x3007 || (c >= 0x3021 && c <= 0x3029)); +} + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: 1:22: TypedefDecl=uint:1:22 (Definition) Extent=[1:1 - 1:26] +// CHECK: 2:5: FunctionDecl=foo:2:5 (Definition) Extent=[2:1 - 161:2] +// CHECK: 2:14: ParmDecl=c:2:14 (Definition) Extent=[2:9 - 2:15] +// CHECK: 2:9: TypeRef=uint:1:22 Extent=[2:9 - 2:13] +// CHECK: 2:17: CompoundStmt= Extent=[2:17 - 161:2] +// CHECK: 3:3: ReturnStmt= Extent=[3:3 - 160:52] +// CHECK: 3:10: UnexposedExpr= Extent=[3:10 - 160:52] +// CHECK: 3:10: ParenExpr= Extent=[3:10 - 160:52] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 160:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 160:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 159:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 158:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 158:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 157:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 156:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 155:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 154:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 153:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 152:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 152:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 151:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 151:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 150:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 149:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 148:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 147:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 146:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 145:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 144:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 144:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 143:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 142:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 141:81] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 141:49] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 141:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 141:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 140:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 139:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 138:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 137:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 136:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 135:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 134:81] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 134:49] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 134:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 134:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 133:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 133:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 132:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 131:33] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 130:64] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 130:49] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 130:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 130:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 129:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 128:33] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 127:64] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 127:49] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 127:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 127:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 126:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 126:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 125:63] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 125:31] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 125:16] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 124:64] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 124:49] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 124:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 124:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 123:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 122:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 122:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 121:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 120:51] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 120:19] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 119:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 118:36] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 117:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 116:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 115:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 115:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 114:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 114:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 113:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 112:62] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 112:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 112:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 111:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 110:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 109:62] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 109:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 109:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 108:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 108:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 107:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 106:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 105:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 105:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 104:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 103:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 102:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 101:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 100:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 99:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 98:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 98:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 97:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 96:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 95:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 94:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 93:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 92:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 91:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 90:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 89:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 88:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 87:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 86:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 85:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 84:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 83:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 82:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 82:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 81:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 80:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 79:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 78:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 77:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 76:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 76:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 75:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 74:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 73:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 72:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 71:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 70:62] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 70:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 70:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 69:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 68:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 67:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 66:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 65:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 65:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 64:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 63:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 63:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 62:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 61:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 60:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 59:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 58:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 57:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 56:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 55:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 54:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 53:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 52:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 51:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 51:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 50:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 49:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 48:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 47:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 46:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 46:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 45:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 44:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 44:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 43:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 42:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 41:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 40:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 39:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 38:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 37:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 36:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 35:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 35:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 34:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 33:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 32:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 31:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 30:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 29:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 28:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 27:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 26:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 25:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 24:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 23:45] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 23:15] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 22:46] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 22:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 22:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 21:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 20:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 19:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 19:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 18:48] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 18:18] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 17:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 16:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 15:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 14:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 13:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 12:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 11:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 10:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 9:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 8:34] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 7:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 6:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 5:32] +// CHECK: 3:11: BinaryOperator= Extent=[3:11 - 4:32] +// CHECK: 3:12: BinaryOperator= Extent=[3:12 - 3:34] +// CHECK: 3:12: BinaryOperator= Extent=[3:12 - 3:21] +// CHECK: 3:12: DeclRefExpr=c:2:14 Extent=[3:12 - 3:13] +// CHECK: 3:17: UnexposedExpr= Extent=[3:17 - 3:21] +// CHECK: 3:17: IntegerLiteral= Extent=[3:17 - 3:21] +// CHECK: 3:25: BinaryOperator= Extent=[3:25 - 3:34] +// CHECK: 3:25: DeclRefExpr=c:2:14 Extent=[3:25 - 3:26] +// CHECK: 3:30: UnexposedExpr= Extent=[3:30 - 3:34] +// CHECK: 3:30: IntegerLiteral= Extent=[3:30 - 3:34] +// CHECK: 4:9: BinaryOperator= Extent=[4:9 - 4:31] +// CHECK: 4:9: BinaryOperator= Extent=[4:9 - 4:18] +// CHECK: 4:9: DeclRefExpr=c:2:14 Extent=[4:9 - 4:10] +// CHECK: 4:14: UnexposedExpr= Extent=[4:14 - 4:18] +// CHECK: 4:14: IntegerLiteral= Extent=[4:14 - 4:18] +// CHECK: 4:22: BinaryOperator= Extent=[4:22 - 4:31] +// CHECK: 4:22: DeclRefExpr=c:2:14 Extent=[4:22 - 4:23] +// CHECK: 4:27: UnexposedExpr= Extent=[4:27 - 4:31] +// CHECK: 4:27: IntegerLiteral= Extent=[4:27 - 4:31] +// CHECK: 5:8: ParenExpr= Extent=[5:8 - 5:32] +// CHECK: 5:9: BinaryOperator= Extent=[5:9 - 5:31] +// CHECK: 5:9: BinaryOperator= Extent=[5:9 - 5:18] +// CHECK: 5:9: DeclRefExpr=c:2:14 Extent=[5:9 - 5:10] +// CHECK: 5:14: UnexposedExpr= Extent=[5:14 - 5:18] +// CHECK: 5:14: IntegerLiteral= Extent=[5:14 - 5:18] +// CHECK: 5:22: BinaryOperator= Extent=[5:22 - 5:31] +// CHECK: 5:22: DeclRefExpr=c:2:14 Extent=[5:22 - 5:23] +// CHECK: 5:27: UnexposedExpr= Extent=[5:27 - 5:31] +// CHECK: 5:27: IntegerLiteral= Extent=[5:27 - 5:31] +// CHECK: 6:9: BinaryOperator= Extent=[6:9 - 6:31] +// CHECK: 6:9: BinaryOperator= Extent=[6:9 - 6:18] +// CHECK: 6:9: DeclRefExpr=c:2:14 Extent=[6:9 - 6:10] +// CHECK: 6:14: UnexposedExpr= Extent=[6:14 - 6:18] +// CHECK: 6:14: IntegerLiteral= Extent=[6:14 - 6:18] +// CHECK: 6:22: BinaryOperator= Extent=[6:22 - 6:31] +// CHECK: 6:22: DeclRefExpr=c:2:14 Extent=[6:22 - 6:23] +// CHECK: 6:27: UnexposedExpr= Extent=[6:27 - 6:31] +// CHECK: 6:27: IntegerLiteral= Extent=[6:27 - 6:31] +// CHECK: 7:9: BinaryOperator= Extent=[7:9 - 7:31] +// CHECK: 7:9: BinaryOperator= Extent=[7:9 - 7:18] +// CHECK: 7:9: DeclRefExpr=c:2:14 Extent=[7:9 - 7:10] +// CHECK: 7:14: UnexposedExpr= Extent=[7:14 - 7:18] +// CHECK: 7:14: IntegerLiteral= Extent=[7:14 - 7:18] +// CHECK: 7:22: BinaryOperator= Extent=[7:22 - 7:31] +// CHECK: 7:22: DeclRefExpr=c:2:14 Extent=[7:22 - 7:23] +// CHECK: 7:27: UnexposedExpr= Extent=[7:27 - 7:31] +// CHECK: 7:27: IntegerLiteral= Extent=[7:27 - 7:31] +// CHECK: 8:9: BinaryOperator= Extent=[8:9 - 8:33] +// CHECK: 8:9: BinaryOperator= Extent=[8:9 - 8:19] +// CHECK: 8:9: DeclRefExpr=c:2:14 Extent=[8:9 - 8:10] +// CHECK: 8:14: UnexposedExpr= Extent=[8:14 - 8:19] +// CHECK: 8:14: IntegerLiteral= Extent=[8:14 - 8:19] +// CHECK: 8:23: BinaryOperator= Extent=[8:23 - 8:33] +// CHECK: 8:23: DeclRefExpr=c:2:14 Extent=[8:23 - 8:24] +// CHECK: 8:28: UnexposedExpr= Extent=[8:28 - 8:33] +// CHECK: 8:28: IntegerLiteral= Extent=[8:28 - 8:33] +// CHECK: 9:9: BinaryOperator= Extent=[9:9 - 9:33] +// CHECK: 9:9: BinaryOperator= Extent=[9:9 - 9:19] +// CHECK: 9:9: DeclRefExpr=c:2:14 Extent=[9:9 - 9:10] +// CHECK: 9:14: UnexposedExpr= Extent=[9:14 - 9:19] +// CHECK: 9:14: IntegerLiteral= Extent=[9:14 - 9:19] +// CHECK: 9:23: BinaryOperator= Extent=[9:23 - 9:33] +// CHECK: 9:23: DeclRefExpr=c:2:14 Extent=[9:23 - 9:24] +// CHECK: 9:28: UnexposedExpr= Extent=[9:28 - 9:33] +// CHECK: 9:28: IntegerLiteral= Extent=[9:28 - 9:33] +// CHECK: 10:9: BinaryOperator= Extent=[10:9 - 10:33] +// CHECK: 10:9: BinaryOperator= Extent=[10:9 - 10:19] +// CHECK: 10:9: DeclRefExpr=c:2:14 Extent=[10:9 - 10:10] +// CHECK: 10:14: UnexposedExpr= Extent=[10:14 - 10:19] +// CHECK: 10:14: IntegerLiteral= Extent=[10:14 - 10:19] +// CHECK: 10:23: BinaryOperator= Extent=[10:23 - 10:33] +// CHECK: 10:23: DeclRefExpr=c:2:14 Extent=[10:23 - 10:24] +// CHECK: 10:28: UnexposedExpr= Extent=[10:28 - 10:33] +// CHECK: 10:28: IntegerLiteral= Extent=[10:28 - 10:33] +// CHECK: 11:9: BinaryOperator= Extent=[11:9 - 11:33] +// CHECK: 11:9: BinaryOperator= Extent=[11:9 - 11:19] +// CHECK: 11:9: DeclRefExpr=c:2:14 Extent=[11:9 - 11:10] +// CHECK: 11:14: UnexposedExpr= Extent=[11:14 - 11:19] +// CHECK: 11:14: IntegerLiteral= Extent=[11:14 - 11:19] +// CHECK: 11:23: BinaryOperator= Extent=[11:23 - 11:33] +// CHECK: 11:23: DeclRefExpr=c:2:14 Extent=[11:23 - 11:24] +// CHECK: 11:28: UnexposedExpr= Extent=[11:28 - 11:33] +// CHECK: 11:28: IntegerLiteral= Extent=[11:28 - 11:33] +// CHECK: 12:9: BinaryOperator= Extent=[12:9 - 12:33] +// CHECK: 12:9: BinaryOperator= Extent=[12:9 - 12:19] +// CHECK: 12:9: DeclRefExpr=c:2:14 Extent=[12:9 - 12:10] +// CHECK: 12:14: UnexposedExpr= Extent=[12:14 - 12:19] +// CHECK: 12:14: IntegerLiteral= Extent=[12:14 - 12:19] +// CHECK: 12:23: BinaryOperator= Extent=[12:23 - 12:33] +// CHECK: 12:23: DeclRefExpr=c:2:14 Extent=[12:23 - 12:24] +// CHECK: 12:28: UnexposedExpr= Extent=[12:28 - 12:33] +// CHECK: 12:28: IntegerLiteral= Extent=[12:28 - 12:33] +// CHECK: 13:9: BinaryOperator= Extent=[13:9 - 13:33] +// CHECK: 13:9: BinaryOperator= Extent=[13:9 - 13:19] +// CHECK: 13:9: DeclRefExpr=c:2:14 Extent=[13:9 - 13:10] +// CHECK: 13:14: UnexposedExpr= Extent=[13:14 - 13:19] +// CHECK: 13:14: IntegerLiteral= Extent=[13:14 - 13:19] +// CHECK: 13:23: BinaryOperator= Extent=[13:23 - 13:33] +// CHECK: 13:23: DeclRefExpr=c:2:14 Extent=[13:23 - 13:24] +// CHECK: 13:28: UnexposedExpr= Extent=[13:28 - 13:33] +// CHECK: 13:28: IntegerLiteral= Extent=[13:28 - 13:33] +// CHECK: 14:9: BinaryOperator= Extent=[14:9 - 14:33] +// CHECK: 14:9: BinaryOperator= Extent=[14:9 - 14:19] +// CHECK: 14:9: DeclRefExpr=c:2:14 Extent=[14:9 - 14:10] +// CHECK: 14:14: UnexposedExpr= Extent=[14:14 - 14:19] +// CHECK: 14:14: IntegerLiteral= Extent=[14:14 - 14:19] +// CHECK: 14:23: BinaryOperator= Extent=[14:23 - 14:33] +// CHECK: 14:23: DeclRefExpr=c:2:14 Extent=[14:23 - 14:24] +// CHECK: 14:28: UnexposedExpr= Extent=[14:28 - 14:33] +// CHECK: 14:28: IntegerLiteral= Extent=[14:28 - 14:33] +// CHECK: 15:9: BinaryOperator= Extent=[15:9 - 15:33] +// CHECK: 15:9: BinaryOperator= Extent=[15:9 - 15:19] +// CHECK: 15:9: DeclRefExpr=c:2:14 Extent=[15:9 - 15:10] +// CHECK: 15:14: UnexposedExpr= Extent=[15:14 - 15:19] +// CHECK: 15:14: IntegerLiteral= Extent=[15:14 - 15:19] +// CHECK: 15:23: BinaryOperator= Extent=[15:23 - 15:33] +// CHECK: 15:23: DeclRefExpr=c:2:14 Extent=[15:23 - 15:24] +// CHECK: 15:28: UnexposedExpr= Extent=[15:28 - 15:33] +// CHECK: 15:28: IntegerLiteral= Extent=[15:28 - 15:33] +// CHECK: 16:9: BinaryOperator= Extent=[16:9 - 16:33] +// CHECK: 16:9: BinaryOperator= Extent=[16:9 - 16:19] +// CHECK: 16:9: DeclRefExpr=c:2:14 Extent=[16:9 - 16:10] +// CHECK: 16:14: UnexposedExpr= Extent=[16:14 - 16:19] +// CHECK: 16:14: IntegerLiteral= Extent=[16:14 - 16:19] +// CHECK: 16:23: BinaryOperator= Extent=[16:23 - 16:33] +// CHECK: 16:23: DeclRefExpr=c:2:14 Extent=[16:23 - 16:24] +// CHECK: 16:28: UnexposedExpr= Extent=[16:28 - 16:33] +// CHECK: 16:28: IntegerLiteral= Extent=[16:28 - 16:33] +// CHECK: 17:9: BinaryOperator= Extent=[17:9 - 17:33] +// CHECK: 17:9: BinaryOperator= Extent=[17:9 - 17:19] +// CHECK: 17:9: DeclRefExpr=c:2:14 Extent=[17:9 - 17:10] +// CHECK: 17:14: UnexposedExpr= Extent=[17:14 - 17:19] +// CHECK: 17:14: IntegerLiteral= Extent=[17:14 - 17:19] +// CHECK: 17:23: BinaryOperator= Extent=[17:23 - 17:33] +// CHECK: 17:23: DeclRefExpr=c:2:14 Extent=[17:23 - 17:24] +// CHECK: 17:28: UnexposedExpr= Extent=[17:28 - 17:33] +// CHECK: 17:28: IntegerLiteral= Extent=[17:28 - 17:33] +// CHECK: 18:8: BinaryOperator= Extent=[18:8 - 18:18] +// CHECK: 18:8: DeclRefExpr=c:2:14 Extent=[18:8 - 18:9] +// CHECK: 18:13: UnexposedExpr= Extent=[18:13 - 18:18] +// CHECK: 18:13: IntegerLiteral= Extent=[18:13 - 18:18] +// CHECK: 18:23: BinaryOperator= Extent=[18:23 - 18:47] +// CHECK: 18:23: BinaryOperator= Extent=[18:23 - 18:33] +// CHECK: 18:23: DeclRefExpr=c:2:14 Extent=[18:23 - 18:24] +// CHECK: 18:28: UnexposedExpr= Extent=[18:28 - 18:33] +// CHECK: 18:28: IntegerLiteral= Extent=[18:28 - 18:33] +// CHECK: 18:37: BinaryOperator= Extent=[18:37 - 18:47] +// CHECK: 18:37: DeclRefExpr=c:2:14 Extent=[18:37 - 18:38] +// CHECK: 18:42: UnexposedExpr= Extent=[18:42 - 18:47] +// CHECK: 18:42: IntegerLiteral= Extent=[18:42 - 18:47] +// CHECK: 19:8: BinaryOperator= Extent=[19:8 - 19:18] +// CHECK: 19:8: DeclRefExpr=c:2:14 Extent=[19:8 - 19:9] +// CHECK: 19:13: UnexposedExpr= Extent=[19:13 - 19:18] +// CHECK: 19:13: IntegerLiteral= Extent=[19:13 - 19:18] +// CHECK: 19:23: BinaryOperator= Extent=[19:23 - 19:47] +// CHECK: 19:23: BinaryOperator= Extent=[19:23 - 19:33] +// CHECK: 19:23: DeclRefExpr=c:2:14 Extent=[19:23 - 19:24] +// CHECK: 19:28: UnexposedExpr= Extent=[19:28 - 19:33] +// CHECK: 19:28: IntegerLiteral= Extent=[19:28 - 19:33] +// CHECK: 19:37: BinaryOperator= Extent=[19:37 - 19:47] +// CHECK: 19:37: DeclRefExpr=c:2:14 Extent=[19:37 - 19:38] +// CHECK: 19:42: UnexposedExpr= Extent=[19:42 - 19:47] +// CHECK: 19:42: IntegerLiteral= Extent=[19:42 - 19:47] +// CHECK: 20:9: BinaryOperator= Extent=[20:9 - 20:33] +// CHECK: 20:9: BinaryOperator= Extent=[20:9 - 20:19] +// CHECK: 20:9: DeclRefExpr=c:2:14 Extent=[20:9 - 20:10] +// CHECK: 20:14: UnexposedExpr= Extent=[20:14 - 20:19] +// CHECK: 20:14: IntegerLiteral= Extent=[20:14 - 20:19] +// CHECK: 20:23: BinaryOperator= Extent=[20:23 - 20:33] +// CHECK: 20:23: DeclRefExpr=c:2:14 Extent=[20:23 - 20:24] +// CHECK: 20:28: UnexposedExpr= Extent=[20:28 - 20:33] +// CHECK: 20:28: IntegerLiteral= Extent=[20:28 - 20:33] +// CHECK: 21:9: BinaryOperator= Extent=[21:9 - 21:33] +// CHECK: 21:9: BinaryOperator= Extent=[21:9 - 21:19] +// CHECK: 21:9: DeclRefExpr=c:2:14 Extent=[21:9 - 21:10] +// CHECK: 21:14: UnexposedExpr= Extent=[21:14 - 21:19] +// CHECK: 21:14: IntegerLiteral= Extent=[21:14 - 21:19] +// CHECK: 21:23: BinaryOperator= Extent=[21:23 - 21:33] +// CHECK: 21:23: DeclRefExpr=c:2:14 Extent=[21:23 - 21:24] +// CHECK: 21:28: UnexposedExpr= Extent=[21:28 - 21:33] +// CHECK: 21:28: IntegerLiteral= Extent=[21:28 - 21:33] +// CHECK: 22:8: BinaryOperator= Extent=[22:8 - 22:18] +// CHECK: 22:8: DeclRefExpr=c:2:14 Extent=[22:8 - 22:9] +// CHECK: 22:13: UnexposedExpr= Extent=[22:13 - 22:18] +// CHECK: 22:13: IntegerLiteral= Extent=[22:13 - 22:18] +// CHECK: 22:22: BinaryOperator= Extent=[22:22 - 22:32] +// CHECK: 22:22: DeclRefExpr=c:2:14 Extent=[22:22 - 22:23] +// CHECK: 22:27: UnexposedExpr= Extent=[22:27 - 22:32] +// CHECK: 22:27: IntegerLiteral= Extent=[22:27 - 22:32] +// CHECK: 22:36: BinaryOperator= Extent=[22:36 - 22:46] +// CHECK: 22:36: DeclRefExpr=c:2:14 Extent=[22:36 - 22:37] +// CHECK: 22:41: UnexposedExpr= Extent=[22:41 - 22:46] +// CHECK: 22:41: IntegerLiteral= Extent=[22:41 - 22:46] +// CHECK: 23:5: BinaryOperator= Extent=[23:5 - 23:15] +// CHECK: 23:5: DeclRefExpr=c:2:14 Extent=[23:5 - 23:6] +// CHECK: 23:10: UnexposedExpr= Extent=[23:10 - 23:15] +// CHECK: 23:10: IntegerLiteral= Extent=[23:10 - 23:15] +// CHECK: 23:20: BinaryOperator= Extent=[23:20 - 23:44] +// CHECK: 23:20: BinaryOperator= Extent=[23:20 - 23:30] +// CHECK: 23:20: DeclRefExpr=c:2:14 Extent=[23:20 - 23:21] +// CHECK: 23:25: UnexposedExpr= Extent=[23:25 - 23:30] +// CHECK: 23:25: IntegerLiteral= Extent=[23:25 - 23:30] +// CHECK: 23:34: BinaryOperator= Extent=[23:34 - 23:44] +// CHECK: 23:34: DeclRefExpr=c:2:14 Extent=[23:34 - 23:35] +// CHECK: 23:39: UnexposedExpr= Extent=[23:39 - 23:44] +// CHECK: 23:39: IntegerLiteral= Extent=[23:39 - 23:44] +// CHECK: 24:9: BinaryOperator= Extent=[24:9 - 24:33] +// CHECK: 24:9: BinaryOperator= Extent=[24:9 - 24:19] +// CHECK: 24:9: DeclRefExpr=c:2:14 Extent=[24:9 - 24:10] +// CHECK: 24:14: UnexposedExpr= Extent=[24:14 - 24:19] +// CHECK: 24:14: IntegerLiteral= Extent=[24:14 - 24:19] +// CHECK: 24:23: BinaryOperator= Extent=[24:23 - 24:33] +// CHECK: 24:23: DeclRefExpr=c:2:14 Extent=[24:23 - 24:24] +// CHECK: 24:28: UnexposedExpr= Extent=[24:28 - 24:33] +// CHECK: 24:28: IntegerLiteral= Extent=[24:28 - 24:33] +// CHECK: 25:9: BinaryOperator= Extent=[25:9 - 25:33] +// CHECK: 25:9: BinaryOperator= Extent=[25:9 - 25:19] +// CHECK: 25:9: DeclRefExpr=c:2:14 Extent=[25:9 - 25:10] +// CHECK: 25:14: UnexposedExpr= Extent=[25:14 - 25:19] +// CHECK: 25:14: IntegerLiteral= Extent=[25:14 - 25:19] +// CHECK: 25:23: BinaryOperator= Extent=[25:23 - 25:33] +// CHECK: 25:23: DeclRefExpr=c:2:14 Extent=[25:23 - 25:24] +// CHECK: 25:28: UnexposedExpr= Extent=[25:28 - 25:33] +// CHECK: 25:28: IntegerLiteral= Extent=[25:28 - 25:33] +// CHECK: 26:9: BinaryOperator= Extent=[26:9 - 26:33] +// CHECK: 26:9: BinaryOperator= Extent=[26:9 - 26:19] +// CHECK: 26:9: DeclRefExpr=c:2:14 Extent=[26:9 - 26:10] +// CHECK: 26:14: UnexposedExpr= Extent=[26:14 - 26:19] +// CHECK: 26:14: IntegerLiteral= Extent=[26:14 - 26:19] +// CHECK: 26:23: BinaryOperator= Extent=[26:23 - 26:33] +// CHECK: 26:23: DeclRefExpr=c:2:14 Extent=[26:23 - 26:24] +// CHECK: 26:28: UnexposedExpr= Extent=[26:28 - 26:33] +// CHECK: 26:28: IntegerLiteral= Extent=[26:28 - 26:33] +// CHECK: 27:9: BinaryOperator= Extent=[27:9 - 27:33] +// CHECK: 27:9: BinaryOperator= Extent=[27:9 - 27:19] +// CHECK: 27:9: DeclRefExpr=c:2:14 Extent=[27:9 - 27:10] +// CHECK: 27:14: UnexposedExpr= Extent=[27:14 - 27:19] +// CHECK: 27:14: IntegerLiteral= Extent=[27:14 - 27:19] +// CHECK: 27:23: BinaryOperator= Extent=[27:23 - 27:33] +// CHECK: 27:23: DeclRefExpr=c:2:14 Extent=[27:23 - 27:24] +// CHECK: 27:28: UnexposedExpr= Extent=[27:28 - 27:33] +// CHECK: 27:28: IntegerLiteral= Extent=[27:28 - 27:33] +// CHECK: 28:9: BinaryOperator= Extent=[28:9 - 28:33] +// CHECK: 28:9: BinaryOperator= Extent=[28:9 - 28:19] +// CHECK: 28:9: DeclRefExpr=c:2:14 Extent=[28:9 - 28:10] +// CHECK: 28:14: UnexposedExpr= Extent=[28:14 - 28:19] +// CHECK: 28:14: IntegerLiteral= Extent=[28:14 - 28:19] +// CHECK: 28:23: BinaryOperator= Extent=[28:23 - 28:33] +// CHECK: 28:23: DeclRefExpr=c:2:14 Extent=[28:23 - 28:24] +// CHECK: 28:28: UnexposedExpr= Extent=[28:28 - 28:33] +// CHECK: 28:28: IntegerLiteral= Extent=[28:28 - 28:33] +// CHECK: 29:9: BinaryOperator= Extent=[29:9 - 29:33] +// CHECK: 29:9: BinaryOperator= Extent=[29:9 - 29:19] +// CHECK: 29:9: DeclRefExpr=c:2:14 Extent=[29:9 - 29:10] +// CHECK: 29:14: UnexposedExpr= Extent=[29:14 - 29:19] +// CHECK: 29:14: IntegerLiteral= Extent=[29:14 - 29:19] +// CHECK: 29:23: BinaryOperator= Extent=[29:23 - 29:33] +// CHECK: 29:23: DeclRefExpr=c:2:14 Extent=[29:23 - 29:24] +// CHECK: 29:28: UnexposedExpr= Extent=[29:28 - 29:33] +// CHECK: 29:28: IntegerLiteral= Extent=[29:28 - 29:33] +// CHECK: 30:9: BinaryOperator= Extent=[30:9 - 30:33] +// CHECK: 30:9: BinaryOperator= Extent=[30:9 - 30:19] +// CHECK: 30:9: DeclRefExpr=c:2:14 Extent=[30:9 - 30:10] +// CHECK: 30:14: UnexposedExpr= Extent=[30:14 - 30:19] +// CHECK: 30:14: IntegerLiteral= Extent=[30:14 - 30:19] +// CHECK: 30:23: BinaryOperator= Extent=[30:23 - 30:33] +// CHECK: 30:23: DeclRefExpr=c:2:14 Extent=[30:23 - 30:24] +// CHECK: 30:28: UnexposedExpr= Extent=[30:28 - 30:33] +// CHECK: 30:28: IntegerLiteral= Extent=[30:28 - 30:33] +// CHECK: 31:9: BinaryOperator= Extent=[31:9 - 31:33] +// CHECK: 31:9: BinaryOperator= Extent=[31:9 - 31:19] +// CHECK: 31:9: DeclRefExpr=c:2:14 Extent=[31:9 - 31:10] +// CHECK: 31:14: UnexposedExpr= Extent=[31:14 - 31:19] +// CHECK: 31:14: IntegerLiteral= Extent=[31:14 - 31:19] +// CHECK: 31:23: BinaryOperator= Extent=[31:23 - 31:33] +// CHECK: 31:23: DeclRefExpr=c:2:14 Extent=[31:23 - 31:24] +// CHECK: 31:28: UnexposedExpr= Extent=[31:28 - 31:33] +// CHECK: 31:28: IntegerLiteral= Extent=[31:28 - 31:33] +// CHECK: 32:9: BinaryOperator= Extent=[32:9 - 32:33] +// CHECK: 32:9: BinaryOperator= Extent=[32:9 - 32:19] +// CHECK: 32:9: DeclRefExpr=c:2:14 Extent=[32:9 - 32:10] +// CHECK: 32:14: UnexposedExpr= Extent=[32:14 - 32:19] +// CHECK: 32:14: IntegerLiteral= Extent=[32:14 - 32:19] +// CHECK: 32:23: BinaryOperator= Extent=[32:23 - 32:33] +// CHECK: 32:23: DeclRefExpr=c:2:14 Extent=[32:23 - 32:24] +// CHECK: 32:28: UnexposedExpr= Extent=[32:28 - 32:33] +// CHECK: 32:28: IntegerLiteral= Extent=[32:28 - 32:33] +// CHECK: 33:9: BinaryOperator= Extent=[33:9 - 33:33] +// CHECK: 33:9: BinaryOperator= Extent=[33:9 - 33:19] +// CHECK: 33:9: DeclRefExpr=c:2:14 Extent=[33:9 - 33:10] +// CHECK: 33:14: UnexposedExpr= Extent=[33:14 - 33:19] +// CHECK: 33:14: IntegerLiteral= Extent=[33:14 - 33:19] +// CHECK: 33:23: BinaryOperator= Extent=[33:23 - 33:33] +// CHECK: 33:23: DeclRefExpr=c:2:14 Extent=[33:23 - 33:24] +// CHECK: 33:28: UnexposedExpr= Extent=[33:28 - 33:33] +// CHECK: 33:28: IntegerLiteral= Extent=[33:28 - 33:33] +// CHECK: 34:9: BinaryOperator= Extent=[34:9 - 34:33] +// CHECK: 34:9: BinaryOperator= Extent=[34:9 - 34:19] +// CHECK: 34:9: DeclRefExpr=c:2:14 Extent=[34:9 - 34:10] +// CHECK: 34:14: UnexposedExpr= Extent=[34:14 - 34:19] +// CHECK: 34:14: IntegerLiteral= Extent=[34:14 - 34:19] +// CHECK: 34:23: BinaryOperator= Extent=[34:23 - 34:33] +// CHECK: 34:23: DeclRefExpr=c:2:14 Extent=[34:23 - 34:24] +// CHECK: 34:28: UnexposedExpr= Extent=[34:28 - 34:33] +// CHECK: 34:28: IntegerLiteral= Extent=[34:28 - 34:33] +// CHECK: 35:8: BinaryOperator= Extent=[35:8 - 35:18] +// CHECK: 35:8: DeclRefExpr=c:2:14 Extent=[35:8 - 35:9] +// CHECK: 35:13: UnexposedExpr= Extent=[35:13 - 35:18] +// CHECK: 35:13: IntegerLiteral= Extent=[35:13 - 35:18] +// CHECK: 35:23: BinaryOperator= Extent=[35:23 - 35:47] +// CHECK: 35:23: BinaryOperator= Extent=[35:23 - 35:33] +// CHECK: 35:23: DeclRefExpr=c:2:14 Extent=[35:23 - 35:24] +// CHECK: 35:28: UnexposedExpr= Extent=[35:28 - 35:33] +// CHECK: 35:28: IntegerLiteral= Extent=[35:28 - 35:33] +// CHECK: 35:37: BinaryOperator= Extent=[35:37 - 35:47] +// CHECK: 35:37: DeclRefExpr=c:2:14 Extent=[35:37 - 35:38] +// CHECK: 35:42: UnexposedExpr= Extent=[35:42 - 35:47] +// CHECK: 35:42: IntegerLiteral= Extent=[35:42 - 35:47] +// CHECK: 36:9: BinaryOperator= Extent=[36:9 - 36:33] +// CHECK: 36:9: BinaryOperator= Extent=[36:9 - 36:19] +// CHECK: 36:9: DeclRefExpr=c:2:14 Extent=[36:9 - 36:10] +// CHECK: 36:14: UnexposedExpr= Extent=[36:14 - 36:19] +// CHECK: 36:14: IntegerLiteral= Extent=[36:14 - 36:19] +// CHECK: 36:23: BinaryOperator= Extent=[36:23 - 36:33] +// CHECK: 36:23: DeclRefExpr=c:2:14 Extent=[36:23 - 36:24] +// CHECK: 36:28: UnexposedExpr= Extent=[36:28 - 36:33] +// CHECK: 36:28: IntegerLiteral= Extent=[36:28 - 36:33] +// CHECK: 37:9: BinaryOperator= Extent=[37:9 - 37:33] +// CHECK: 37:9: BinaryOperator= Extent=[37:9 - 37:19] +// CHECK: 37:9: DeclRefExpr=c:2:14 Extent=[37:9 - 37:10] +// CHECK: 37:14: UnexposedExpr= Extent=[37:14 - 37:19] +// CHECK: 37:14: IntegerLiteral= Extent=[37:14 - 37:19] +// CHECK: 37:23: BinaryOperator= Extent=[37:23 - 37:33] +// CHECK: 37:23: DeclRefExpr=c:2:14 Extent=[37:23 - 37:24] +// CHECK: 37:28: UnexposedExpr= Extent=[37:28 - 37:33] +// CHECK: 37:28: IntegerLiteral= Extent=[37:28 - 37:33] +// CHECK: 38:9: BinaryOperator= Extent=[38:9 - 38:33] +// CHECK: 38:9: BinaryOperator= Extent=[38:9 - 38:19] +// CHECK: 38:9: DeclRefExpr=c:2:14 Extent=[38:9 - 38:10] +// CHECK: 38:14: UnexposedExpr= Extent=[38:14 - 38:19] +// CHECK: 38:14: IntegerLiteral= Extent=[38:14 - 38:19] +// CHECK: 38:23: BinaryOperator= Extent=[38:23 - 38:33] +// CHECK: 38:23: DeclRefExpr=c:2:14 Extent=[38:23 - 38:24] +// CHECK: 38:28: UnexposedExpr= Extent=[38:28 - 38:33] +// CHECK: 38:28: IntegerLiteral= Extent=[38:28 - 38:33] +// CHECK: 39:9: BinaryOperator= Extent=[39:9 - 39:33] +// CHECK: 39:9: BinaryOperator= Extent=[39:9 - 39:19] +// CHECK: 39:9: DeclRefExpr=c:2:14 Extent=[39:9 - 39:10] +// CHECK: 39:14: UnexposedExpr= Extent=[39:14 - 39:19] +// CHECK: 39:14: IntegerLiteral= Extent=[39:14 - 39:19] +// CHECK: 39:23: BinaryOperator= Extent=[39:23 - 39:33] +// CHECK: 39:23: DeclRefExpr=c:2:14 Extent=[39:23 - 39:24] +// CHECK: 39:28: UnexposedExpr= Extent=[39:28 - 39:33] +// CHECK: 39:28: IntegerLiteral= Extent=[39:28 - 39:33] +// CHECK: 40:9: BinaryOperator= Extent=[40:9 - 40:33] +// CHECK: 40:9: BinaryOperator= Extent=[40:9 - 40:19] +// CHECK: 40:9: DeclRefExpr=c:2:14 Extent=[40:9 - 40:10] +// CHECK: 40:14: UnexposedExpr= Extent=[40:14 - 40:19] +// CHECK: 40:14: IntegerLiteral= Extent=[40:14 - 40:19] +// CHECK: 40:23: BinaryOperator= Extent=[40:23 - 40:33] +// CHECK: 40:23: DeclRefExpr=c:2:14 Extent=[40:23 - 40:24] +// CHECK: 40:28: UnexposedExpr= Extent=[40:28 - 40:33] +// CHECK: 40:28: IntegerLiteral= Extent=[40:28 - 40:33] +// CHECK: 41:9: BinaryOperator= Extent=[41:9 - 41:33] +// CHECK: 41:9: BinaryOperator= Extent=[41:9 - 41:19] +// CHECK: 41:9: DeclRefExpr=c:2:14 Extent=[41:9 - 41:10] +// CHECK: 41:14: UnexposedExpr= Extent=[41:14 - 41:19] +// CHECK: 41:14: IntegerLiteral= Extent=[41:14 - 41:19] +// CHECK: 41:23: BinaryOperator= Extent=[41:23 - 41:33] +// CHECK: 41:23: DeclRefExpr=c:2:14 Extent=[41:23 - 41:24] +// CHECK: 41:28: UnexposedExpr= Extent=[41:28 - 41:33] +// CHECK: 41:28: IntegerLiteral= Extent=[41:28 - 41:33] +// CHECK: 42:9: BinaryOperator= Extent=[42:9 - 42:33] +// CHECK: 42:9: BinaryOperator= Extent=[42:9 - 42:19] +// CHECK: 42:9: DeclRefExpr=c:2:14 Extent=[42:9 - 42:10] +// CHECK: 42:14: UnexposedExpr= Extent=[42:14 - 42:19] +// CHECK: 42:14: IntegerLiteral= Extent=[42:14 - 42:19] +// CHECK: 42:23: BinaryOperator= Extent=[42:23 - 42:33] +// CHECK: 42:23: DeclRefExpr=c:2:14 Extent=[42:23 - 42:24] +// CHECK: 42:28: UnexposedExpr= Extent=[42:28 - 42:33] +// CHECK: 42:28: IntegerLiteral= Extent=[42:28 - 42:33] +// CHECK: 43:9: BinaryOperator= Extent=[43:9 - 43:33] +// CHECK: 43:9: BinaryOperator= Extent=[43:9 - 43:19] +// CHECK: 43:9: DeclRefExpr=c:2:14 Extent=[43:9 - 43:10] +// CHECK: 43:14: UnexposedExpr= Extent=[43:14 - 43:19] +// CHECK: 43:14: IntegerLiteral= Extent=[43:14 - 43:19] +// CHECK: 43:23: BinaryOperator= Extent=[43:23 - 43:33] +// CHECK: 43:23: DeclRefExpr=c:2:14 Extent=[43:23 - 43:24] +// CHECK: 43:28: UnexposedExpr= Extent=[43:28 - 43:33] +// CHECK: 43:28: IntegerLiteral= Extent=[43:28 - 43:33] +// CHECK: 44:8: BinaryOperator= Extent=[44:8 - 44:18] +// CHECK: 44:8: DeclRefExpr=c:2:14 Extent=[44:8 - 44:9] +// CHECK: 44:13: UnexposedExpr= Extent=[44:13 - 44:18] +// CHECK: 44:13: IntegerLiteral= Extent=[44:13 - 44:18] +// CHECK: 44:23: BinaryOperator= Extent=[44:23 - 44:47] +// CHECK: 44:23: BinaryOperator= Extent=[44:23 - 44:33] +// CHECK: 44:23: DeclRefExpr=c:2:14 Extent=[44:23 - 44:24] +// CHECK: 44:28: UnexposedExpr= Extent=[44:28 - 44:33] +// CHECK: 44:28: IntegerLiteral= Extent=[44:28 - 44:33] +// CHECK: 44:37: BinaryOperator= Extent=[44:37 - 44:47] +// CHECK: 44:37: DeclRefExpr=c:2:14 Extent=[44:37 - 44:38] +// CHECK: 44:42: UnexposedExpr= Extent=[44:42 - 44:47] +// CHECK: 44:42: IntegerLiteral= Extent=[44:42 - 44:47] +// CHECK: 45:9: BinaryOperator= Extent=[45:9 - 45:33] +// CHECK: 45:9: BinaryOperator= Extent=[45:9 - 45:19] +// CHECK: 45:9: DeclRefExpr=c:2:14 Extent=[45:9 - 45:10] +// CHECK: 45:14: UnexposedExpr= Extent=[45:14 - 45:19] +// CHECK: 45:14: IntegerLiteral= Extent=[45:14 - 45:19] +// CHECK: 45:23: BinaryOperator= Extent=[45:23 - 45:33] +// CHECK: 45:23: DeclRefExpr=c:2:14 Extent=[45:23 - 45:24] +// CHECK: 45:28: UnexposedExpr= Extent=[45:28 - 45:33] +// CHECK: 45:28: IntegerLiteral= Extent=[45:28 - 45:33] +// CHECK: 46:8: BinaryOperator= Extent=[46:8 - 46:18] +// CHECK: 46:8: DeclRefExpr=c:2:14 Extent=[46:8 - 46:9] +// CHECK: 46:13: UnexposedExpr= Extent=[46:13 - 46:18] +// CHECK: 46:13: IntegerLiteral= Extent=[46:13 - 46:18] +// CHECK: 46:23: BinaryOperator= Extent=[46:23 - 46:47] +// CHECK: 46:23: BinaryOperator= Extent=[46:23 - 46:33] +// CHECK: 46:23: DeclRefExpr=c:2:14 Extent=[46:23 - 46:24] +// CHECK: 46:28: UnexposedExpr= Extent=[46:28 - 46:33] +// CHECK: 46:28: IntegerLiteral= Extent=[46:28 - 46:33] +// CHECK: 46:37: BinaryOperator= Extent=[46:37 - 46:47] +// CHECK: 46:37: DeclRefExpr=c:2:14 Extent=[46:37 - 46:38] +// CHECK: 46:42: UnexposedExpr= Extent=[46:42 - 46:47] +// CHECK: 46:42: IntegerLiteral= Extent=[46:42 - 46:47] +// CHECK: 47:9: BinaryOperator= Extent=[47:9 - 47:33] +// CHECK: 47:9: BinaryOperator= Extent=[47:9 - 47:19] +// CHECK: 47:9: DeclRefExpr=c:2:14 Extent=[47:9 - 47:10] +// CHECK: 47:14: UnexposedExpr= Extent=[47:14 - 47:19] +// CHECK: 47:14: IntegerLiteral= Extent=[47:14 - 47:19] +// CHECK: 47:23: BinaryOperator= Extent=[47:23 - 47:33] +// CHECK: 47:23: DeclRefExpr=c:2:14 Extent=[47:23 - 47:24] +// CHECK: 47:28: UnexposedExpr= Extent=[47:28 - 47:33] +// CHECK: 47:28: IntegerLiteral= Extent=[47:28 - 47:33] +// CHECK: 48:9: BinaryOperator= Extent=[48:9 - 48:33] +// CHECK: 48:9: BinaryOperator= Extent=[48:9 - 48:19] +// CHECK: 48:9: DeclRefExpr=c:2:14 Extent=[48:9 - 48:10] +// CHECK: 48:14: UnexposedExpr= Extent=[48:14 - 48:19] +// CHECK: 48:14: IntegerLiteral= Extent=[48:14 - 48:19] +// CHECK: 48:23: BinaryOperator= Extent=[48:23 - 48:33] +// CHECK: 48:23: DeclRefExpr=c:2:14 Extent=[48:23 - 48:24] +// CHECK: 48:28: UnexposedExpr= Extent=[48:28 - 48:33] +// CHECK: 48:28: IntegerLiteral= Extent=[48:28 - 48:33] +// CHECK: 49:9: BinaryOperator= Extent=[49:9 - 49:33] +// CHECK: 49:9: BinaryOperator= Extent=[49:9 - 49:19] +// CHECK: 49:9: DeclRefExpr=c:2:14 Extent=[49:9 - 49:10] +// CHECK: 49:14: UnexposedExpr= Extent=[49:14 - 49:19] +// CHECK: 49:14: IntegerLiteral= Extent=[49:14 - 49:19] +// CHECK: 49:23: BinaryOperator= Extent=[49:23 - 49:33] +// CHECK: 49:23: DeclRefExpr=c:2:14 Extent=[49:23 - 49:24] +// CHECK: 49:28: UnexposedExpr= Extent=[49:28 - 49:33] +// CHECK: 49:28: IntegerLiteral= Extent=[49:28 - 49:33] +// CHECK: 50:9: BinaryOperator= Extent=[50:9 - 50:33] +// CHECK: 50:9: BinaryOperator= Extent=[50:9 - 50:19] +// CHECK: 50:9: DeclRefExpr=c:2:14 Extent=[50:9 - 50:10] +// CHECK: 50:14: UnexposedExpr= Extent=[50:14 - 50:19] +// CHECK: 50:14: IntegerLiteral= Extent=[50:14 - 50:19] +// CHECK: 50:23: BinaryOperator= Extent=[50:23 - 50:33] +// CHECK: 50:23: DeclRefExpr=c:2:14 Extent=[50:23 - 50:24] +// CHECK: 50:28: UnexposedExpr= Extent=[50:28 - 50:33] +// CHECK: 50:28: IntegerLiteral= Extent=[50:28 - 50:33] +// CHECK: 51:8: BinaryOperator= Extent=[51:8 - 51:18] +// CHECK: 51:8: DeclRefExpr=c:2:14 Extent=[51:8 - 51:9] +// CHECK: 51:13: UnexposedExpr= Extent=[51:13 - 51:18] +// CHECK: 51:13: IntegerLiteral= Extent=[51:13 - 51:18] +// CHECK: 51:23: BinaryOperator= Extent=[51:23 - 51:47] +// CHECK: 51:23: BinaryOperator= Extent=[51:23 - 51:33] +// CHECK: 51:23: DeclRefExpr=c:2:14 Extent=[51:23 - 51:24] +// CHECK: 51:28: UnexposedExpr= Extent=[51:28 - 51:33] +// CHECK: 51:28: IntegerLiteral= Extent=[51:28 - 51:33] +// CHECK: 51:37: BinaryOperator= Extent=[51:37 - 51:47] +// CHECK: 51:37: DeclRefExpr=c:2:14 Extent=[51:37 - 51:38] +// CHECK: 51:42: UnexposedExpr= Extent=[51:42 - 51:47] +// CHECK: 51:42: IntegerLiteral= Extent=[51:42 - 51:47] +// CHECK: 52:9: BinaryOperator= Extent=[52:9 - 52:33] +// CHECK: 52:9: BinaryOperator= Extent=[52:9 - 52:19] +// CHECK: 52:9: DeclRefExpr=c:2:14 Extent=[52:9 - 52:10] +// CHECK: 52:14: UnexposedExpr= Extent=[52:14 - 52:19] +// CHECK: 52:14: IntegerLiteral= Extent=[52:14 - 52:19] +// CHECK: 52:23: BinaryOperator= Extent=[52:23 - 52:33] +// CHECK: 52:23: DeclRefExpr=c:2:14 Extent=[52:23 - 52:24] +// CHECK: 52:28: UnexposedExpr= Extent=[52:28 - 52:33] +// CHECK: 52:28: IntegerLiteral= Extent=[52:28 - 52:33] +// CHECK: 53:9: BinaryOperator= Extent=[53:9 - 53:33] +// CHECK: 53:9: BinaryOperator= Extent=[53:9 - 53:19] +// CHECK: 53:9: DeclRefExpr=c:2:14 Extent=[53:9 - 53:10] +// CHECK: 53:14: UnexposedExpr= Extent=[53:14 - 53:19] +// CHECK: 53:14: IntegerLiteral= Extent=[53:14 - 53:19] +// CHECK: 53:23: BinaryOperator= Extent=[53:23 - 53:33] +// CHECK: 53:23: DeclRefExpr=c:2:14 Extent=[53:23 - 53:24] +// CHECK: 53:28: UnexposedExpr= Extent=[53:28 - 53:33] +// CHECK: 53:28: IntegerLiteral= Extent=[53:28 - 53:33] +// CHECK: 54:9: BinaryOperator= Extent=[54:9 - 54:33] +// CHECK: 54:9: BinaryOperator= Extent=[54:9 - 54:19] +// CHECK: 54:9: DeclRefExpr=c:2:14 Extent=[54:9 - 54:10] +// CHECK: 54:14: UnexposedExpr= Extent=[54:14 - 54:19] +// CHECK: 54:14: IntegerLiteral= Extent=[54:14 - 54:19] +// CHECK: 54:23: BinaryOperator= Extent=[54:23 - 54:33] +// CHECK: 54:23: DeclRefExpr=c:2:14 Extent=[54:23 - 54:24] +// CHECK: 54:28: UnexposedExpr= Extent=[54:28 - 54:33] +// CHECK: 54:28: IntegerLiteral= Extent=[54:28 - 54:33] +// CHECK: 55:9: BinaryOperator= Extent=[55:9 - 55:33] +// CHECK: 55:9: BinaryOperator= Extent=[55:9 - 55:19] +// CHECK: 55:9: DeclRefExpr=c:2:14 Extent=[55:9 - 55:10] +// CHECK: 55:14: UnexposedExpr= Extent=[55:14 - 55:19] +// CHECK: 55:14: IntegerLiteral= Extent=[55:14 - 55:19] +// CHECK: 55:23: BinaryOperator= Extent=[55:23 - 55:33] +// CHECK: 55:23: DeclRefExpr=c:2:14 Extent=[55:23 - 55:24] +// CHECK: 55:28: UnexposedExpr= Extent=[55:28 - 55:33] +// CHECK: 55:28: IntegerLiteral= Extent=[55:28 - 55:33] +// CHECK: 56:9: BinaryOperator= Extent=[56:9 - 56:33] +// CHECK: 56:9: BinaryOperator= Extent=[56:9 - 56:19] +// CHECK: 56:9: DeclRefExpr=c:2:14 Extent=[56:9 - 56:10] +// CHECK: 56:14: UnexposedExpr= Extent=[56:14 - 56:19] +// CHECK: 56:14: IntegerLiteral= Extent=[56:14 - 56:19] +// CHECK: 56:23: BinaryOperator= Extent=[56:23 - 56:33] +// CHECK: 56:23: DeclRefExpr=c:2:14 Extent=[56:23 - 56:24] +// CHECK: 56:28: UnexposedExpr= Extent=[56:28 - 56:33] +// CHECK: 56:28: IntegerLiteral= Extent=[56:28 - 56:33] +// CHECK: 57:9: BinaryOperator= Extent=[57:9 - 57:33] +// CHECK: 57:9: BinaryOperator= Extent=[57:9 - 57:19] +// CHECK: 57:9: DeclRefExpr=c:2:14 Extent=[57:9 - 57:10] +// CHECK: 57:14: UnexposedExpr= Extent=[57:14 - 57:19] +// CHECK: 57:14: IntegerLiteral= Extent=[57:14 - 57:19] +// CHECK: 57:23: BinaryOperator= Extent=[57:23 - 57:33] +// CHECK: 57:23: DeclRefExpr=c:2:14 Extent=[57:23 - 57:24] +// CHECK: 57:28: UnexposedExpr= Extent=[57:28 - 57:33] +// CHECK: 57:28: IntegerLiteral= Extent=[57:28 - 57:33] +// CHECK: 58:9: BinaryOperator= Extent=[58:9 - 58:33] +// CHECK: 58:9: BinaryOperator= Extent=[58:9 - 58:19] +// CHECK: 58:9: DeclRefExpr=c:2:14 Extent=[58:9 - 58:10] +// CHECK: 58:14: UnexposedExpr= Extent=[58:14 - 58:19] +// CHECK: 58:14: IntegerLiteral= Extent=[58:14 - 58:19] +// CHECK: 58:23: BinaryOperator= Extent=[58:23 - 58:33] +// CHECK: 58:23: DeclRefExpr=c:2:14 Extent=[58:23 - 58:24] +// CHECK: 58:28: UnexposedExpr= Extent=[58:28 - 58:33] +// CHECK: 58:28: IntegerLiteral= Extent=[58:28 - 58:33] +// CHECK: 59:9: BinaryOperator= Extent=[59:9 - 59:33] +// CHECK: 59:9: BinaryOperator= Extent=[59:9 - 59:19] +// CHECK: 59:9: DeclRefExpr=c:2:14 Extent=[59:9 - 59:10] +// CHECK: 59:14: UnexposedExpr= Extent=[59:14 - 59:19] +// CHECK: 59:14: IntegerLiteral= Extent=[59:14 - 59:19] +// CHECK: 59:23: BinaryOperator= Extent=[59:23 - 59:33] +// CHECK: 59:23: DeclRefExpr=c:2:14 Extent=[59:23 - 59:24] +// CHECK: 59:28: UnexposedExpr= Extent=[59:28 - 59:33] +// CHECK: 59:28: IntegerLiteral= Extent=[59:28 - 59:33] +// CHECK: 60:9: BinaryOperator= Extent=[60:9 - 60:33] +// CHECK: 60:9: BinaryOperator= Extent=[60:9 - 60:19] +// CHECK: 60:9: DeclRefExpr=c:2:14 Extent=[60:9 - 60:10] +// CHECK: 60:14: UnexposedExpr= Extent=[60:14 - 60:19] +// CHECK: 60:14: IntegerLiteral= Extent=[60:14 - 60:19] +// CHECK: 60:23: BinaryOperator= Extent=[60:23 - 60:33] +// CHECK: 60:23: DeclRefExpr=c:2:14 Extent=[60:23 - 60:24] +// CHECK: 60:28: UnexposedExpr= Extent=[60:28 - 60:33] +// CHECK: 60:28: IntegerLiteral= Extent=[60:28 - 60:33] +// CHECK: 61:9: BinaryOperator= Extent=[61:9 - 61:33] +// CHECK: 61:9: BinaryOperator= Extent=[61:9 - 61:19] +// CHECK: 61:9: DeclRefExpr=c:2:14 Extent=[61:9 - 61:10] +// CHECK: 61:14: UnexposedExpr= Extent=[61:14 - 61:19] +// CHECK: 61:14: IntegerLiteral= Extent=[61:14 - 61:19] +// CHECK: 61:23: BinaryOperator= Extent=[61:23 - 61:33] +// CHECK: 61:23: DeclRefExpr=c:2:14 Extent=[61:23 - 61:24] +// CHECK: 61:28: UnexposedExpr= Extent=[61:28 - 61:33] +// CHECK: 61:28: IntegerLiteral= Extent=[61:28 - 61:33] +// CHECK: 62:9: BinaryOperator= Extent=[62:9 - 62:33] +// CHECK: 62:9: BinaryOperator= Extent=[62:9 - 62:19] +// CHECK: 62:9: DeclRefExpr=c:2:14 Extent=[62:9 - 62:10] +// CHECK: 62:14: UnexposedExpr= Extent=[62:14 - 62:19] +// CHECK: 62:14: IntegerLiteral= Extent=[62:14 - 62:19] +// CHECK: 62:23: BinaryOperator= Extent=[62:23 - 62:33] +// CHECK: 62:23: DeclRefExpr=c:2:14 Extent=[62:23 - 62:24] +// CHECK: 62:28: UnexposedExpr= Extent=[62:28 - 62:33] +// CHECK: 62:28: IntegerLiteral= Extent=[62:28 - 62:33] +// CHECK: 63:8: BinaryOperator= Extent=[63:8 - 63:18] +// CHECK: 63:8: DeclRefExpr=c:2:14 Extent=[63:8 - 63:9] +// CHECK: 63:13: UnexposedExpr= Extent=[63:13 - 63:18] +// CHECK: 63:13: IntegerLiteral= Extent=[63:13 - 63:18] +// CHECK: 63:23: BinaryOperator= Extent=[63:23 - 63:47] +// CHECK: 63:23: BinaryOperator= Extent=[63:23 - 63:33] +// CHECK: 63:23: DeclRefExpr=c:2:14 Extent=[63:23 - 63:24] +// CHECK: 63:28: UnexposedExpr= Extent=[63:28 - 63:33] +// CHECK: 63:28: IntegerLiteral= Extent=[63:28 - 63:33] +// CHECK: 63:37: BinaryOperator= Extent=[63:37 - 63:47] +// CHECK: 63:37: DeclRefExpr=c:2:14 Extent=[63:37 - 63:38] +// CHECK: 63:42: UnexposedExpr= Extent=[63:42 - 63:47] +// CHECK: 63:42: IntegerLiteral= Extent=[63:42 - 63:47] +// CHECK: 64:9: BinaryOperator= Extent=[64:9 - 64:33] +// CHECK: 64:9: BinaryOperator= Extent=[64:9 - 64:19] +// CHECK: 64:9: DeclRefExpr=c:2:14 Extent=[64:9 - 64:10] +// CHECK: 64:14: UnexposedExpr= Extent=[64:14 - 64:19] +// CHECK: 64:14: IntegerLiteral= Extent=[64:14 - 64:19] +// CHECK: 64:23: BinaryOperator= Extent=[64:23 - 64:33] +// CHECK: 64:23: DeclRefExpr=c:2:14 Extent=[64:23 - 64:24] +// CHECK: 64:28: UnexposedExpr= Extent=[64:28 - 64:33] +// CHECK: 64:28: IntegerLiteral= Extent=[64:28 - 64:33] +// CHECK: 65:8: BinaryOperator= Extent=[65:8 - 65:18] +// CHECK: 65:8: DeclRefExpr=c:2:14 Extent=[65:8 - 65:9] +// CHECK: 65:13: UnexposedExpr= Extent=[65:13 - 65:18] +// CHECK: 65:13: IntegerLiteral= Extent=[65:13 - 65:18] +// CHECK: 65:23: BinaryOperator= Extent=[65:23 - 65:47] +// CHECK: 65:23: BinaryOperator= Extent=[65:23 - 65:33] +// CHECK: 65:23: DeclRefExpr=c:2:14 Extent=[65:23 - 65:24] +// CHECK: 65:28: UnexposedExpr= Extent=[65:28 - 65:33] +// CHECK: 65:28: IntegerLiteral= Extent=[65:28 - 65:33] +// CHECK: 65:37: BinaryOperator= Extent=[65:37 - 65:47] +// CHECK: 65:37: DeclRefExpr=c:2:14 Extent=[65:37 - 65:38] +// CHECK: 65:42: UnexposedExpr= Extent=[65:42 - 65:47] +// CHECK: 65:42: IntegerLiteral= Extent=[65:42 - 65:47] +// CHECK: 66:9: BinaryOperator= Extent=[66:9 - 66:33] +// CHECK: 66:9: BinaryOperator= Extent=[66:9 - 66:19] +// CHECK: 66:9: DeclRefExpr=c:2:14 Extent=[66:9 - 66:10] +// CHECK: 66:14: UnexposedExpr= Extent=[66:14 - 66:19] +// CHECK: 66:14: IntegerLiteral= Extent=[66:14 - 66:19] +// CHECK: 66:23: BinaryOperator= Extent=[66:23 - 66:33] +// CHECK: 66:23: DeclRefExpr=c:2:14 Extent=[66:23 - 66:24] +// CHECK: 66:28: UnexposedExpr= Extent=[66:28 - 66:33] +// CHECK: 66:28: IntegerLiteral= Extent=[66:28 - 66:33] +// CHECK: 67:9: BinaryOperator= Extent=[67:9 - 67:33] +// CHECK: 67:9: BinaryOperator= Extent=[67:9 - 67:19] +// CHECK: 67:9: DeclRefExpr=c:2:14 Extent=[67:9 - 67:10] +// CHECK: 67:14: UnexposedExpr= Extent=[67:14 - 67:19] +// CHECK: 67:14: IntegerLiteral= Extent=[67:14 - 67:19] +// CHECK: 67:23: BinaryOperator= Extent=[67:23 - 67:33] +// CHECK: 67:23: DeclRefExpr=c:2:14 Extent=[67:23 - 67:24] +// CHECK: 67:28: UnexposedExpr= Extent=[67:28 - 67:33] +// CHECK: 67:28: IntegerLiteral= Extent=[67:28 - 67:33] +// CHECK: 68:9: BinaryOperator= Extent=[68:9 - 68:33] +// CHECK: 68:9: BinaryOperator= Extent=[68:9 - 68:19] +// CHECK: 68:9: DeclRefExpr=c:2:14 Extent=[68:9 - 68:10] +// CHECK: 68:14: UnexposedExpr= Extent=[68:14 - 68:19] +// CHECK: 68:14: IntegerLiteral= Extent=[68:14 - 68:19] +// CHECK: 68:23: BinaryOperator= Extent=[68:23 - 68:33] +// CHECK: 68:23: DeclRefExpr=c:2:14 Extent=[68:23 - 68:24] +// CHECK: 68:28: UnexposedExpr= Extent=[68:28 - 68:33] +// CHECK: 68:28: IntegerLiteral= Extent=[68:28 - 68:33] +// CHECK: 69:9: BinaryOperator= Extent=[69:9 - 69:33] +// CHECK: 69:9: BinaryOperator= Extent=[69:9 - 69:19] +// CHECK: 69:9: DeclRefExpr=c:2:14 Extent=[69:9 - 69:10] +// CHECK: 69:14: UnexposedExpr= Extent=[69:14 - 69:19] +// CHECK: 69:14: IntegerLiteral= Extent=[69:14 - 69:19] +// CHECK: 69:23: BinaryOperator= Extent=[69:23 - 69:33] +// CHECK: 69:23: DeclRefExpr=c:2:14 Extent=[69:23 - 69:24] +// CHECK: 69:28: UnexposedExpr= Extent=[69:28 - 69:33] +// CHECK: 69:28: IntegerLiteral= Extent=[69:28 - 69:33] +// CHECK: 70:8: BinaryOperator= Extent=[70:8 - 70:18] +// CHECK: 70:8: DeclRefExpr=c:2:14 Extent=[70:8 - 70:9] +// CHECK: 70:13: UnexposedExpr= Extent=[70:13 - 70:18] +// CHECK: 70:13: IntegerLiteral= Extent=[70:13 - 70:18] +// CHECK: 70:22: BinaryOperator= Extent=[70:22 - 70:32] +// CHECK: 70:22: DeclRefExpr=c:2:14 Extent=[70:22 - 70:23] +// CHECK: 70:27: UnexposedExpr= Extent=[70:27 - 70:32] +// CHECK: 70:27: IntegerLiteral= Extent=[70:27 - 70:32] +// CHECK: 70:37: BinaryOperator= Extent=[70:37 - 70:61] +// CHECK: 70:37: BinaryOperator= Extent=[70:37 - 70:47] +// CHECK: 70:37: DeclRefExpr=c:2:14 Extent=[70:37 - 70:38] +// CHECK: 70:42: UnexposedExpr= Extent=[70:42 - 70:47] +// CHECK: 70:42: IntegerLiteral= Extent=[70:42 - 70:47] +// CHECK: 70:51: BinaryOperator= Extent=[70:51 - 70:61] +// CHECK: 70:51: DeclRefExpr=c:2:14 Extent=[70:51 - 70:52] +// CHECK: 70:56: UnexposedExpr= Extent=[70:56 - 70:61] +// CHECK: 70:56: IntegerLiteral= Extent=[70:56 - 70:61] +// CHECK: 71:9: BinaryOperator= Extent=[71:9 - 71:33] +// CHECK: 71:9: BinaryOperator= Extent=[71:9 - 71:19] +// CHECK: 71:9: DeclRefExpr=c:2:14 Extent=[71:9 - 71:10] +// CHECK: 71:14: UnexposedExpr= Extent=[71:14 - 71:19] +// CHECK: 71:14: IntegerLiteral= Extent=[71:14 - 71:19] +// CHECK: 71:23: BinaryOperator= Extent=[71:23 - 71:33] +// CHECK: 71:23: DeclRefExpr=c:2:14 Extent=[71:23 - 71:24] +// CHECK: 71:28: UnexposedExpr= Extent=[71:28 - 71:33] +// CHECK: 71:28: IntegerLiteral= Extent=[71:28 - 71:33] +// CHECK: 72:9: BinaryOperator= Extent=[72:9 - 72:33] +// CHECK: 72:9: BinaryOperator= Extent=[72:9 - 72:19] +// CHECK: 72:9: DeclRefExpr=c:2:14 Extent=[72:9 - 72:10] +// CHECK: 72:14: UnexposedExpr= Extent=[72:14 - 72:19] +// CHECK: 72:14: IntegerLiteral= Extent=[72:14 - 72:19] +// CHECK: 72:23: BinaryOperator= Extent=[72:23 - 72:33] +// CHECK: 72:23: DeclRefExpr=c:2:14 Extent=[72:23 - 72:24] +// CHECK: 72:28: UnexposedExpr= Extent=[72:28 - 72:33] +// CHECK: 72:28: IntegerLiteral= Extent=[72:28 - 72:33] +// CHECK: 73:9: BinaryOperator= Extent=[73:9 - 73:33] +// CHECK: 73:9: BinaryOperator= Extent=[73:9 - 73:19] +// CHECK: 73:9: DeclRefExpr=c:2:14 Extent=[73:9 - 73:10] +// CHECK: 73:14: UnexposedExpr= Extent=[73:14 - 73:19] +// CHECK: 73:14: IntegerLiteral= Extent=[73:14 - 73:19] +// CHECK: 73:23: BinaryOperator= Extent=[73:23 - 73:33] +// CHECK: 73:23: DeclRefExpr=c:2:14 Extent=[73:23 - 73:24] +// CHECK: 73:28: UnexposedExpr= Extent=[73:28 - 73:33] +// CHECK: 73:28: IntegerLiteral= Extent=[73:28 - 73:33] +// CHECK: 74:9: BinaryOperator= Extent=[74:9 - 74:33] +// CHECK: 74:9: BinaryOperator= Extent=[74:9 - 74:19] +// CHECK: 74:9: DeclRefExpr=c:2:14 Extent=[74:9 - 74:10] +// CHECK: 74:14: UnexposedExpr= Extent=[74:14 - 74:19] +// CHECK: 74:14: IntegerLiteral= Extent=[74:14 - 74:19] +// CHECK: 74:23: BinaryOperator= Extent=[74:23 - 74:33] +// CHECK: 74:23: DeclRefExpr=c:2:14 Extent=[74:23 - 74:24] +// CHECK: 74:28: UnexposedExpr= Extent=[74:28 - 74:33] +// CHECK: 74:28: IntegerLiteral= Extent=[74:28 - 74:33] +// CHECK: 75:9: BinaryOperator= Extent=[75:9 - 75:33] +// CHECK: 75:9: BinaryOperator= Extent=[75:9 - 75:19] +// CHECK: 75:9: DeclRefExpr=c:2:14 Extent=[75:9 - 75:10] +// CHECK: 75:14: UnexposedExpr= Extent=[75:14 - 75:19] +// CHECK: 75:14: IntegerLiteral= Extent=[75:14 - 75:19] +// CHECK: 75:23: BinaryOperator= Extent=[75:23 - 75:33] +// CHECK: 75:23: DeclRefExpr=c:2:14 Extent=[75:23 - 75:24] +// CHECK: 75:28: UnexposedExpr= Extent=[75:28 - 75:33] +// CHECK: 75:28: IntegerLiteral= Extent=[75:28 - 75:33] +// CHECK: 76:8: BinaryOperator= Extent=[76:8 - 76:18] +// CHECK: 76:8: DeclRefExpr=c:2:14 Extent=[76:8 - 76:9] +// CHECK: 76:13: UnexposedExpr= Extent=[76:13 - 76:18] +// CHECK: 76:13: IntegerLiteral= Extent=[76:13 - 76:18] +// CHECK: 76:23: BinaryOperator= Extent=[76:23 - 76:47] +// CHECK: 76:23: BinaryOperator= Extent=[76:23 - 76:33] +// CHECK: 76:23: DeclRefExpr=c:2:14 Extent=[76:23 - 76:24] +// CHECK: 76:28: UnexposedExpr= Extent=[76:28 - 76:33] +// CHECK: 76:28: IntegerLiteral= Extent=[76:28 - 76:33] +// CHECK: 76:37: BinaryOperator= Extent=[76:37 - 76:47] +// CHECK: 76:37: DeclRefExpr=c:2:14 Extent=[76:37 - 76:38] +// CHECK: 76:42: UnexposedExpr= Extent=[76:42 - 76:47] +// CHECK: 76:42: IntegerLiteral= Extent=[76:42 - 76:47] +// CHECK: 77:9: BinaryOperator= Extent=[77:9 - 77:33] +// CHECK: 77:9: BinaryOperator= Extent=[77:9 - 77:19] +// CHECK: 77:9: DeclRefExpr=c:2:14 Extent=[77:9 - 77:10] +// CHECK: 77:14: UnexposedExpr= Extent=[77:14 - 77:19] +// CHECK: 77:14: IntegerLiteral= Extent=[77:14 - 77:19] +// CHECK: 77:23: BinaryOperator= Extent=[77:23 - 77:33] +// CHECK: 77:23: DeclRefExpr=c:2:14 Extent=[77:23 - 77:24] +// CHECK: 77:28: UnexposedExpr= Extent=[77:28 - 77:33] +// CHECK: 77:28: IntegerLiteral= Extent=[77:28 - 77:33] +// CHECK: 78:9: BinaryOperator= Extent=[78:9 - 78:33] +// CHECK: 78:9: BinaryOperator= Extent=[78:9 - 78:19] +// CHECK: 78:9: DeclRefExpr=c:2:14 Extent=[78:9 - 78:10] +// CHECK: 78:14: UnexposedExpr= Extent=[78:14 - 78:19] +// CHECK: 78:14: IntegerLiteral= Extent=[78:14 - 78:19] +// CHECK: 78:23: BinaryOperator= Extent=[78:23 - 78:33] +// CHECK: 78:23: DeclRefExpr=c:2:14 Extent=[78:23 - 78:24] +// CHECK: 78:28: UnexposedExpr= Extent=[78:28 - 78:33] +// CHECK: 78:28: IntegerLiteral= Extent=[78:28 - 78:33] +// CHECK: 79:9: BinaryOperator= Extent=[79:9 - 79:33] +// CHECK: 79:9: BinaryOperator= Extent=[79:9 - 79:19] +// CHECK: 79:9: DeclRefExpr=c:2:14 Extent=[79:9 - 79:10] +// CHECK: 79:14: UnexposedExpr= Extent=[79:14 - 79:19] +// CHECK: 79:14: IntegerLiteral= Extent=[79:14 - 79:19] +// CHECK: 79:23: BinaryOperator= Extent=[79:23 - 79:33] +// CHECK: 79:23: DeclRefExpr=c:2:14 Extent=[79:23 - 79:24] +// CHECK: 79:28: UnexposedExpr= Extent=[79:28 - 79:33] +// CHECK: 79:28: IntegerLiteral= Extent=[79:28 - 79:33] +// CHECK: 80:9: BinaryOperator= Extent=[80:9 - 80:33] +// CHECK: 80:9: BinaryOperator= Extent=[80:9 - 80:19] +// CHECK: 80:9: DeclRefExpr=c:2:14 Extent=[80:9 - 80:10] +// CHECK: 80:14: UnexposedExpr= Extent=[80:14 - 80:19] +// CHECK: 80:14: IntegerLiteral= Extent=[80:14 - 80:19] +// CHECK: 80:23: BinaryOperator= Extent=[80:23 - 80:33] +// CHECK: 80:23: DeclRefExpr=c:2:14 Extent=[80:23 - 80:24] +// CHECK: 80:28: UnexposedExpr= Extent=[80:28 - 80:33] +// CHECK: 80:28: IntegerLiteral= Extent=[80:28 - 80:33] +// CHECK: 81:9: BinaryOperator= Extent=[81:9 - 81:33] +// CHECK: 81:9: BinaryOperator= Extent=[81:9 - 81:19] +// CHECK: 81:9: DeclRefExpr=c:2:14 Extent=[81:9 - 81:10] +// CHECK: 81:14: UnexposedExpr= Extent=[81:14 - 81:19] +// CHECK: 81:14: IntegerLiteral= Extent=[81:14 - 81:19] +// CHECK: 81:23: BinaryOperator= Extent=[81:23 - 81:33] +// CHECK: 81:23: DeclRefExpr=c:2:14 Extent=[81:23 - 81:24] +// CHECK: 81:28: UnexposedExpr= Extent=[81:28 - 81:33] +// CHECK: 81:28: IntegerLiteral= Extent=[81:28 - 81:33] +// CHECK: 82:8: BinaryOperator= Extent=[82:8 - 82:18] +// CHECK: 82:8: DeclRefExpr=c:2:14 Extent=[82:8 - 82:9] +// CHECK: 82:13: UnexposedExpr= Extent=[82:13 - 82:18] +// CHECK: 82:13: IntegerLiteral= Extent=[82:13 - 82:18] +// CHECK: 82:23: BinaryOperator= Extent=[82:23 - 82:47] +// CHECK: 82:23: BinaryOperator= Extent=[82:23 - 82:33] +// CHECK: 82:23: DeclRefExpr=c:2:14 Extent=[82:23 - 82:24] +// CHECK: 82:28: UnexposedExpr= Extent=[82:28 - 82:33] +// CHECK: 82:28: IntegerLiteral= Extent=[82:28 - 82:33] +// CHECK: 82:37: BinaryOperator= Extent=[82:37 - 82:47] +// CHECK: 82:37: DeclRefExpr=c:2:14 Extent=[82:37 - 82:38] +// CHECK: 82:42: UnexposedExpr= Extent=[82:42 - 82:47] +// CHECK: 82:42: IntegerLiteral= Extent=[82:42 - 82:47] +// CHECK: 83:9: BinaryOperator= Extent=[83:9 - 83:33] +// CHECK: 83:9: BinaryOperator= Extent=[83:9 - 83:19] +// CHECK: 83:9: DeclRefExpr=c:2:14 Extent=[83:9 - 83:10] +// CHECK: 83:14: UnexposedExpr= Extent=[83:14 - 83:19] +// CHECK: 83:14: IntegerLiteral= Extent=[83:14 - 83:19] +// CHECK: 83:23: BinaryOperator= Extent=[83:23 - 83:33] +// CHECK: 83:23: DeclRefExpr=c:2:14 Extent=[83:23 - 83:24] +// CHECK: 83:28: UnexposedExpr= Extent=[83:28 - 83:33] +// CHECK: 83:28: IntegerLiteral= Extent=[83:28 - 83:33] +// CHECK: 84:9: BinaryOperator= Extent=[84:9 - 84:33] +// CHECK: 84:9: BinaryOperator= Extent=[84:9 - 84:19] +// CHECK: 84:9: DeclRefExpr=c:2:14 Extent=[84:9 - 84:10] +// CHECK: 84:14: UnexposedExpr= Extent=[84:14 - 84:19] +// CHECK: 84:14: IntegerLiteral= Extent=[84:14 - 84:19] +// CHECK: 84:23: BinaryOperator= Extent=[84:23 - 84:33] +// CHECK: 84:23: DeclRefExpr=c:2:14 Extent=[84:23 - 84:24] +// CHECK: 84:28: UnexposedExpr= Extent=[84:28 - 84:33] +// CHECK: 84:28: IntegerLiteral= Extent=[84:28 - 84:33] +// CHECK: 85:9: BinaryOperator= Extent=[85:9 - 85:33] +// CHECK: 85:9: BinaryOperator= Extent=[85:9 - 85:19] +// CHECK: 85:9: DeclRefExpr=c:2:14 Extent=[85:9 - 85:10] +// CHECK: 85:14: UnexposedExpr= Extent=[85:14 - 85:19] +// CHECK: 85:14: IntegerLiteral= Extent=[85:14 - 85:19] +// CHECK: 85:23: BinaryOperator= Extent=[85:23 - 85:33] +// CHECK: 85:23: DeclRefExpr=c:2:14 Extent=[85:23 - 85:24] +// CHECK: 85:28: UnexposedExpr= Extent=[85:28 - 85:33] +// CHECK: 85:28: IntegerLiteral= Extent=[85:28 - 85:33] +// CHECK: 86:9: BinaryOperator= Extent=[86:9 - 86:33] +// CHECK: 86:9: BinaryOperator= Extent=[86:9 - 86:19] +// CHECK: 86:9: DeclRefExpr=c:2:14 Extent=[86:9 - 86:10] +// CHECK: 86:14: UnexposedExpr= Extent=[86:14 - 86:19] +// CHECK: 86:14: IntegerLiteral= Extent=[86:14 - 86:19] +// CHECK: 86:23: BinaryOperator= Extent=[86:23 - 86:33] +// CHECK: 86:23: DeclRefExpr=c:2:14 Extent=[86:23 - 86:24] +// CHECK: 86:28: UnexposedExpr= Extent=[86:28 - 86:33] +// CHECK: 86:28: IntegerLiteral= Extent=[86:28 - 86:33] +// CHECK: 87:9: BinaryOperator= Extent=[87:9 - 87:33] +// CHECK: 87:9: BinaryOperator= Extent=[87:9 - 87:19] +// CHECK: 87:9: DeclRefExpr=c:2:14 Extent=[87:9 - 87:10] +// CHECK: 87:14: UnexposedExpr= Extent=[87:14 - 87:19] +// CHECK: 87:14: IntegerLiteral= Extent=[87:14 - 87:19] +// CHECK: 87:23: BinaryOperator= Extent=[87:23 - 87:33] +// CHECK: 87:23: DeclRefExpr=c:2:14 Extent=[87:23 - 87:24] +// CHECK: 87:28: UnexposedExpr= Extent=[87:28 - 87:33] +// CHECK: 87:28: IntegerLiteral= Extent=[87:28 - 87:33] +// CHECK: 88:9: BinaryOperator= Extent=[88:9 - 88:33] +// CHECK: 88:9: BinaryOperator= Extent=[88:9 - 88:19] +// CHECK: 88:9: DeclRefExpr=c:2:14 Extent=[88:9 - 88:10] +// CHECK: 88:14: UnexposedExpr= Extent=[88:14 - 88:19] +// CHECK: 88:14: IntegerLiteral= Extent=[88:14 - 88:19] +// CHECK: 88:23: BinaryOperator= Extent=[88:23 - 88:33] +// CHECK: 88:23: DeclRefExpr=c:2:14 Extent=[88:23 - 88:24] +// CHECK: 88:28: UnexposedExpr= Extent=[88:28 - 88:33] +// CHECK: 88:28: IntegerLiteral= Extent=[88:28 - 88:33] +// CHECK: 89:9: BinaryOperator= Extent=[89:9 - 89:33] +// CHECK: 89:9: BinaryOperator= Extent=[89:9 - 89:19] +// CHECK: 89:9: DeclRefExpr=c:2:14 Extent=[89:9 - 89:10] +// CHECK: 89:14: UnexposedExpr= Extent=[89:14 - 89:19] +// CHECK: 89:14: IntegerLiteral= Extent=[89:14 - 89:19] +// CHECK: 89:23: BinaryOperator= Extent=[89:23 - 89:33] +// CHECK: 89:23: DeclRefExpr=c:2:14 Extent=[89:23 - 89:24] +// CHECK: 89:28: UnexposedExpr= Extent=[89:28 - 89:33] +// CHECK: 89:28: IntegerLiteral= Extent=[89:28 - 89:33] +// CHECK: 90:9: BinaryOperator= Extent=[90:9 - 90:33] +// CHECK: 90:9: BinaryOperator= Extent=[90:9 - 90:19] +// CHECK: 90:9: DeclRefExpr=c:2:14 Extent=[90:9 - 90:10] +// CHECK: 90:14: UnexposedExpr= Extent=[90:14 - 90:19] +// CHECK: 90:14: IntegerLiteral= Extent=[90:14 - 90:19] +// CHECK: 90:23: BinaryOperator= Extent=[90:23 - 90:33] +// CHECK: 90:23: DeclRefExpr=c:2:14 Extent=[90:23 - 90:24] +// CHECK: 90:28: UnexposedExpr= Extent=[90:28 - 90:33] +// CHECK: 90:28: IntegerLiteral= Extent=[90:28 - 90:33] +// CHECK: 91:9: BinaryOperator= Extent=[91:9 - 91:33] +// CHECK: 91:9: BinaryOperator= Extent=[91:9 - 91:19] +// CHECK: 91:9: DeclRefExpr=c:2:14 Extent=[91:9 - 91:10] +// CHECK: 91:14: UnexposedExpr= Extent=[91:14 - 91:19] +// CHECK: 91:14: IntegerLiteral= Extent=[91:14 - 91:19] +// CHECK: 91:23: BinaryOperator= Extent=[91:23 - 91:33] +// CHECK: 91:23: DeclRefExpr=c:2:14 Extent=[91:23 - 91:24] +// CHECK: 91:28: UnexposedExpr= Extent=[91:28 - 91:33] +// CHECK: 91:28: IntegerLiteral= Extent=[91:28 - 91:33] +// CHECK: 92:9: BinaryOperator= Extent=[92:9 - 92:33] +// CHECK: 92:9: BinaryOperator= Extent=[92:9 - 92:19] +// CHECK: 92:9: DeclRefExpr=c:2:14 Extent=[92:9 - 92:10] +// CHECK: 92:14: UnexposedExpr= Extent=[92:14 - 92:19] +// CHECK: 92:14: IntegerLiteral= Extent=[92:14 - 92:19] +// CHECK: 92:23: BinaryOperator= Extent=[92:23 - 92:33] +// CHECK: 92:23: DeclRefExpr=c:2:14 Extent=[92:23 - 92:24] +// CHECK: 92:28: UnexposedExpr= Extent=[92:28 - 92:33] +// CHECK: 92:28: IntegerLiteral= Extent=[92:28 - 92:33] +// CHECK: 93:9: BinaryOperator= Extent=[93:9 - 93:33] +// CHECK: 93:9: BinaryOperator= Extent=[93:9 - 93:19] +// CHECK: 93:9: DeclRefExpr=c:2:14 Extent=[93:9 - 93:10] +// CHECK: 93:14: UnexposedExpr= Extent=[93:14 - 93:19] +// CHECK: 93:14: IntegerLiteral= Extent=[93:14 - 93:19] +// CHECK: 93:23: BinaryOperator= Extent=[93:23 - 93:33] +// CHECK: 93:23: DeclRefExpr=c:2:14 Extent=[93:23 - 93:24] +// CHECK: 93:28: UnexposedExpr= Extent=[93:28 - 93:33] +// CHECK: 93:28: IntegerLiteral= Extent=[93:28 - 93:33] +// CHECK: 94:9: BinaryOperator= Extent=[94:9 - 94:33] +// CHECK: 94:9: BinaryOperator= Extent=[94:9 - 94:19] +// CHECK: 94:9: DeclRefExpr=c:2:14 Extent=[94:9 - 94:10] +// CHECK: 94:14: UnexposedExpr= Extent=[94:14 - 94:19] +// CHECK: 94:14: IntegerLiteral= Extent=[94:14 - 94:19] +// CHECK: 94:23: BinaryOperator= Extent=[94:23 - 94:33] +// CHECK: 94:23: DeclRefExpr=c:2:14 Extent=[94:23 - 94:24] +// CHECK: 94:28: UnexposedExpr= Extent=[94:28 - 94:33] +// CHECK: 94:28: IntegerLiteral= Extent=[94:28 - 94:33] +// CHECK: 95:9: BinaryOperator= Extent=[95:9 - 95:33] +// CHECK: 95:9: BinaryOperator= Extent=[95:9 - 95:19] +// CHECK: 95:9: DeclRefExpr=c:2:14 Extent=[95:9 - 95:10] +// CHECK: 95:14: UnexposedExpr= Extent=[95:14 - 95:19] +// CHECK: 95:14: IntegerLiteral= Extent=[95:14 - 95:19] +// CHECK: 95:23: BinaryOperator= Extent=[95:23 - 95:33] +// CHECK: 95:23: DeclRefExpr=c:2:14 Extent=[95:23 - 95:24] +// CHECK: 95:28: UnexposedExpr= Extent=[95:28 - 95:33] +// CHECK: 95:28: IntegerLiteral= Extent=[95:28 - 95:33] +// CHECK: 96:9: BinaryOperator= Extent=[96:9 - 96:33] +// CHECK: 96:9: BinaryOperator= Extent=[96:9 - 96:19] +// CHECK: 96:9: DeclRefExpr=c:2:14 Extent=[96:9 - 96:10] +// CHECK: 96:14: UnexposedExpr= Extent=[96:14 - 96:19] +// CHECK: 96:14: IntegerLiteral= Extent=[96:14 - 96:19] +// CHECK: 96:23: BinaryOperator= Extent=[96:23 - 96:33] +// CHECK: 96:23: DeclRefExpr=c:2:14 Extent=[96:23 - 96:24] +// CHECK: 96:28: UnexposedExpr= Extent=[96:28 - 96:33] +// CHECK: 96:28: IntegerLiteral= Extent=[96:28 - 96:33] +// CHECK: 97:9: BinaryOperator= Extent=[97:9 - 97:33] +// CHECK: 97:9: BinaryOperator= Extent=[97:9 - 97:19] +// CHECK: 97:9: DeclRefExpr=c:2:14 Extent=[97:9 - 97:10] +// CHECK: 97:14: UnexposedExpr= Extent=[97:14 - 97:19] +// CHECK: 97:14: IntegerLiteral= Extent=[97:14 - 97:19] +// CHECK: 97:23: BinaryOperator= Extent=[97:23 - 97:33] +// CHECK: 97:23: DeclRefExpr=c:2:14 Extent=[97:23 - 97:24] +// CHECK: 97:28: UnexposedExpr= Extent=[97:28 - 97:33] +// CHECK: 97:28: IntegerLiteral= Extent=[97:28 - 97:33] +// CHECK: 98:8: BinaryOperator= Extent=[98:8 - 98:18] +// CHECK: 98:8: DeclRefExpr=c:2:14 Extent=[98:8 - 98:9] +// CHECK: 98:13: UnexposedExpr= Extent=[98:13 - 98:18] +// CHECK: 98:13: IntegerLiteral= Extent=[98:13 - 98:18] +// CHECK: 98:23: BinaryOperator= Extent=[98:23 - 98:47] +// CHECK: 98:23: BinaryOperator= Extent=[98:23 - 98:33] +// CHECK: 98:23: DeclRefExpr=c:2:14 Extent=[98:23 - 98:24] +// CHECK: 98:28: UnexposedExpr= Extent=[98:28 - 98:33] +// CHECK: 98:28: IntegerLiteral= Extent=[98:28 - 98:33] +// CHECK: 98:37: BinaryOperator= Extent=[98:37 - 98:47] +// CHECK: 98:37: DeclRefExpr=c:2:14 Extent=[98:37 - 98:38] +// CHECK: 98:42: UnexposedExpr= Extent=[98:42 - 98:47] +// CHECK: 98:42: IntegerLiteral= Extent=[98:42 - 98:47] +// CHECK: 99:9: BinaryOperator= Extent=[99:9 - 99:33] +// CHECK: 99:9: BinaryOperator= Extent=[99:9 - 99:19] +// CHECK: 99:9: DeclRefExpr=c:2:14 Extent=[99:9 - 99:10] +// CHECK: 99:14: UnexposedExpr= Extent=[99:14 - 99:19] +// CHECK: 99:14: IntegerLiteral= Extent=[99:14 - 99:19] +// CHECK: 99:23: BinaryOperator= Extent=[99:23 - 99:33] +// CHECK: 99:23: DeclRefExpr=c:2:14 Extent=[99:23 - 99:24] +// CHECK: 99:28: UnexposedExpr= Extent=[99:28 - 99:33] +// CHECK: 99:28: IntegerLiteral= Extent=[99:28 - 99:33] +// CHECK: 100:9: BinaryOperator= Extent=[100:9 - 100:33] +// CHECK: 100:9: BinaryOperator= Extent=[100:9 - 100:19] +// CHECK: 100:9: DeclRefExpr=c:2:14 Extent=[100:9 - 100:10] +// CHECK: 100:14: UnexposedExpr= Extent=[100:14 - 100:19] +// CHECK: 100:14: IntegerLiteral= Extent=[100:14 - 100:19] +// CHECK: 100:23: BinaryOperator= Extent=[100:23 - 100:33] +// CHECK: 100:23: DeclRefExpr=c:2:14 Extent=[100:23 - 100:24] +// CHECK: 100:28: UnexposedExpr= Extent=[100:28 - 100:33] +// CHECK: 100:28: IntegerLiteral= Extent=[100:28 - 100:33] +// CHECK: 101:9: BinaryOperator= Extent=[101:9 - 101:33] +// CHECK: 101:9: BinaryOperator= Extent=[101:9 - 101:19] +// CHECK: 101:9: DeclRefExpr=c:2:14 Extent=[101:9 - 101:10] +// CHECK: 101:14: UnexposedExpr= Extent=[101:14 - 101:19] +// CHECK: 101:14: IntegerLiteral= Extent=[101:14 - 101:19] +// CHECK: 101:23: BinaryOperator= Extent=[101:23 - 101:33] +// CHECK: 101:23: DeclRefExpr=c:2:14 Extent=[101:23 - 101:24] +// CHECK: 101:28: UnexposedExpr= Extent=[101:28 - 101:33] +// CHECK: 101:28: IntegerLiteral= Extent=[101:28 - 101:33] +// CHECK: 102:9: BinaryOperator= Extent=[102:9 - 102:33] +// CHECK: 102:9: BinaryOperator= Extent=[102:9 - 102:19] +// CHECK: 102:9: DeclRefExpr=c:2:14 Extent=[102:9 - 102:10] +// CHECK: 102:14: UnexposedExpr= Extent=[102:14 - 102:19] +// CHECK: 102:14: IntegerLiteral= Extent=[102:14 - 102:19] +// CHECK: 102:23: BinaryOperator= Extent=[102:23 - 102:33] +// CHECK: 102:23: DeclRefExpr=c:2:14 Extent=[102:23 - 102:24] +// CHECK: 102:28: UnexposedExpr= Extent=[102:28 - 102:33] +// CHECK: 102:28: IntegerLiteral= Extent=[102:28 - 102:33] +// CHECK: 103:9: BinaryOperator= Extent=[103:9 - 103:33] +// CHECK: 103:9: BinaryOperator= Extent=[103:9 - 103:19] +// CHECK: 103:9: DeclRefExpr=c:2:14 Extent=[103:9 - 103:10] +// CHECK: 103:14: UnexposedExpr= Extent=[103:14 - 103:19] +// CHECK: 103:14: IntegerLiteral= Extent=[103:14 - 103:19] +// CHECK: 103:23: BinaryOperator= Extent=[103:23 - 103:33] +// CHECK: 103:23: DeclRefExpr=c:2:14 Extent=[103:23 - 103:24] +// CHECK: 103:28: UnexposedExpr= Extent=[103:28 - 103:33] +// CHECK: 103:28: IntegerLiteral= Extent=[103:28 - 103:33] +// CHECK: 104:9: BinaryOperator= Extent=[104:9 - 104:33] +// CHECK: 104:9: BinaryOperator= Extent=[104:9 - 104:19] +// CHECK: 104:9: DeclRefExpr=c:2:14 Extent=[104:9 - 104:10] +// CHECK: 104:14: UnexposedExpr= Extent=[104:14 - 104:19] +// CHECK: 104:14: IntegerLiteral= Extent=[104:14 - 104:19] +// CHECK: 104:23: BinaryOperator= Extent=[104:23 - 104:33] +// CHECK: 104:23: DeclRefExpr=c:2:14 Extent=[104:23 - 104:24] +// CHECK: 104:28: UnexposedExpr= Extent=[104:28 - 104:33] +// CHECK: 104:28: IntegerLiteral= Extent=[104:28 - 104:33] +// CHECK: 105:8: BinaryOperator= Extent=[105:8 - 105:18] +// CHECK: 105:8: DeclRefExpr=c:2:14 Extent=[105:8 - 105:9] +// CHECK: 105:13: UnexposedExpr= Extent=[105:13 - 105:18] +// CHECK: 105:13: IntegerLiteral= Extent=[105:13 - 105:18] +// CHECK: 105:23: BinaryOperator= Extent=[105:23 - 105:47] +// CHECK: 105:23: BinaryOperator= Extent=[105:23 - 105:33] +// CHECK: 105:23: DeclRefExpr=c:2:14 Extent=[105:23 - 105:24] +// CHECK: 105:28: UnexposedExpr= Extent=[105:28 - 105:33] +// CHECK: 105:28: IntegerLiteral= Extent=[105:28 - 105:33] +// CHECK: 105:37: BinaryOperator= Extent=[105:37 - 105:47] +// CHECK: 105:37: DeclRefExpr=c:2:14 Extent=[105:37 - 105:38] +// CHECK: 105:42: UnexposedExpr= Extent=[105:42 - 105:47] +// CHECK: 105:42: IntegerLiteral= Extent=[105:42 - 105:47] +// CHECK: 106:9: BinaryOperator= Extent=[106:9 - 106:33] +// CHECK: 106:9: BinaryOperator= Extent=[106:9 - 106:19] +// CHECK: 106:9: DeclRefExpr=c:2:14 Extent=[106:9 - 106:10] +// CHECK: 106:14: UnexposedExpr= Extent=[106:14 - 106:19] +// CHECK: 106:14: IntegerLiteral= Extent=[106:14 - 106:19] +// CHECK: 106:23: BinaryOperator= Extent=[106:23 - 106:33] +// CHECK: 106:23: DeclRefExpr=c:2:14 Extent=[106:23 - 106:24] +// CHECK: 106:28: UnexposedExpr= Extent=[106:28 - 106:33] +// CHECK: 106:28: IntegerLiteral= Extent=[106:28 - 106:33] +// CHECK: 107:9: BinaryOperator= Extent=[107:9 - 107:33] +// CHECK: 107:9: BinaryOperator= Extent=[107:9 - 107:19] +// CHECK: 107:9: DeclRefExpr=c:2:14 Extent=[107:9 - 107:10] +// CHECK: 107:14: UnexposedExpr= Extent=[107:14 - 107:19] +// CHECK: 107:14: IntegerLiteral= Extent=[107:14 - 107:19] +// CHECK: 107:23: BinaryOperator= Extent=[107:23 - 107:33] +// CHECK: 107:23: DeclRefExpr=c:2:14 Extent=[107:23 - 107:24] +// CHECK: 107:28: UnexposedExpr= Extent=[107:28 - 107:33] +// CHECK: 107:28: IntegerLiteral= Extent=[107:28 - 107:33] +// CHECK: 108:8: BinaryOperator= Extent=[108:8 - 108:18] +// CHECK: 108:8: DeclRefExpr=c:2:14 Extent=[108:8 - 108:9] +// CHECK: 108:13: UnexposedExpr= Extent=[108:13 - 108:18] +// CHECK: 108:13: IntegerLiteral= Extent=[108:13 - 108:18] +// CHECK: 108:23: BinaryOperator= Extent=[108:23 - 108:47] +// CHECK: 108:23: BinaryOperator= Extent=[108:23 - 108:33] +// CHECK: 108:23: DeclRefExpr=c:2:14 Extent=[108:23 - 108:24] +// CHECK: 108:28: UnexposedExpr= Extent=[108:28 - 108:33] +// CHECK: 108:28: IntegerLiteral= Extent=[108:28 - 108:33] +// CHECK: 108:37: BinaryOperator= Extent=[108:37 - 108:47] +// CHECK: 108:37: DeclRefExpr=c:2:14 Extent=[108:37 - 108:38] +// CHECK: 108:42: UnexposedExpr= Extent=[108:42 - 108:47] +// CHECK: 108:42: IntegerLiteral= Extent=[108:42 - 108:47] +// CHECK: 109:8: BinaryOperator= Extent=[109:8 - 109:18] +// CHECK: 109:8: DeclRefExpr=c:2:14 Extent=[109:8 - 109:9] +// CHECK: 109:13: UnexposedExpr= Extent=[109:13 - 109:18] +// CHECK: 109:13: IntegerLiteral= Extent=[109:13 - 109:18] +// CHECK: 109:22: BinaryOperator= Extent=[109:22 - 109:32] +// CHECK: 109:22: DeclRefExpr=c:2:14 Extent=[109:22 - 109:23] +// CHECK: 109:27: UnexposedExpr= Extent=[109:27 - 109:32] +// CHECK: 109:27: IntegerLiteral= Extent=[109:27 - 109:32] +// CHECK: 109:37: BinaryOperator= Extent=[109:37 - 109:61] +// CHECK: 109:37: BinaryOperator= Extent=[109:37 - 109:47] +// CHECK: 109:37: DeclRefExpr=c:2:14 Extent=[109:37 - 109:38] +// CHECK: 109:42: UnexposedExpr= Extent=[109:42 - 109:47] +// CHECK: 109:42: IntegerLiteral= Extent=[109:42 - 109:47] +// CHECK: 109:51: BinaryOperator= Extent=[109:51 - 109:61] +// CHECK: 109:51: DeclRefExpr=c:2:14 Extent=[109:51 - 109:52] +// CHECK: 109:56: UnexposedExpr= Extent=[109:56 - 109:61] +// CHECK: 109:56: IntegerLiteral= Extent=[109:56 - 109:61] +// CHECK: 110:9: BinaryOperator= Extent=[110:9 - 110:33] +// CHECK: 110:9: BinaryOperator= Extent=[110:9 - 110:19] +// CHECK: 110:9: DeclRefExpr=c:2:14 Extent=[110:9 - 110:10] +// CHECK: 110:14: UnexposedExpr= Extent=[110:14 - 110:19] +// CHECK: 110:14: IntegerLiteral= Extent=[110:14 - 110:19] +// CHECK: 110:23: BinaryOperator= Extent=[110:23 - 110:33] +// CHECK: 110:23: DeclRefExpr=c:2:14 Extent=[110:23 - 110:24] +// CHECK: 110:28: UnexposedExpr= Extent=[110:28 - 110:33] +// CHECK: 110:28: IntegerLiteral= Extent=[110:28 - 110:33] +// CHECK: 111:9: BinaryOperator= Extent=[111:9 - 111:33] +// CHECK: 111:9: BinaryOperator= Extent=[111:9 - 111:19] +// CHECK: 111:9: DeclRefExpr=c:2:14 Extent=[111:9 - 111:10] +// CHECK: 111:14: UnexposedExpr= Extent=[111:14 - 111:19] +// CHECK: 111:14: IntegerLiteral= Extent=[111:14 - 111:19] +// CHECK: 111:23: BinaryOperator= Extent=[111:23 - 111:33] +// CHECK: 111:23: DeclRefExpr=c:2:14 Extent=[111:23 - 111:24] +// CHECK: 111:28: UnexposedExpr= Extent=[111:28 - 111:33] +// CHECK: 111:28: IntegerLiteral= Extent=[111:28 - 111:33] +// CHECK: 112:8: BinaryOperator= Extent=[112:8 - 112:18] +// CHECK: 112:8: DeclRefExpr=c:2:14 Extent=[112:8 - 112:9] +// CHECK: 112:13: UnexposedExpr= Extent=[112:13 - 112:18] +// CHECK: 112:13: IntegerLiteral= Extent=[112:13 - 112:18] +// CHECK: 112:22: BinaryOperator= Extent=[112:22 - 112:32] +// CHECK: 112:22: DeclRefExpr=c:2:14 Extent=[112:22 - 112:23] +// CHECK: 112:27: UnexposedExpr= Extent=[112:27 - 112:32] +// CHECK: 112:27: IntegerLiteral= Extent=[112:27 - 112:32] +// CHECK: 112:37: BinaryOperator= Extent=[112:37 - 112:61] +// CHECK: 112:37: BinaryOperator= Extent=[112:37 - 112:47] +// CHECK: 112:37: DeclRefExpr=c:2:14 Extent=[112:37 - 112:38] +// CHECK: 112:42: UnexposedExpr= Extent=[112:42 - 112:47] +// CHECK: 112:42: IntegerLiteral= Extent=[112:42 - 112:47] +// CHECK: 112:51: BinaryOperator= Extent=[112:51 - 112:61] +// CHECK: 112:51: DeclRefExpr=c:2:14 Extent=[112:51 - 112:52] +// CHECK: 112:56: UnexposedExpr= Extent=[112:56 - 112:61] +// CHECK: 112:56: IntegerLiteral= Extent=[112:56 - 112:61] +// CHECK: 113:9: BinaryOperator= Extent=[113:9 - 113:33] +// CHECK: 113:9: BinaryOperator= Extent=[113:9 - 113:19] +// CHECK: 113:9: DeclRefExpr=c:2:14 Extent=[113:9 - 113:10] +// CHECK: 113:14: UnexposedExpr= Extent=[113:14 - 113:19] +// CHECK: 113:14: IntegerLiteral= Extent=[113:14 - 113:19] +// CHECK: 113:23: BinaryOperator= Extent=[113:23 - 113:33] +// CHECK: 113:23: DeclRefExpr=c:2:14 Extent=[113:23 - 113:24] +// CHECK: 113:28: UnexposedExpr= Extent=[113:28 - 113:33] +// CHECK: 113:28: IntegerLiteral= Extent=[113:28 - 113:33] +// CHECK: 114:8: BinaryOperator= Extent=[114:8 - 114:18] +// CHECK: 114:8: DeclRefExpr=c:2:14 Extent=[114:8 - 114:9] +// CHECK: 114:13: UnexposedExpr= Extent=[114:13 - 114:18] +// CHECK: 114:13: IntegerLiteral= Extent=[114:13 - 114:18] +// CHECK: 114:23: BinaryOperator= Extent=[114:23 - 114:47] +// CHECK: 114:23: BinaryOperator= Extent=[114:23 - 114:33] +// CHECK: 114:23: DeclRefExpr=c:2:14 Extent=[114:23 - 114:24] +// CHECK: 114:28: UnexposedExpr= Extent=[114:28 - 114:33] +// CHECK: 114:28: IntegerLiteral= Extent=[114:28 - 114:33] +// CHECK: 114:37: BinaryOperator= Extent=[114:37 - 114:47] +// CHECK: 114:37: DeclRefExpr=c:2:14 Extent=[114:37 - 114:38] +// CHECK: 114:42: UnexposedExpr= Extent=[114:42 - 114:47] +// CHECK: 114:42: IntegerLiteral= Extent=[114:42 - 114:47] +// CHECK: 115:8: BinaryOperator= Extent=[115:8 - 115:18] +// CHECK: 115:8: DeclRefExpr=c:2:14 Extent=[115:8 - 115:9] +// CHECK: 115:13: UnexposedExpr= Extent=[115:13 - 115:18] +// CHECK: 115:13: IntegerLiteral= Extent=[115:13 - 115:18] +// CHECK: 115:23: BinaryOperator= Extent=[115:23 - 115:47] +// CHECK: 115:23: BinaryOperator= Extent=[115:23 - 115:33] +// CHECK: 115:23: DeclRefExpr=c:2:14 Extent=[115:23 - 115:24] +// CHECK: 115:28: UnexposedExpr= Extent=[115:28 - 115:33] +// CHECK: 115:28: IntegerLiteral= Extent=[115:28 - 115:33] +// CHECK: 115:37: BinaryOperator= Extent=[115:37 - 115:47] +// CHECK: 115:37: DeclRefExpr=c:2:14 Extent=[115:37 - 115:38] +// CHECK: 115:42: UnexposedExpr= Extent=[115:42 - 115:47] +// CHECK: 115:42: IntegerLiteral= Extent=[115:42 - 115:47] +// CHECK: 116:9: BinaryOperator= Extent=[116:9 - 116:33] +// CHECK: 116:9: BinaryOperator= Extent=[116:9 - 116:19] +// CHECK: 116:9: DeclRefExpr=c:2:14 Extent=[116:9 - 116:10] +// CHECK: 116:14: UnexposedExpr= Extent=[116:14 - 116:19] +// CHECK: 116:14: IntegerLiteral= Extent=[116:14 - 116:19] +// CHECK: 116:23: BinaryOperator= Extent=[116:23 - 116:33] +// CHECK: 116:23: DeclRefExpr=c:2:14 Extent=[116:23 - 116:24] +// CHECK: 116:28: UnexposedExpr= Extent=[116:28 - 116:33] +// CHECK: 116:28: IntegerLiteral= Extent=[116:28 - 116:33] +// CHECK: 117:9: BinaryOperator= Extent=[117:9 - 117:33] +// CHECK: 117:9: BinaryOperator= Extent=[117:9 - 117:19] +// CHECK: 117:9: DeclRefExpr=c:2:14 Extent=[117:9 - 117:10] +// CHECK: 117:14: UnexposedExpr= Extent=[117:14 - 117:19] +// CHECK: 117:14: IntegerLiteral= Extent=[117:14 - 117:19] +// CHECK: 117:23: BinaryOperator= Extent=[117:23 - 117:33] +// CHECK: 117:23: DeclRefExpr=c:2:14 Extent=[117:23 - 117:24] +// CHECK: 117:28: UnexposedExpr= Extent=[117:28 - 117:33] +// CHECK: 117:28: IntegerLiteral= Extent=[117:28 - 117:33] +// CHECK: 118:9: BinaryOperator= Extent=[118:9 - 118:35] +// CHECK: 118:9: BinaryOperator= Extent=[118:9 - 118:20] +// CHECK: 118:9: DeclRefExpr=c:2:14 Extent=[118:9 - 118:10] +// CHECK: 118:14: UnexposedExpr= Extent=[118:14 - 118:20] +// CHECK: 118:14: IntegerLiteral= Extent=[118:14 - 118:20] +// CHECK: 118:24: BinaryOperator= Extent=[118:24 - 118:35] +// CHECK: 118:24: DeclRefExpr=c:2:14 Extent=[118:24 - 118:25] +// CHECK: 118:29: UnexposedExpr= Extent=[118:29 - 118:35] +// CHECK: 118:29: IntegerLiteral= Extent=[118:29 - 118:35] +// CHECK: 119:9: BinaryOperator= Extent=[119:9 - 119:35] +// CHECK: 119:9: BinaryOperator= Extent=[119:9 - 119:20] +// CHECK: 119:9: DeclRefExpr=c:2:14 Extent=[119:9 - 119:10] +// CHECK: 119:14: UnexposedExpr= Extent=[119:14 - 119:20] +// CHECK: 119:14: IntegerLiteral= Extent=[119:14 - 119:20] +// CHECK: 119:24: BinaryOperator= Extent=[119:24 - 119:35] +// CHECK: 119:24: DeclRefExpr=c:2:14 Extent=[119:24 - 119:25] +// CHECK: 119:29: UnexposedExpr= Extent=[119:29 - 119:35] +// CHECK: 119:29: IntegerLiteral= Extent=[119:29 - 119:35] +// CHECK: 120:8: BinaryOperator= Extent=[120:8 - 120:19] +// CHECK: 120:8: DeclRefExpr=c:2:14 Extent=[120:8 - 120:9] +// CHECK: 120:13: UnexposedExpr= Extent=[120:13 - 120:19] +// CHECK: 120:13: IntegerLiteral= Extent=[120:13 - 120:19] +// CHECK: 120:24: BinaryOperator= Extent=[120:24 - 120:50] +// CHECK: 120:24: BinaryOperator= Extent=[120:24 - 120:35] +// CHECK: 120:24: DeclRefExpr=c:2:14 Extent=[120:24 - 120:25] +// CHECK: 120:29: UnexposedExpr= Extent=[120:29 - 120:35] +// CHECK: 120:29: IntegerLiteral= Extent=[120:29 - 120:35] +// CHECK: 120:39: BinaryOperator= Extent=[120:39 - 120:50] +// CHECK: 120:39: DeclRefExpr=c:2:14 Extent=[120:39 - 120:40] +// CHECK: 120:44: UnexposedExpr= Extent=[120:44 - 120:50] +// CHECK: 120:44: IntegerLiteral= Extent=[120:44 - 120:50] +// CHECK: 121:9: BinaryOperator= Extent=[121:9 - 121:35] +// CHECK: 121:9: BinaryOperator= Extent=[121:9 - 121:20] +// CHECK: 121:9: DeclRefExpr=c:2:14 Extent=[121:9 - 121:10] +// CHECK: 121:14: UnexposedExpr= Extent=[121:14 - 121:20] +// CHECK: 121:14: IntegerLiteral= Extent=[121:14 - 121:20] +// CHECK: 121:24: BinaryOperator= Extent=[121:24 - 121:35] +// CHECK: 121:24: DeclRefExpr=c:2:14 Extent=[121:24 - 121:25] +// CHECK: 121:29: UnexposedExpr= Extent=[121:29 - 121:35] +// CHECK: 121:29: IntegerLiteral= Extent=[121:29 - 121:35] +// CHECK: 122:8: BinaryOperator= Extent=[122:8 - 122:19] +// CHECK: 122:8: DeclRefExpr=c:2:14 Extent=[122:8 - 122:9] +// CHECK: 122:13: UnexposedExpr= Extent=[122:13 - 122:19] +// CHECK: 122:13: IntegerLiteral= Extent=[122:13 - 122:19] +// CHECK: 122:24: BinaryOperator= Extent=[122:24 - 122:50] +// CHECK: 122:24: BinaryOperator= Extent=[122:24 - 122:35] +// CHECK: 122:24: DeclRefExpr=c:2:14 Extent=[122:24 - 122:25] +// CHECK: 122:29: UnexposedExpr= Extent=[122:29 - 122:35] +// CHECK: 122:29: IntegerLiteral= Extent=[122:29 - 122:35] +// CHECK: 122:39: BinaryOperator= Extent=[122:39 - 122:50] +// CHECK: 122:39: DeclRefExpr=c:2:14 Extent=[122:39 - 122:40] +// CHECK: 122:44: UnexposedExpr= Extent=[122:44 - 122:50] +// CHECK: 122:44: IntegerLiteral= Extent=[122:44 - 122:50] +// CHECK: 123:9: BinaryOperator= Extent=[123:9 - 123:35] +// CHECK: 123:9: BinaryOperator= Extent=[123:9 - 123:20] +// CHECK: 123:9: DeclRefExpr=c:2:14 Extent=[123:9 - 123:10] +// CHECK: 123:14: UnexposedExpr= Extent=[123:14 - 123:20] +// CHECK: 123:14: IntegerLiteral= Extent=[123:14 - 123:20] +// CHECK: 123:24: BinaryOperator= Extent=[123:24 - 123:35] +// CHECK: 123:24: DeclRefExpr=c:2:14 Extent=[123:24 - 123:25] +// CHECK: 123:29: UnexposedExpr= Extent=[123:29 - 123:35] +// CHECK: 123:29: IntegerLiteral= Extent=[123:29 - 123:35] +// CHECK: 124:8: BinaryOperator= Extent=[124:8 - 124:19] +// CHECK: 124:8: DeclRefExpr=c:2:14 Extent=[124:8 - 124:9] +// CHECK: 124:13: UnexposedExpr= Extent=[124:13 - 124:19] +// CHECK: 124:13: IntegerLiteral= Extent=[124:13 - 124:19] +// CHECK: 124:23: BinaryOperator= Extent=[124:23 - 124:34] +// CHECK: 124:23: DeclRefExpr=c:2:14 Extent=[124:23 - 124:24] +// CHECK: 124:28: UnexposedExpr= Extent=[124:28 - 124:34] +// CHECK: 124:28: IntegerLiteral= Extent=[124:28 - 124:34] +// CHECK: 124:38: BinaryOperator= Extent=[124:38 - 124:49] +// CHECK: 124:38: DeclRefExpr=c:2:14 Extent=[124:38 - 124:39] +// CHECK: 124:43: UnexposedExpr= Extent=[124:43 - 124:49] +// CHECK: 124:43: IntegerLiteral= Extent=[124:43 - 124:49] +// CHECK: 124:53: BinaryOperator= Extent=[124:53 - 124:64] +// CHECK: 124:53: DeclRefExpr=c:2:14 Extent=[124:53 - 124:54] +// CHECK: 124:58: UnexposedExpr= Extent=[124:58 - 124:64] +// CHECK: 124:58: IntegerLiteral= Extent=[124:58 - 124:64] +// CHECK: 125:5: BinaryOperator= Extent=[125:5 - 125:16] +// CHECK: 125:5: DeclRefExpr=c:2:14 Extent=[125:5 - 125:6] +// CHECK: 125:10: UnexposedExpr= Extent=[125:10 - 125:16] +// CHECK: 125:10: IntegerLiteral= Extent=[125:10 - 125:16] +// CHECK: 125:20: BinaryOperator= Extent=[125:20 - 125:31] +// CHECK: 125:20: DeclRefExpr=c:2:14 Extent=[125:20 - 125:21] +// CHECK: 125:25: UnexposedExpr= Extent=[125:25 - 125:31] +// CHECK: 125:25: IntegerLiteral= Extent=[125:25 - 125:31] +// CHECK: 125:36: BinaryOperator= Extent=[125:36 - 125:62] +// CHECK: 125:36: BinaryOperator= Extent=[125:36 - 125:47] +// CHECK: 125:36: DeclRefExpr=c:2:14 Extent=[125:36 - 125:37] +// CHECK: 125:41: UnexposedExpr= Extent=[125:41 - 125:47] +// CHECK: 125:41: IntegerLiteral= Extent=[125:41 - 125:47] +// CHECK: 125:51: BinaryOperator= Extent=[125:51 - 125:62] +// CHECK: 125:51: DeclRefExpr=c:2:14 Extent=[125:51 - 125:52] +// CHECK: 125:56: UnexposedExpr= Extent=[125:56 - 125:62] +// CHECK: 125:56: IntegerLiteral= Extent=[125:56 - 125:62] +// CHECK: 126:8: BinaryOperator= Extent=[126:8 - 126:19] +// CHECK: 126:8: DeclRefExpr=c:2:14 Extent=[126:8 - 126:9] +// CHECK: 126:13: UnexposedExpr= Extent=[126:13 - 126:19] +// CHECK: 126:13: IntegerLiteral= Extent=[126:13 - 126:19] +// CHECK: 126:24: BinaryOperator= Extent=[126:24 - 126:50] +// CHECK: 126:24: BinaryOperator= Extent=[126:24 - 126:35] +// CHECK: 126:24: DeclRefExpr=c:2:14 Extent=[126:24 - 126:25] +// CHECK: 126:29: UnexposedExpr= Extent=[126:29 - 126:35] +// CHECK: 126:29: IntegerLiteral= Extent=[126:29 - 126:35] +// CHECK: 126:39: BinaryOperator= Extent=[126:39 - 126:50] +// CHECK: 126:39: DeclRefExpr=c:2:14 Extent=[126:39 - 126:40] +// CHECK: 126:44: UnexposedExpr= Extent=[126:44 - 126:50] +// CHECK: 126:44: IntegerLiteral= Extent=[126:44 - 126:50] +// CHECK: 127:8: BinaryOperator= Extent=[127:8 - 127:19] +// CHECK: 127:8: DeclRefExpr=c:2:14 Extent=[127:8 - 127:9] +// CHECK: 127:13: UnexposedExpr= Extent=[127:13 - 127:19] +// CHECK: 127:13: IntegerLiteral= Extent=[127:13 - 127:19] +// CHECK: 127:23: BinaryOperator= Extent=[127:23 - 127:34] +// CHECK: 127:23: DeclRefExpr=c:2:14 Extent=[127:23 - 127:24] +// CHECK: 127:28: UnexposedExpr= Extent=[127:28 - 127:34] +// CHECK: 127:28: IntegerLiteral= Extent=[127:28 - 127:34] +// CHECK: 127:38: BinaryOperator= Extent=[127:38 - 127:49] +// CHECK: 127:38: DeclRefExpr=c:2:14 Extent=[127:38 - 127:39] +// CHECK: 127:43: UnexposedExpr= Extent=[127:43 - 127:49] +// CHECK: 127:43: IntegerLiteral= Extent=[127:43 - 127:49] +// CHECK: 127:53: BinaryOperator= Extent=[127:53 - 127:64] +// CHECK: 127:53: DeclRefExpr=c:2:14 Extent=[127:53 - 127:54] +// CHECK: 127:58: UnexposedExpr= Extent=[127:58 - 127:64] +// CHECK: 127:58: IntegerLiteral= Extent=[127:58 - 127:64] +// CHECK: 128:6: BinaryOperator= Extent=[128:6 - 128:32] +// CHECK: 128:6: BinaryOperator= Extent=[128:6 - 128:17] +// CHECK: 128:6: DeclRefExpr=c:2:14 Extent=[128:6 - 128:7] +// CHECK: 128:11: UnexposedExpr= Extent=[128:11 - 128:17] +// CHECK: 128:11: IntegerLiteral= Extent=[128:11 - 128:17] +// CHECK: 128:21: BinaryOperator= Extent=[128:21 - 128:32] +// CHECK: 128:21: DeclRefExpr=c:2:14 Extent=[128:21 - 128:22] +// CHECK: 128:26: UnexposedExpr= Extent=[128:26 - 128:32] +// CHECK: 128:26: IntegerLiteral= Extent=[128:26 - 128:32] +// CHECK: 129:9: BinaryOperator= Extent=[129:9 - 129:35] +// CHECK: 129:9: BinaryOperator= Extent=[129:9 - 129:20] +// CHECK: 129:9: DeclRefExpr=c:2:14 Extent=[129:9 - 129:10] +// CHECK: 129:14: UnexposedExpr= Extent=[129:14 - 129:20] +// CHECK: 129:14: IntegerLiteral= Extent=[129:14 - 129:20] +// CHECK: 129:24: BinaryOperator= Extent=[129:24 - 129:35] +// CHECK: 129:24: DeclRefExpr=c:2:14 Extent=[129:24 - 129:25] +// CHECK: 129:29: UnexposedExpr= Extent=[129:29 - 129:35] +// CHECK: 129:29: IntegerLiteral= Extent=[129:29 - 129:35] +// CHECK: 130:8: BinaryOperator= Extent=[130:8 - 130:19] +// CHECK: 130:8: DeclRefExpr=c:2:14 Extent=[130:8 - 130:9] +// CHECK: 130:13: UnexposedExpr= Extent=[130:13 - 130:19] +// CHECK: 130:13: IntegerLiteral= Extent=[130:13 - 130:19] +// CHECK: 130:23: BinaryOperator= Extent=[130:23 - 130:34] +// CHECK: 130:23: DeclRefExpr=c:2:14 Extent=[130:23 - 130:24] +// CHECK: 130:28: UnexposedExpr= Extent=[130:28 - 130:34] +// CHECK: 130:28: IntegerLiteral= Extent=[130:28 - 130:34] +// CHECK: 130:38: BinaryOperator= Extent=[130:38 - 130:49] +// CHECK: 130:38: DeclRefExpr=c:2:14 Extent=[130:38 - 130:39] +// CHECK: 130:43: UnexposedExpr= Extent=[130:43 - 130:49] +// CHECK: 130:43: IntegerLiteral= Extent=[130:43 - 130:49] +// CHECK: 130:53: BinaryOperator= Extent=[130:53 - 130:64] +// CHECK: 130:53: DeclRefExpr=c:2:14 Extent=[130:53 - 130:54] +// CHECK: 130:58: UnexposedExpr= Extent=[130:58 - 130:64] +// CHECK: 130:58: IntegerLiteral= Extent=[130:58 - 130:64] +// CHECK: 131:6: BinaryOperator= Extent=[131:6 - 131:32] +// CHECK: 131:6: BinaryOperator= Extent=[131:6 - 131:17] +// CHECK: 131:6: DeclRefExpr=c:2:14 Extent=[131:6 - 131:7] +// CHECK: 131:11: UnexposedExpr= Extent=[131:11 - 131:17] +// CHECK: 131:11: IntegerLiteral= Extent=[131:11 - 131:17] +// CHECK: 131:21: BinaryOperator= Extent=[131:21 - 131:32] +// CHECK: 131:21: DeclRefExpr=c:2:14 Extent=[131:21 - 131:22] +// CHECK: 131:26: UnexposedExpr= Extent=[131:26 - 131:32] +// CHECK: 131:26: IntegerLiteral= Extent=[131:26 - 131:32] +// CHECK: 132:9: BinaryOperator= Extent=[132:9 - 132:35] +// CHECK: 132:9: BinaryOperator= Extent=[132:9 - 132:20] +// CHECK: 132:9: DeclRefExpr=c:2:14 Extent=[132:9 - 132:10] +// CHECK: 132:14: UnexposedExpr= Extent=[132:14 - 132:20] +// CHECK: 132:14: IntegerLiteral= Extent=[132:14 - 132:20] +// CHECK: 132:24: BinaryOperator= Extent=[132:24 - 132:35] +// CHECK: 132:24: DeclRefExpr=c:2:14 Extent=[132:24 - 132:25] +// CHECK: 132:29: UnexposedExpr= Extent=[132:29 - 132:35] +// CHECK: 132:29: IntegerLiteral= Extent=[132:29 - 132:35] +// CHECK: 133:8: BinaryOperator= Extent=[133:8 - 133:19] +// CHECK: 133:8: DeclRefExpr=c:2:14 Extent=[133:8 - 133:9] +// CHECK: 133:13: UnexposedExpr= Extent=[133:13 - 133:19] +// CHECK: 133:13: IntegerLiteral= Extent=[133:13 - 133:19] +// CHECK: 133:24: BinaryOperator= Extent=[133:24 - 133:50] +// CHECK: 133:24: BinaryOperator= Extent=[133:24 - 133:35] +// CHECK: 133:24: DeclRefExpr=c:2:14 Extent=[133:24 - 133:25] +// CHECK: 133:29: UnexposedExpr= Extent=[133:29 - 133:35] +// CHECK: 133:29: IntegerLiteral= Extent=[133:29 - 133:35] +// CHECK: 133:39: BinaryOperator= Extent=[133:39 - 133:50] +// CHECK: 133:39: DeclRefExpr=c:2:14 Extent=[133:39 - 133:40] +// CHECK: 133:44: UnexposedExpr= Extent=[133:44 - 133:50] +// CHECK: 133:44: IntegerLiteral= Extent=[133:44 - 133:50] +// CHECK: 134:8: BinaryOperator= Extent=[134:8 - 134:19] +// CHECK: 134:8: DeclRefExpr=c:2:14 Extent=[134:8 - 134:9] +// CHECK: 134:13: UnexposedExpr= Extent=[134:13 - 134:19] +// CHECK: 134:13: IntegerLiteral= Extent=[134:13 - 134:19] +// CHECK: 134:23: BinaryOperator= Extent=[134:23 - 134:34] +// CHECK: 134:23: DeclRefExpr=c:2:14 Extent=[134:23 - 134:24] +// CHECK: 134:28: UnexposedExpr= Extent=[134:28 - 134:34] +// CHECK: 134:28: IntegerLiteral= Extent=[134:28 - 134:34] +// CHECK: 134:38: BinaryOperator= Extent=[134:38 - 134:49] +// CHECK: 134:38: DeclRefExpr=c:2:14 Extent=[134:38 - 134:39] +// CHECK: 134:43: UnexposedExpr= Extent=[134:43 - 134:49] +// CHECK: 134:43: IntegerLiteral= Extent=[134:43 - 134:49] +// CHECK: 134:54: BinaryOperator= Extent=[134:54 - 134:80] +// CHECK: 134:54: BinaryOperator= Extent=[134:54 - 134:65] +// CHECK: 134:54: DeclRefExpr=c:2:14 Extent=[134:54 - 134:55] +// CHECK: 134:59: UnexposedExpr= Extent=[134:59 - 134:65] +// CHECK: 134:59: IntegerLiteral= Extent=[134:59 - 134:65] +// CHECK: 134:69: BinaryOperator= Extent=[134:69 - 134:80] +// CHECK: 134:69: DeclRefExpr=c:2:14 Extent=[134:69 - 134:70] +// CHECK: 134:74: UnexposedExpr= Extent=[134:74 - 134:80] +// CHECK: 134:74: IntegerLiteral= Extent=[134:74 - 134:80] +// CHECK: 135:9: BinaryOperator= Extent=[135:9 - 135:35] +// CHECK: 135:9: BinaryOperator= Extent=[135:9 - 135:20] +// CHECK: 135:9: DeclRefExpr=c:2:14 Extent=[135:9 - 135:10] +// CHECK: 135:14: UnexposedExpr= Extent=[135:14 - 135:20] +// CHECK: 135:14: IntegerLiteral= Extent=[135:14 - 135:20] +// CHECK: 135:24: BinaryOperator= Extent=[135:24 - 135:35] +// CHECK: 135:24: DeclRefExpr=c:2:14 Extent=[135:24 - 135:25] +// CHECK: 135:29: UnexposedExpr= Extent=[135:29 - 135:35] +// CHECK: 135:29: IntegerLiteral= Extent=[135:29 - 135:35] +// CHECK: 136:9: BinaryOperator= Extent=[136:9 - 136:35] +// CHECK: 136:9: BinaryOperator= Extent=[136:9 - 136:20] +// CHECK: 136:9: DeclRefExpr=c:2:14 Extent=[136:9 - 136:10] +// CHECK: 136:14: UnexposedExpr= Extent=[136:14 - 136:20] +// CHECK: 136:14: IntegerLiteral= Extent=[136:14 - 136:20] +// CHECK: 136:24: BinaryOperator= Extent=[136:24 - 136:35] +// CHECK: 136:24: DeclRefExpr=c:2:14 Extent=[136:24 - 136:25] +// CHECK: 136:29: UnexposedExpr= Extent=[136:29 - 136:35] +// CHECK: 136:29: IntegerLiteral= Extent=[136:29 - 136:35] +// CHECK: 137:9: BinaryOperator= Extent=[137:9 - 137:35] +// CHECK: 137:9: BinaryOperator= Extent=[137:9 - 137:20] +// CHECK: 137:9: DeclRefExpr=c:2:14 Extent=[137:9 - 137:10] +// CHECK: 137:14: UnexposedExpr= Extent=[137:14 - 137:20] +// CHECK: 137:14: IntegerLiteral= Extent=[137:14 - 137:20] +// CHECK: 137:24: BinaryOperator= Extent=[137:24 - 137:35] +// CHECK: 137:24: DeclRefExpr=c:2:14 Extent=[137:24 - 137:25] +// CHECK: 137:29: UnexposedExpr= Extent=[137:29 - 137:35] +// CHECK: 137:29: IntegerLiteral= Extent=[137:29 - 137:35] +// CHECK: 138:9: BinaryOperator= Extent=[138:9 - 138:35] +// CHECK: 138:9: BinaryOperator= Extent=[138:9 - 138:20] +// CHECK: 138:9: DeclRefExpr=c:2:14 Extent=[138:9 - 138:10] +// CHECK: 138:14: UnexposedExpr= Extent=[138:14 - 138:20] +// CHECK: 138:14: IntegerLiteral= Extent=[138:14 - 138:20] +// CHECK: 138:24: BinaryOperator= Extent=[138:24 - 138:35] +// CHECK: 138:24: DeclRefExpr=c:2:14 Extent=[138:24 - 138:25] +// CHECK: 138:29: UnexposedExpr= Extent=[138:29 - 138:35] +// CHECK: 138:29: IntegerLiteral= Extent=[138:29 - 138:35] +// CHECK: 139:9: BinaryOperator= Extent=[139:9 - 139:35] +// CHECK: 139:9: BinaryOperator= Extent=[139:9 - 139:20] +// CHECK: 139:9: DeclRefExpr=c:2:14 Extent=[139:9 - 139:10] +// CHECK: 139:14: UnexposedExpr= Extent=[139:14 - 139:20] +// CHECK: 139:14: IntegerLiteral= Extent=[139:14 - 139:20] +// CHECK: 139:24: BinaryOperator= Extent=[139:24 - 139:35] +// CHECK: 139:24: DeclRefExpr=c:2:14 Extent=[139:24 - 139:25] +// CHECK: 139:29: UnexposedExpr= Extent=[139:29 - 139:35] +// CHECK: 139:29: IntegerLiteral= Extent=[139:29 - 139:35] +// CHECK: 140:9: BinaryOperator= Extent=[140:9 - 140:35] +// CHECK: 140:9: BinaryOperator= Extent=[140:9 - 140:20] +// CHECK: 140:9: DeclRefExpr=c:2:14 Extent=[140:9 - 140:10] +// CHECK: 140:14: UnexposedExpr= Extent=[140:14 - 140:20] +// CHECK: 140:14: IntegerLiteral= Extent=[140:14 - 140:20] +// CHECK: 140:24: BinaryOperator= Extent=[140:24 - 140:35] +// CHECK: 140:24: DeclRefExpr=c:2:14 Extent=[140:24 - 140:25] +// CHECK: 140:29: UnexposedExpr= Extent=[140:29 - 140:35] +// CHECK: 140:29: IntegerLiteral= Extent=[140:29 - 140:35] +// CHECK: 141:8: BinaryOperator= Extent=[141:8 - 141:19] +// CHECK: 141:8: DeclRefExpr=c:2:14 Extent=[141:8 - 141:9] +// CHECK: 141:13: UnexposedExpr= Extent=[141:13 - 141:19] +// CHECK: 141:13: IntegerLiteral= Extent=[141:13 - 141:19] +// CHECK: 141:23: BinaryOperator= Extent=[141:23 - 141:34] +// CHECK: 141:23: DeclRefExpr=c:2:14 Extent=[141:23 - 141:24] +// CHECK: 141:28: UnexposedExpr= Extent=[141:28 - 141:34] +// CHECK: 141:28: IntegerLiteral= Extent=[141:28 - 141:34] +// CHECK: 141:38: BinaryOperator= Extent=[141:38 - 141:49] +// CHECK: 141:38: DeclRefExpr=c:2:14 Extent=[141:38 - 141:39] +// CHECK: 141:43: UnexposedExpr= Extent=[141:43 - 141:49] +// CHECK: 141:43: IntegerLiteral= Extent=[141:43 - 141:49] +// CHECK: 141:54: BinaryOperator= Extent=[141:54 - 141:80] +// CHECK: 141:54: BinaryOperator= Extent=[141:54 - 141:65] +// CHECK: 141:54: DeclRefExpr=c:2:14 Extent=[141:54 - 141:55] +// CHECK: 141:59: UnexposedExpr= Extent=[141:59 - 141:65] +// CHECK: 141:59: IntegerLiteral= Extent=[141:59 - 141:65] +// CHECK: 141:69: BinaryOperator= Extent=[141:69 - 141:80] +// CHECK: 141:69: DeclRefExpr=c:2:14 Extent=[141:69 - 141:70] +// CHECK: 141:74: UnexposedExpr= Extent=[141:74 - 141:80] +// CHECK: 141:74: IntegerLiteral= Extent=[141:74 - 141:80] +// CHECK: 142:9: BinaryOperator= Extent=[142:9 - 142:35] +// CHECK: 142:9: BinaryOperator= Extent=[142:9 - 142:20] +// CHECK: 142:9: DeclRefExpr=c:2:14 Extent=[142:9 - 142:10] +// CHECK: 142:14: UnexposedExpr= Extent=[142:14 - 142:20] +// CHECK: 142:14: IntegerLiteral= Extent=[142:14 - 142:20] +// CHECK: 142:24: BinaryOperator= Extent=[142:24 - 142:35] +// CHECK: 142:24: DeclRefExpr=c:2:14 Extent=[142:24 - 142:25] +// CHECK: 142:29: UnexposedExpr= Extent=[142:29 - 142:35] +// CHECK: 142:29: IntegerLiteral= Extent=[142:29 - 142:35] +// CHECK: 143:9: BinaryOperator= Extent=[143:9 - 143:35] +// CHECK: 143:9: BinaryOperator= Extent=[143:9 - 143:20] +// CHECK: 143:9: DeclRefExpr=c:2:14 Extent=[143:9 - 143:10] +// CHECK: 143:14: UnexposedExpr= Extent=[143:14 - 143:20] +// CHECK: 143:14: IntegerLiteral= Extent=[143:14 - 143:20] +// CHECK: 143:24: BinaryOperator= Extent=[143:24 - 143:35] +// CHECK: 143:24: DeclRefExpr=c:2:14 Extent=[143:24 - 143:25] +// CHECK: 143:29: UnexposedExpr= Extent=[143:29 - 143:35] +// CHECK: 143:29: IntegerLiteral= Extent=[143:29 - 143:35] +// CHECK: 144:8: BinaryOperator= Extent=[144:8 - 144:19] +// CHECK: 144:8: DeclRefExpr=c:2:14 Extent=[144:8 - 144:9] +// CHECK: 144:13: UnexposedExpr= Extent=[144:13 - 144:19] +// CHECK: 144:13: IntegerLiteral= Extent=[144:13 - 144:19] +// CHECK: 144:24: BinaryOperator= Extent=[144:24 - 144:50] +// CHECK: 144:24: BinaryOperator= Extent=[144:24 - 144:35] +// CHECK: 144:24: DeclRefExpr=c:2:14 Extent=[144:24 - 144:25] +// CHECK: 144:29: UnexposedExpr= Extent=[144:29 - 144:35] +// CHECK: 144:29: IntegerLiteral= Extent=[144:29 - 144:35] +// CHECK: 144:39: BinaryOperator= Extent=[144:39 - 144:50] +// CHECK: 144:39: DeclRefExpr=c:2:14 Extent=[144:39 - 144:40] +// CHECK: 144:44: UnexposedExpr= Extent=[144:44 - 144:50] +// CHECK: 144:44: IntegerLiteral= Extent=[144:44 - 144:50] +// CHECK: 145:9: BinaryOperator= Extent=[145:9 - 145:35] +// CHECK: 145:9: BinaryOperator= Extent=[145:9 - 145:20] +// CHECK: 145:9: DeclRefExpr=c:2:14 Extent=[145:9 - 145:10] +// CHECK: 145:14: UnexposedExpr= Extent=[145:14 - 145:20] +// CHECK: 145:14: IntegerLiteral= Extent=[145:14 - 145:20] +// CHECK: 145:24: BinaryOperator= Extent=[145:24 - 145:35] +// CHECK: 145:24: DeclRefExpr=c:2:14 Extent=[145:24 - 145:25] +// CHECK: 145:29: UnexposedExpr= Extent=[145:29 - 145:35] +// CHECK: 145:29: IntegerLiteral= Extent=[145:29 - 145:35] +// CHECK: 146:9: BinaryOperator= Extent=[146:9 - 146:35] +// CHECK: 146:9: BinaryOperator= Extent=[146:9 - 146:20] +// CHECK: 146:9: DeclRefExpr=c:2:14 Extent=[146:9 - 146:10] +// CHECK: 146:14: UnexposedExpr= Extent=[146:14 - 146:20] +// CHECK: 146:14: IntegerLiteral= Extent=[146:14 - 146:20] +// CHECK: 146:24: BinaryOperator= Extent=[146:24 - 146:35] +// CHECK: 146:24: DeclRefExpr=c:2:14 Extent=[146:24 - 146:25] +// CHECK: 146:29: UnexposedExpr= Extent=[146:29 - 146:35] +// CHECK: 146:29: IntegerLiteral= Extent=[146:29 - 146:35] +// CHECK: 147:9: BinaryOperator= Extent=[147:9 - 147:35] +// CHECK: 147:9: BinaryOperator= Extent=[147:9 - 147:20] +// CHECK: 147:9: DeclRefExpr=c:2:14 Extent=[147:9 - 147:10] +// CHECK: 147:14: UnexposedExpr= Extent=[147:14 - 147:20] +// CHECK: 147:14: IntegerLiteral= Extent=[147:14 - 147:20] +// CHECK: 147:24: BinaryOperator= Extent=[147:24 - 147:35] +// CHECK: 147:24: DeclRefExpr=c:2:14 Extent=[147:24 - 147:25] +// CHECK: 147:29: UnexposedExpr= Extent=[147:29 - 147:35] +// CHECK: 147:29: IntegerLiteral= Extent=[147:29 - 147:35] +// CHECK: 148:9: BinaryOperator= Extent=[148:9 - 148:35] +// CHECK: 148:9: BinaryOperator= Extent=[148:9 - 148:20] +// CHECK: 148:9: DeclRefExpr=c:2:14 Extent=[148:9 - 148:10] +// CHECK: 148:14: UnexposedExpr= Extent=[148:14 - 148:20] +// CHECK: 148:14: IntegerLiteral= Extent=[148:14 - 148:20] +// CHECK: 148:24: BinaryOperator= Extent=[148:24 - 148:35] +// CHECK: 148:24: DeclRefExpr=c:2:14 Extent=[148:24 - 148:25] +// CHECK: 148:29: UnexposedExpr= Extent=[148:29 - 148:35] +// CHECK: 148:29: IntegerLiteral= Extent=[148:29 - 148:35] +// CHECK: 149:9: BinaryOperator= Extent=[149:9 - 149:35] +// CHECK: 149:9: BinaryOperator= Extent=[149:9 - 149:20] +// CHECK: 149:9: DeclRefExpr=c:2:14 Extent=[149:9 - 149:10] +// CHECK: 149:14: UnexposedExpr= Extent=[149:14 - 149:20] +// CHECK: 149:14: IntegerLiteral= Extent=[149:14 - 149:20] +// CHECK: 149:24: BinaryOperator= Extent=[149:24 - 149:35] +// CHECK: 149:24: DeclRefExpr=c:2:14 Extent=[149:24 - 149:25] +// CHECK: 149:29: UnexposedExpr= Extent=[149:29 - 149:35] +// CHECK: 149:29: IntegerLiteral= Extent=[149:29 - 149:35] +// CHECK: 150:9: BinaryOperator= Extent=[150:9 - 150:35] +// CHECK: 150:9: BinaryOperator= Extent=[150:9 - 150:20] +// CHECK: 150:9: DeclRefExpr=c:2:14 Extent=[150:9 - 150:10] +// CHECK: 150:14: UnexposedExpr= Extent=[150:14 - 150:20] +// CHECK: 150:14: IntegerLiteral= Extent=[150:14 - 150:20] +// CHECK: 150:24: BinaryOperator= Extent=[150:24 - 150:35] +// CHECK: 150:24: DeclRefExpr=c:2:14 Extent=[150:24 - 150:25] +// CHECK: 150:29: UnexposedExpr= Extent=[150:29 - 150:35] +// CHECK: 150:29: IntegerLiteral= Extent=[150:29 - 150:35] +// CHECK: 151:8: BinaryOperator= Extent=[151:8 - 151:19] +// CHECK: 151:8: DeclRefExpr=c:2:14 Extent=[151:8 - 151:9] +// CHECK: 151:13: UnexposedExpr= Extent=[151:13 - 151:19] +// CHECK: 151:13: IntegerLiteral= Extent=[151:13 - 151:19] +// CHECK: 151:24: BinaryOperator= Extent=[151:24 - 151:50] +// CHECK: 151:24: BinaryOperator= Extent=[151:24 - 151:35] +// CHECK: 151:24: DeclRefExpr=c:2:14 Extent=[151:24 - 151:25] +// CHECK: 151:29: UnexposedExpr= Extent=[151:29 - 151:35] +// CHECK: 151:29: IntegerLiteral= Extent=[151:29 - 151:35] +// CHECK: 151:39: BinaryOperator= Extent=[151:39 - 151:50] +// CHECK: 151:39: DeclRefExpr=c:2:14 Extent=[151:39 - 151:40] +// CHECK: 151:44: UnexposedExpr= Extent=[151:44 - 151:50] +// CHECK: 151:44: IntegerLiteral= Extent=[151:44 - 151:50] +// CHECK: 152:8: BinaryOperator= Extent=[152:8 - 152:19] +// CHECK: 152:8: DeclRefExpr=c:2:14 Extent=[152:8 - 152:9] +// CHECK: 152:13: UnexposedExpr= Extent=[152:13 - 152:19] +// CHECK: 152:13: IntegerLiteral= Extent=[152:13 - 152:19] +// CHECK: 152:24: BinaryOperator= Extent=[152:24 - 152:50] +// CHECK: 152:24: BinaryOperator= Extent=[152:24 - 152:35] +// CHECK: 152:24: DeclRefExpr=c:2:14 Extent=[152:24 - 152:25] +// CHECK: 152:29: UnexposedExpr= Extent=[152:29 - 152:35] +// CHECK: 152:29: IntegerLiteral= Extent=[152:29 - 152:35] +// CHECK: 152:39: BinaryOperator= Extent=[152:39 - 152:50] +// CHECK: 152:39: DeclRefExpr=c:2:14 Extent=[152:39 - 152:40] +// CHECK: 152:44: UnexposedExpr= Extent=[152:44 - 152:50] +// CHECK: 152:44: IntegerLiteral= Extent=[152:44 - 152:50] +// CHECK: 153:9: BinaryOperator= Extent=[153:9 - 153:35] +// CHECK: 153:9: BinaryOperator= Extent=[153:9 - 153:20] +// CHECK: 153:9: DeclRefExpr=c:2:14 Extent=[153:9 - 153:10] +// CHECK: 153:14: UnexposedExpr= Extent=[153:14 - 153:20] +// CHECK: 153:14: IntegerLiteral= Extent=[153:14 - 153:20] +// CHECK: 153:24: BinaryOperator= Extent=[153:24 - 153:35] +// CHECK: 153:24: DeclRefExpr=c:2:14 Extent=[153:24 - 153:25] +// CHECK: 153:29: UnexposedExpr= Extent=[153:29 - 153:35] +// CHECK: 153:29: IntegerLiteral= Extent=[153:29 - 153:35] +// CHECK: 154:9: BinaryOperator= Extent=[154:9 - 154:35] +// CHECK: 154:9: BinaryOperator= Extent=[154:9 - 154:20] +// CHECK: 154:9: DeclRefExpr=c:2:14 Extent=[154:9 - 154:10] +// CHECK: 154:14: UnexposedExpr= Extent=[154:14 - 154:20] +// CHECK: 154:14: IntegerLiteral= Extent=[154:14 - 154:20] +// CHECK: 154:24: BinaryOperator= Extent=[154:24 - 154:35] +// CHECK: 154:24: DeclRefExpr=c:2:14 Extent=[154:24 - 154:25] +// CHECK: 154:29: UnexposedExpr= Extent=[154:29 - 154:35] +// CHECK: 154:29: IntegerLiteral= Extent=[154:29 - 154:35] +// CHECK: 155:9: BinaryOperator= Extent=[155:9 - 155:35] +// CHECK: 155:9: BinaryOperator= Extent=[155:9 - 155:20] +// CHECK: 155:9: DeclRefExpr=c:2:14 Extent=[155:9 - 155:10] +// CHECK: 155:14: UnexposedExpr= Extent=[155:14 - 155:20] +// CHECK: 155:14: IntegerLiteral= Extent=[155:14 - 155:20] +// CHECK: 155:24: BinaryOperator= Extent=[155:24 - 155:35] +// CHECK: 155:24: DeclRefExpr=c:2:14 Extent=[155:24 - 155:25] +// CHECK: 155:29: UnexposedExpr= Extent=[155:29 - 155:35] +// CHECK: 155:29: IntegerLiteral= Extent=[155:29 - 155:35] +// CHECK: 156:9: BinaryOperator= Extent=[156:9 - 156:35] +// CHECK: 156:9: BinaryOperator= Extent=[156:9 - 156:20] +// CHECK: 156:9: DeclRefExpr=c:2:14 Extent=[156:9 - 156:10] +// CHECK: 156:14: UnexposedExpr= Extent=[156:14 - 156:20] +// CHECK: 156:14: IntegerLiteral= Extent=[156:14 - 156:20] +// CHECK: 156:24: BinaryOperator= Extent=[156:24 - 156:35] +// CHECK: 156:24: DeclRefExpr=c:2:14 Extent=[156:24 - 156:25] +// CHECK: 156:29: UnexposedExpr= Extent=[156:29 - 156:35] +// CHECK: 156:29: IntegerLiteral= Extent=[156:29 - 156:35] +// CHECK: 157:9: BinaryOperator= Extent=[157:9 - 157:35] +// CHECK: 157:9: BinaryOperator= Extent=[157:9 - 157:20] +// CHECK: 157:9: DeclRefExpr=c:2:14 Extent=[157:9 - 157:10] +// CHECK: 157:14: UnexposedExpr= Extent=[157:14 - 157:20] +// CHECK: 157:14: IntegerLiteral= Extent=[157:14 - 157:20] +// CHECK: 157:24: BinaryOperator= Extent=[157:24 - 157:35] +// CHECK: 157:24: DeclRefExpr=c:2:14 Extent=[157:24 - 157:25] +// CHECK: 157:29: UnexposedExpr= Extent=[157:29 - 157:35] +// CHECK: 157:29: IntegerLiteral= Extent=[157:29 - 157:35] +// CHECK: 158:8: BinaryOperator= Extent=[158:8 - 158:19] +// CHECK: 158:8: DeclRefExpr=c:2:14 Extent=[158:8 - 158:9] +// CHECK: 158:13: UnexposedExpr= Extent=[158:13 - 158:19] +// CHECK: 158:13: IntegerLiteral= Extent=[158:13 - 158:19] +// CHECK: 158:24: BinaryOperator= Extent=[158:24 - 158:50] +// CHECK: 158:24: BinaryOperator= Extent=[158:24 - 158:35] +// CHECK: 158:24: DeclRefExpr=c:2:14 Extent=[158:24 - 158:25] +// CHECK: 158:29: UnexposedExpr= Extent=[158:29 - 158:35] +// CHECK: 158:29: IntegerLiteral= Extent=[158:29 - 158:35] +// CHECK: 158:39: BinaryOperator= Extent=[158:39 - 158:50] +// CHECK: 158:39: DeclRefExpr=c:2:14 Extent=[158:39 - 158:40] +// CHECK: 158:44: UnexposedExpr= Extent=[158:44 - 158:50] +// CHECK: 158:44: IntegerLiteral= Extent=[158:44 - 158:50] +// CHECK: 159:9: BinaryOperator= Extent=[159:9 - 159:35] +// CHECK: 159:9: BinaryOperator= Extent=[159:9 - 159:20] +// CHECK: 159:9: DeclRefExpr=c:2:14 Extent=[159:9 - 159:10] +// CHECK: 159:14: UnexposedExpr= Extent=[159:14 - 159:20] +// CHECK: 159:14: IntegerLiteral= Extent=[159:14 - 159:20] +// CHECK: 159:24: BinaryOperator= Extent=[159:24 - 159:35] +// CHECK: 159:24: DeclRefExpr=c:2:14 Extent=[159:24 - 159:25] +// CHECK: 159:29: UnexposedExpr= Extent=[159:29 - 159:35] +// CHECK: 159:29: IntegerLiteral= Extent=[159:29 - 159:35] +// CHECK: 160:8: BinaryOperator= Extent=[160:8 - 160:19] +// CHECK: 160:8: DeclRefExpr=c:2:14 Extent=[160:8 - 160:9] +// CHECK: 160:13: UnexposedExpr= Extent=[160:13 - 160:19] +// CHECK: 160:13: IntegerLiteral= Extent=[160:13 - 160:19] +// CHECK: 160:23: ParenExpr= Extent=[160:23 - 160:51] +// CHECK: 160:24: BinaryOperator= Extent=[160:24 - 160:50] +// CHECK: 160:24: BinaryOperator= Extent=[160:24 - 160:35] +// CHECK: 160:24: DeclRefExpr=c:2:14 Extent=[160:24 - 160:25] +// CHECK: 160:29: UnexposedExpr= Extent=[160:29 - 160:35] +// CHECK: 160:29: IntegerLiteral= Extent=[160:29 - 160:35] +// CHECK: 160:39: BinaryOperator= Extent=[160:39 - 160:50] +// CHECK: 160:39: DeclRefExpr=c:2:14 Extent=[160:39 - 160:40] +// CHECK: 160:44: UnexposedExpr= Extent=[160:44 - 160:50] +// CHECK: 160:44: IntegerLiteral= Extent=[160:44 - 160:50] + diff --git a/clang/test/Index/overrides.cpp b/clang/test/Index/overrides.cpp new file mode 100644 index 0000000..698b256 --- /dev/null +++ b/clang/test/Index/overrides.cpp @@ -0,0 +1,20 @@ +struct A { + virtual void f(int); +}; + +struct B { + virtual void f(int); + virtual void g(); +}; + +struct C : B, A { + virtual void g(); +}; + +struct D : C { + virtual void f(int); +}; + +// RUN: c-index-test -test-load-source local %s | FileCheck %s +// CHECK: overrides.cpp:11:16: CXXMethod=g:11:16 (virtual) [Overrides @7:16] Extent=[11:3 - 11:19] +// CHECK: overrides.cpp:15:16: CXXMethod=f:15:16 (virtual) [Overrides @2:16, @6:16] Extent=[15:3 - 15:22] diff --git a/clang/test/Index/overrides.m b/clang/test/Index/overrides.m new file mode 100644 index 0000000..6908754 --- /dev/null +++ b/clang/test/Index/overrides.m @@ -0,0 +1,61 @@ + +@protocol P1 +- (void)protoMethod; +- (void)protoMethodWithParam:(int)param; +@end + +@protocol P3 +- (void)protoMethod; +@end + +@protocol P2 <P1> +- (void)protoMethod; +@end + +@interface A +- (void)method; +- (void)protoMethod; ++ (void)methodWithParam:(int)param; +@end + +@interface B : A <P2, P3> +- (void)method; +- (void)protoMethod; +@end + +@implementation B +- (void)method { } ++ (void)methodWithParam:(int)param { } +@end + +@protocol P4 <P3> +- (void)protoMethod; +@end + +@interface B(cat) <P4> +- (void)protoMethod; +@end + +@interface B2 +@end + +@interface B2(cat) +-(void)meth; +@end + +@interface I2 : B2 +@end + +@implementation I2 +-(void)meth { } +@end + +// RUN: c-index-test -test-load-source local %s | FileCheck %s +// CHECK: overrides.m:12:9: ObjCInstanceMethodDecl=protoMethod:12:9 [Overrides @3:9] +// CHECK: overrides.m:22:9: ObjCInstanceMethodDecl=method:22:9 [Overrides @16:9] +// CHECK: overrides.m:23:9: ObjCInstanceMethodDecl=protoMethod:23:9 [Overrides @12:9, @8:9, @32:9, @17:9] +// CHECK: overrides.m:27:9: ObjCInstanceMethodDecl=method:27:9 (Definition) [Overrides @16:9] +// CHECK: overrides.m:28:9: ObjCClassMethodDecl=methodWithParam::28:9 (Definition) [Overrides @18:9] +// CHECK: overrides.m:32:9: ObjCInstanceMethodDecl=protoMethod:32:9 [Overrides @8:9] +// CHECK: overrides.m:36:9: ObjCInstanceMethodDecl=protoMethod:36:9 [Overrides @12:9, @8:9, @32:9, @17:9] +// CHECK: overrides.m:50:8: ObjCInstanceMethodDecl=meth:50:8 (Definition) [Overrides @43:8] diff --git a/clang/test/Index/pch-opaque-value.cpp b/clang/test/Index/pch-opaque-value.cpp new file mode 100644 index 0000000..ae6b6dc --- /dev/null +++ b/clang/test/Index/pch-opaque-value.cpp @@ -0,0 +1,16 @@ +struct S { + S(); + S(int); + S(const S &); + ~S(); +}; + +void f() { + try { + } catch (S e) { + } +} + +// RUN: c-index-test -write-pch %t.pch %s +// RUN: c-index-test -test-load-tu-usrs %t.pch local | FileCheck %s +// CHECK: pch-opaque-value.cpp c:pch-opaque-value.cpp@86@F@f#@e Extent=[10:12 - 10:15] diff --git a/clang/test/Index/pch-with-errors.c b/clang/test/Index/pch-with-errors.c new file mode 100644 index 0000000..be8728e --- /dev/null +++ b/clang/test/Index/pch-with-errors.c @@ -0,0 +1,42 @@ +#ifndef HEADER +#define HEADER + +#include "blahblah.h" +void erroneous(int); +void erroneous(float); + +struct bar; +struct zed { + bar g; +}; +struct baz { + zed h; +}; + +void errparm(zed e); + +struct S { + { +; + +#else + +void foo(void) { + erroneous(0); +} + +#endif + +// RUN: c-index-test -write-pch %t.h.pch %s -Xclang -detailed-preprocessing-record +// RUN: c-index-test -test-load-source local %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-PARSE %s +// RUN: c-index-test -index-file %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-INDEX %s + +// CHECK-PARSE: pch-with-errors.c:{{.*}}:6: FunctionDecl=foo +// CHECK-PARSE: pch-with-errors.c:{{.*}}:3: CallExpr=erroneous + +// CHECK-INDEX: [indexDeclaration]: kind: function | name: foo +// CHECK-INDEX: [indexEntityReference]: kind: function | name: erroneous + +// RUN: %clang -fsyntax-only %s -include %t.h 2>&1 | FileCheck -check-prefix=PCH-ERR %s + +// PCH-ERR: error: PCH file contains compiler errors diff --git a/clang/test/Index/pch-with-errors.m b/clang/test/Index/pch-with-errors.m new file mode 100644 index 0000000..cc42cd3 --- /dev/null +++ b/clang/test/Index/pch-with-errors.m @@ -0,0 +1,28 @@ +#ifndef HEADER +#define HEADER + +@interface I(cat) +-(void)meth; +@end + +@interface I2 +-(void)meth; +@end + +#else + +void foo(I2 *i) { + [i meth]; +} + +#endif + +// RUN: c-index-test -write-pch %t.h.pch %s -Xclang -detailed-preprocessing-record +// RUN: c-index-test -test-load-source local %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-PARSE %s +// RUN: c-index-test -index-file %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-INDEX %s + +// CHECK-PARSE: pch-with-errors.m:{{.*}} FunctionDecl=foo +// CHECK-PARSE: pch-with-errors.m:{{.*}} ObjCMessageExpr=meth + +// CHECK-INDEX: [indexDeclaration]: kind: function | name: foo +// CHECK-INDEX: [indexEntityReference]: kind: objc-instance-method | name: meth diff --git a/clang/test/Index/pragma-diag-reparse.c b/clang/test/Index/pragma-diag-reparse.c new file mode 100644 index 0000000..71d0618 --- /dev/null +++ b/clang/test/Index/pragma-diag-reparse.c @@ -0,0 +1,20 @@ +#pragma clang diagnostic ignored "-Wtautological-compare" +#include "pragma_disable_warning.h" + +int main (int argc, const char * argv[]) +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + int x=0; +#pragma clang diagnostic pop + + return x; +} + +void foo() { int b=0; while (b==b); } + +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source-reparse 5 local \ +// RUN: -I%S/Inputs \ +// RUN: %s -Wall -Werror | FileCheck %s + +// CHECK: pragma-diag-reparse.c:8:7: VarDecl=x:8:7 (Definition) Extent=[8:3 - 8:10] diff --git a/clang/test/Index/preamble-reparse-chained.c b/clang/test/Index/preamble-reparse-chained.c new file mode 100644 index 0000000..5cc28f7 --- /dev/null +++ b/clang/test/Index/preamble-reparse-chained.c @@ -0,0 +1,10 @@ +// RUN: c-index-test -write-pch %t.h.pch -x c-header %S/Inputs/a.h +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 all -I%S/Inputs -include %t.h %s | FileCheck %s +#include "a.h" +#include "b.h" + +A a; +B b; + +// CHECK: a.h:3:13: TypedefDecl=A:3:13 (Definition) Extent=[3:1 - 3:14] +// CHECK: b.h:1:15: TypedefDecl=B:1:15 (Definition) Extent=[1:1 - 1:16] diff --git a/clang/test/Index/preamble-reparse-cmd-define.c b/clang/test/Index/preamble-reparse-cmd-define.c new file mode 100644 index 0000000..67ffde1 --- /dev/null +++ b/clang/test/Index/preamble-reparse-cmd-define.c @@ -0,0 +1,9 @@ +// RUN: c-index-test -write-pch %t.h.pch %s.h +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_REMAP_AFTER_TRIAL=1 c-index-test -test-load-source-reparse 3 local \ +// RUN: "-remap-file=%s;%s.remap" %s -include %t.h -D CMD_MACRO=1 2>&1 | FileCheck %s + +// CHECK-NOT: error: + +int foo() { + return x; +} diff --git a/clang/test/Index/preamble-reparse-cmd-define.c.h b/clang/test/Index/preamble-reparse-cmd-define.c.h new file mode 100644 index 0000000..2497af6 --- /dev/null +++ b/clang/test/Index/preamble-reparse-cmd-define.c.h @@ -0,0 +1 @@ +extern int x; diff --git a/clang/test/Index/preamble-reparse-cmd-define.c.remap b/clang/test/Index/preamble-reparse-cmd-define.c.remap new file mode 100644 index 0000000..35c140d --- /dev/null +++ b/clang/test/Index/preamble-reparse-cmd-define.c.remap @@ -0,0 +1,8 @@ + +#ifndef CMD_MACRO +#error CMD_MACRO undefined +#endif + +int foo() { + return x; +} diff --git a/clang/test/Index/preamble-reparse-import.m b/clang/test/Index/preamble-reparse-import.m new file mode 100644 index 0000000..9bdb89a --- /dev/null +++ b/clang/test/Index/preamble-reparse-import.m @@ -0,0 +1,12 @@ +// RUN: c-index-test -write-pch %t.h.pch -x objective-c %s-2.h +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 \ +// RUN: c-index-test -test-load-source-reparse 3 local %s -include %t.h +// RUN: c-index-test -write-pch %t.h.pch -x objective-c %s-3.h +// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 \ +// RUN: c-index-test -test-load-source-reparse 3 local %s -include %t.h + +#import "preamble-reparse-import.m-1.h" + +void foo(); +#import "preamble-reparse-import.m-2.h" +#import "preamble-reparse-import.m-1.h" diff --git a/clang/test/Index/preamble-reparse-import.m-1.h b/clang/test/Index/preamble-reparse-import.m-1.h new file mode 100644 index 0000000..0d15823 --- /dev/null +++ b/clang/test/Index/preamble-reparse-import.m-1.h @@ -0,0 +1,5 @@ +#ifdef PARSED2 +#error parsed twice +#endif + +#define PARSED2 1 diff --git a/clang/test/Index/preamble-reparse-import.m-2.h b/clang/test/Index/preamble-reparse-import.m-2.h new file mode 100644 index 0000000..8acc5c3 --- /dev/null +++ b/clang/test/Index/preamble-reparse-import.m-2.h @@ -0,0 +1,5 @@ +#ifdef PARSED +#error parsed twice +#endif + +#define PARSED 1 diff --git a/clang/test/Index/preamble-reparse-import.m-3.h b/clang/test/Index/preamble-reparse-import.m-3.h new file mode 100644 index 0000000..5369c1b --- /dev/null +++ b/clang/test/Index/preamble-reparse-import.m-3.h @@ -0,0 +1 @@ +#import "preamble-reparse-import.m-2.h" diff --git a/clang/test/Index/preamble-reparse.c b/clang/test/Index/preamble-reparse.c new file mode 100644 index 0000000..5bd03b3 --- /dev/null +++ b/clang/test/Index/preamble-reparse.c @@ -0,0 +1,2 @@ +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local "-remap-file=%S/Inputs/preamble-reparse-1.c;%S/Inputs/preamble-reparse-2.c" %S/Inputs/preamble-reparse-1.c | FileCheck %s +// CHECK: preamble-reparse-1.c:1:5: VarDecl=x:1:5 Extent=[1:1 - 1:6] diff --git a/clang/test/Index/preamble.c b/clang/test/Index/preamble.c new file mode 100644 index 0000000..8a158e9 --- /dev/null +++ b/clang/test/Index/preamble.c @@ -0,0 +1,24 @@ +#include "prefix.h" +#include "preamble.h" +int wibble(int); + +void f(int x) { + +} +// RUN: c-index-test -write-pch %t.pch -x c-header %S/Inputs/prefix.h +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck %s +// RUN: FileCheck -check-prefix CHECK-DIAG %s < %t.stderr.txt +// CHECK: preamble.h:1:12: FunctionDecl=bar:1:12 (Definition) Extent=[1:1 - 6:2] +// CHECK: preamble.h:4:3: BinaryOperator= Extent=[4:3 - 4:13] +// CHECK: preamble.h:4:3: DeclRefExpr=ptr:2:8 Extent=[4:3 - 4:6] +// CHECK: preamble.h:4:9: UnexposedExpr=ptr1:3:10 Extent=[4:9 - 4:13] +// CHECK: preamble.h:4:9: DeclRefExpr=ptr1:3:10 Extent=[4:9 - 4:13] +// CHECK: preamble.h:5:10: IntegerLiteral= Extent=[5:10 - 5:11] +// CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:1 - 3:16] +// CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16] +// CHECK-DIAG: preamble.h:4:7:{4:9-4:13}: warning: incompatible pointer types assigning to 'int *' from 'float *' +// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:6:1 -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck -check-prefix CHECK-CC %s +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText bar}{LeftParen (}{Placeholder int i}{RightParen )} (50) +// CHECK-CC: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int x}{RightParen )} (50) +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText wibble}{LeftParen (}{Placeholder int}{RightParen )} (50) diff --git a/clang/test/Index/preamble_macro_template.cpp b/clang/test/Index/preamble_macro_template.cpp new file mode 100644 index 0000000..ee1b413 --- /dev/null +++ b/clang/test/Index/preamble_macro_template.cpp @@ -0,0 +1,15 @@ +template void foo(int *); + +int main() { } + +// RUN: c-index-test -write-pch %t.pch -fno-delayed-template-parsing -x c++-header %S/Inputs/preamble_macro_template.h +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s | FileCheck %s +// CHECK: preamble_macro_template.h:4:6: FunctionDecl=foo:4:6 (Definition) [Specialization of foo:4:6] Extent=[4:1 - 6:2] +// CHECK: preamble_macro_template.h:4:13: ParmDecl=p:4:13 (Definition) Extent=[4:10 - 4:14] +// CHECK: preamble_macro_template.h:4:16: CompoundStmt= Extent=[4:16 - 6:2] +// CHECK: preamble_macro_template.h:5:3: CStyleCastExpr= Extent=[5:3 - 5:27] +// CHECK: preamble_macro_template.h:1:21: CXXStaticCastExpr= Extent=[1:21 - 5:27] +// CHECK: preamble_macro_template.h:5:25: UnexposedExpr= Extent=[5:25 - 5:26] +// CHECK: preamble_macro_template.h:5:25: IntegerLiteral= Extent=[5:25 - 5:26] +// CHECK: preamble_macro_template.cpp:3:5: FunctionDecl=main:3:5 (Definition) Extent=[3:1 - 3:15] +// CHECK: preamble_macro_template.cpp:3:12: CompoundStmt= Extent=[3:12 - 3:15] diff --git a/clang/test/Index/print-display-names.cpp b/clang/test/Index/print-display-names.cpp new file mode 100644 index 0000000..94fe466 --- /dev/null +++ b/clang/test/Index/print-display-names.cpp @@ -0,0 +1,20 @@ +template<typename T, typename> +class ClassTmpl { }; + +typedef int Integer; + +template class ClassTmpl<Integer, Integer>; + +void f(ClassTmpl<float, Integer> p); + +template<typename T> +void g(ClassTmpl<T, T>); + +template<> void g<int>(ClassTmpl<int, int>); + +// RUN: c-index-test -test-load-source all-display %s | FileCheck %s +// CHECK: print-display-names.cpp:2:7: ClassTemplate=ClassTmpl<T, typename>:2:7 +// CHECK: print-display-names.cpp:6:16: ClassDecl=ClassTmpl<Integer, Integer>:6:16 (Definition) +// CHECK: print-display-names.cpp:8:6: FunctionDecl=f(ClassTmpl<float, Integer>):8:6 +// CHECK: print-display-names.cpp:11:6: FunctionTemplate=g(ClassTmpl<T, T>):11:6 +// CHECK: print-display-names.cpp:13:17: FunctionDecl=g<>(ClassTmpl<int, int>):13:17 [Specialization of g:11:6] diff --git a/clang/test/Index/print-typekind.c b/clang/test/Index/print-typekind.c new file mode 100644 index 0000000..294aea7 --- /dev/null +++ b/clang/test/Index/print-typekind.c @@ -0,0 +1,28 @@ +typedef int FooType; +int *p; +int *f(int *p, char *x, FooType z) { + const FooType w = z; + return p + z; +} +typedef double OtherType; +typedef int ArrayType[5]; + +// RUN: c-index-test -test-print-typekind %s | FileCheck %s +// CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: VarDecl=p:2:6 typekind=Pointer [isPOD=1] +// CHECK: FunctionDecl=f:3:6 (Definition) typekind=FunctionProto [canonical=FunctionProto] [result=Pointer] [args= Pointer Pointer Typedef] [isPOD=0] +// CHECK: ParmDecl=p:3:13 (Definition) typekind=Pointer [isPOD=1] +// CHECK: ParmDecl=x:3:22 (Definition) typekind=Pointer [isPOD=1] +// CHECK: ParmDecl=z:3:33 (Definition) typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: CompoundStmt= typekind=Invalid [isPOD=0] +// CHECK: DeclStmt= typekind=Invalid [isPOD=0] +// CHECK: VarDecl=w:4:17 (Definition) typekind=Typedef const [canonical=Int] [isPOD=1] +// CHECK: TypeRef=FooType:1:13 typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: ReturnStmt= typekind=Invalid [isPOD=0] +// CHECK: BinaryOperator= typekind=Pointer [isPOD=1] +// CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1] +// CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1] +// CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1] +// CHECK: TypedefDecl=ArrayType:8:13 (Definition) typekind=Typedef [canonical=ConstantArray] [isPOD=1] diff --git a/clang/test/Index/print-typekind.m b/clang/test/Index/print-typekind.m new file mode 100644 index 0000000..9db1929 --- /dev/null +++ b/clang/test/Index/print-typekind.m @@ -0,0 +1,10 @@ +@interface Foo +@property (readonly) id x; +-(int) mymethod; +-(int) mymethod2:(int)x blah:(float)y; +@end + +// RUN: c-index-test -test-print-typekind %s | FileCheck %s +// CHECK: ObjCPropertyDecl=x:2:25 typekind=Typedef [canonical=ObjCObjectPointer] +// CHECK: ObjCInstanceMethodDecl=mymethod:3:8 typekind=Invalid [result=Int] +// CHECK: ObjCInstanceMethodDecl=mymethod2:blah::4:8 typekind=Invalid [result=Int] [args= Int Float] diff --git a/clang/test/Index/print-usrs.c b/clang/test/Index/print-usrs.c new file mode 100644 index 0000000..898778b --- /dev/null +++ b/clang/test/Index/print-usrs.c @@ -0,0 +1,17 @@ +// RUN: c-index-test -print-usr-file %s | FileCheck %s +// This isn't really C code; it has a .c extension to get picked up by lit. +ObjCClass NSObject +ObjCCategory NSObject foo +ObjCIvar x c:objc(cs)NSObject +ObjCMethod foo: 0 c:objc(cs)NSObject +ObjCMethod baz:with 1 c:objc(cs)NSObject +ObjCProperty gimme c:objc(cs)NSObject +ObjCProtocol blah +// CHECK: c:objc(cs)NSObject +// CHECK: c:objc(cy)NSObject@foo +// CHECK: c:objc(cs)NSObject@x +// CHECK: c:objc(cs)NSObject(cm)foo: +// CHECK: c:objc(cs)NSObject(im)baz:with +// CHECK: c:objc(cs)NSObject(py)gimme +// CHECK: c:objc(pl)blah + diff --git a/clang/test/Index/properties-class-extensions.m b/clang/test/Index/properties-class-extensions.m new file mode 100644 index 0000000..aa99207 --- /dev/null +++ b/clang/test/Index/properties-class-extensions.m @@ -0,0 +1,99 @@ +// Test that @properties within class extensions are visited by +// clang_visitChildren only in the class extension, not the original +// @interface (where we have a duplicate declaration - to be removed). +@interface Foo {} @end +@interface Foo (Cat) +@property int a; +@end +@interface Foo () +@property int b; +- (void) bar; +@end + +// Test that 'setter' methods defined by @property in the class extension +// but not the in @interface are only presented in the class extension. +@interface Bar +@property (readonly) id bar; +@end +@interface Bar () +@property (readwrite) id bar; +@end + +// Another test, this one involving protocols, where the @property should +// not appear in the @interface. +@class Rdar8467189_Bar; +@protocol Rdar8467189_FooProtocol +@property (readonly) Rdar8467189_Bar *Rdar8467189_Bar; +@end +@interface Rdar8467189_Foo <Rdar8467189_FooProtocol> +@end +@interface Rdar8467189_Foo () +@property (readwrite) Rdar8467189_Bar *Rdar8467189_Bar; +@end + +// Test if the @property added in an extension is not reported in the @interface. +@interface Qux +@end +@interface Qux () +@property (assign, readwrite) id qux; +@end + +@implementation Qux +@dynamic qux; +@end + +// RUN: c-index-test -test-load-source local %s | FileCheck %s +// CHECK: properties-class-extensions.m:4:12: ObjCInterfaceDecl=Foo:4:12 Extent=[4:1 - 4:23] +// CHECK-NOT: properties-class-extensions.m:9:15: ObjCInstanceMethodDecl=setB::9:15 Extent=[9:15 - 9:16] +// CHECK-NOT: properties-class-extensions.m:9:15: ParmDecl=b:9:15 (Definition) Extent=[9:15 - 9:16] +// CHECK: properties-class-extensions.m:5:12: ObjCCategoryDecl=Cat:5:12 Extent=[5:1 - 7:5] +// CHECK: properties-class-extensions.m:5:12: ObjCClassRef=Foo:4:12 Extent=[5:12 - 5:15] +// CHECK: properties-class-extensions.m:6:15: ObjCPropertyDecl=a:6:15 Extent=[6:1 - 6:16] +// CHECK: properties-class-extensions.m:6:15: ObjCInstanceMethodDecl=a:6:15 Extent=[6:15 - 6:16] +// CHECK: properties-class-extensions.m:6:15: ObjCInstanceMethodDecl=setA::6:15 Extent=[6:15 - 6:16] +// CHECK: properties-class-extensions.m:6:15: ParmDecl=a:6:15 (Definition) Extent=[6:15 - 6:16] +// CHECK: properties-class-extensions.m:8:12: ObjCCategoryDecl=:8:12 Extent=[8:1 - 11:5] +// CHECK: properties-class-extensions.m:8:12: ObjCClassRef=Foo:4:12 Extent=[8:12 - 8:15] +// CHECK: properties-class-extensions.m:9:15: ObjCPropertyDecl=b:9:15 Extent=[9:1 - 9:16] +// CHECK: properties-class-extensions.m:9:15: ObjCInstanceMethodDecl=b:9:15 Extent=[9:15 - 9:16] +// CHECK: properties-class-extensions.m:9:15: ObjCInstanceMethodDecl=setB::9:15 Extent=[9:15 - 9:16] +// CHECK: properties-class-extensions.m:9:15: ParmDecl=b:9:15 (Definition) Extent=[9:15 - 9:16] +// CHECK: properties-class-extensions.m:10:10: ObjCInstanceMethodDecl=bar:10:10 Extent=[10:1 - 10:14] +// CHECK: properties-class-extensions.m:15:12: ObjCInterfaceDecl=Bar:15:12 Extent=[15:1 - 17:5] +// CHECK: properties-class-extensions.m:16:25: ObjCPropertyDecl=bar:16:25 Extent=[16:1 - 16:28] +// CHECK: properties-class-extensions.m:16:22: TypeRef=id:0:0 Extent=[16:22 - 16:24] +// CHECK: properties-class-extensions.m:16:25: ObjCInstanceMethodDecl=bar:16:25 Extent=[16:25 - 16:28] +// CHECK: properties-class-extensions.m:18:12: ObjCCategoryDecl=:18:12 Extent=[18:1 - 20:5] +// CHECK: properties-class-extensions.m:18:12: ObjCClassRef=Bar:15:12 Extent=[18:12 - 18:15] +// CHECK: properties-class-extensions.m:19:26: ObjCPropertyDecl=bar:19:26 Extent=[19:1 - 19:29] +// CHECK: properties-class-extensions.m:19:23: TypeRef=id:0:0 Extent=[19:23 - 19:25] +// CHECK-NOT: properties-class-extensions.m:16:25: ObjCInstanceMethodDecl=bar:16:25 Extent=[16:25 - 16:28] +// CHECK: properties-class-extensions.m:19:26: ObjCInstanceMethodDecl=setBar::19:26 Extent=[19:26 - 19:29] +// CHECK: properties-class-extensions.m:19:26: ParmDecl=bar:19:26 (Definition) Extent=[19:26 - 19:29] +// CHECK: properties-class-extensions.m:24:8: ObjCInterfaceDecl=Rdar8467189_Bar:24:8 Extent=[24:1 - 24:23] +// CHECK: properties-class-extensions.m:24:8: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[24:8 - 24:23] +// CHECK: properties-class-extensions.m:25:11: ObjCProtocolDecl=Rdar8467189_FooProtocol:25:11 (Definition) Extent=[25:1 - 27:5] +// CHECK: properties-class-extensions.m:26:39: ObjCPropertyDecl=Rdar8467189_Bar:26:39 Extent=[26:1 - 26:54] +// CHECK: properties-class-extensions.m:26:22: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[26:22 - 26:37] +// CHECK: properties-class-extensions.m:26:39: ObjCInstanceMethodDecl=Rdar8467189_Bar:26:39 Extent=[26:39 - 26:54] +// CHECK: properties-class-extensions.m:28:12: ObjCInterfaceDecl=Rdar8467189_Foo:28:12 Extent=[28:1 - 29:5] +// CHECK: properties-class-extensions.m:28:29: ObjCProtocolRef=Rdar8467189_FooProtocol:25:11 Extent=[28:29 - 28:52] +// CHECK-NOT: properties-class-extensions.m:31:40: ObjCPropertyDecl=Rdar8467189_Bar:31:40 Extent=[31:40 - 31:55] +// CHECK-NOT: properties-class-extensions.m:31:23: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[31:23 - 31:38] +// CHECK: properties-class-extensions.m:30:12: ObjCCategoryDecl=:30:12 Extent=[30:1 - 32:5] +// CHECK: properties-class-extensions.m:30:12: ObjCClassRef=Rdar8467189_Foo:28:12 Extent=[30:12 - 30:27] +// CHECK: properties-class-extensions.m:31:40: ObjCPropertyDecl=Rdar8467189_Bar:31:40 Extent=[31:1 - 31:55] +// CHECK: properties-class-extensions.m:31:23: ObjCClassRef=Rdar8467189_Bar:24:8 Extent=[31:23 - 31:38] +// CHECK: properties-class-extensions.m:31:40: ObjCInstanceMethodDecl=Rdar8467189_Bar:31:40 [Overrides @26:39] Extent=[31:40 - 31:55] +// CHECK: properties-class-extensions.m:31:40: ObjCInstanceMethodDecl=setRdar8467189_Bar::31:40 Extent=[31:40 - 31:55] +// CHECK: properties-class-extensions.m:31:40: ParmDecl=Rdar8467189_Bar:31:40 (Definition) Extent=[31:40 - 31:55] +// CHECK: properties-class-extensions.m:35:12: ObjCInterfaceDecl=Qux:35:12 Extent=[35:1 - 36:5] +// CHECK: properties-class-extensions.m:37:12: ObjCCategoryDecl=:37:12 Extent=[37:1 - 39:5] +// CHECK: properties-class-extensions.m:37:12: ObjCClassRef=Qux:35:12 Extent=[37:12 - 37:15] +// CHECK: properties-class-extensions.m:38:34: ObjCPropertyDecl=qux:38:34 Extent=[38:1 - 38:37] +// CHECK: properties-class-extensions.m:38:31: TypeRef=id:0:0 Extent=[38:31 - 38:33] +// CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=qux:38:34 Extent=[38:34 - 38:37] +// CHECK: properties-class-extensions.m:38:34: ObjCInstanceMethodDecl=setQux::38:34 Extent=[38:34 - 38:37] +// CHECK: properties-class-extensions.m:38:34: ParmDecl=qux:38:34 (Definition) Extent=[38:34 - 38:37] +// CHECK: properties-class-extensions.m:42:10: ObjCDynamicDecl=qux:38:34 (Definition) Extent=[42:1 - 42:13] + diff --git a/clang/test/Index/rdar-8288645-invalid-code.mm b/clang/test/Index/rdar-8288645-invalid-code.mm new file mode 100644 index 0000000..ec45641 --- /dev/null +++ b/clang/test/Index/rdar-8288645-invalid-code.mm @@ -0,0 +1,7 @@ +// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s + +// This test case previously crashed Sema. + +extern "C" { @implementation Foo - (id)initWithBar:(Baz<WozBar>)pepper { + +// CHECK: warning: cannot find interface declaration for 'Foo' diff --git a/clang/test/Index/recover-bad-code-rdar_7487294.c b/clang/test/Index/recover-bad-code-rdar_7487294.c new file mode 100644 index 0000000..e060672 --- /dev/null +++ b/clang/test/Index/recover-bad-code-rdar_7487294.c @@ -0,0 +1,13 @@ +// RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s + +// IMPORTANT: This test case intentionally DOES NOT use --disable-free. It +// tests that we are properly reclaiming the ASTs and we do not have a double free. +// Previously we tried to free the size expression of the VLA twice. + +int foo(int x) { + int y[x * 3]; + help +}; + +// CHECK: 9:3: error: use of undeclared identifier 'help' +// CHECK: help diff --git a/clang/test/Index/recursive-cxx-member-calls.cpp b/clang/test/Index/recursive-cxx-member-calls.cpp new file mode 100644 index 0000000..b80cbf4 --- /dev/null +++ b/clang/test/Index/recursive-cxx-member-calls.cpp @@ -0,0 +1,2243 @@ +typedef long unsigned int __darwin_size_t; +typedef __darwin_size_t size_t; +namespace std { + template < class _T1, class _T2 > struct pair { _T2 second; }; +} +extern "C" { + int memcmp(const void *, const void *, size_t); + size_t strlen(const char *); +} +namespace clang { + class IdentifierInfo; + class AttributeList { + enum Kind { + AT_IBAction, AT_IBOutlet, AT_IBOutletCollection, + AT_address_space, AT_alias, AT_aligned, AT_always_inline, + AT_analyzer_noreturn, AT_annotate, AT_base_check, AT_blocks, + AT_carries_dependency, AT_cdecl, AT_cleanup, AT_const, AT_constructor, + AT_deprecated, AT_destructor, AT_dllexport, AT_dllimport, + AT_ext_vector_type, AT_fastcall, AT_final, AT_format, AT_format_arg, + AT_gnu_inline, AT_hiding, AT_malloc, AT_mode, AT_naked, AT_nodebug, + AT_noinline, AT_no_instrument_function, AT_nonnull, AT_noreturn, + AT_nothrow, AT_nsobject, AT_objc_exception, AT_override, + AT_cf_returns_not_retained, AT_cf_returns_retained, + AT_ns_returns_not_retained, AT_ns_returns_retained, AT_objc_gc, + AT_overloadable, AT_ownership_holds, AT_ownership_returns, + AT_ownership_takes, AT_packed, AT_pascal, AT_pure, AT_regparm, + AT_section, AT_sentinel, AT_stdcall, AT_thiscall, AT_transparent_union, + AT_unavailable, AT_unused, AT_used, AT_vecreturn, AT_vector_size, + AT_visibility, AT_warn_unused_result, AT_weak, AT_weakref, + AT_weak_import, AT_reqd_wg_size, AT_init_priority, + AT_returns_twice, IgnoredAttribute, UnknownAttribute + }; + static Kind getKind(const IdentifierInfo * Name); + }; +} +size_t magic_length(const char *s); +namespace llvm { +class StringRef { +public: + typedef const char *iterator; + static const size_t npos = ~size_t(0); +private: + const char *Data; + size_t Length; + static size_t min(size_t a, size_t b) { return a < b ? a : b; } +public: + StringRef(): Data(0), Length(0) {} + StringRef(const char *Str) : Data(Str), Length(magic_length(Str)) {} + StringRef(const char *data, size_t length) : Data(data), Length(length) {} + iterator end() const { return Data; } + size_t size() const { return Length; } + bool startswith(StringRef Prefix) const { + return Length >= Prefix.Length && + memcmp(Data, Prefix.Data, Prefix.Length) == 0; + } + bool endswith(StringRef Suffix) const { + return Length >= Suffix.Length && + memcmp(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0; + } + StringRef substr(size_t Start, size_t N = npos) const { + return StringRef(Data + Start, min(N, Length - Start)); + } +}; +} +namespace clang { +class IdentifierInfo { +public:IdentifierInfo(); + const char *getNameStart() const { + typedef std::pair < IdentifierInfo, const char *>actualtype; + return ((const actualtype *) this)->second; + } + unsigned getLength() const { + typedef std::pair < IdentifierInfo, const char *>actualtype; + const char *p = ((const actualtype *) this)->second - 2; + return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1; + } + llvm::StringRef getName() const { + return llvm::StringRef(getNameStart(), getLength()); + } +}; +} +namespace llvm { +template < typename T, typename R = T > class StringSwitch { + StringRef Str; + const T *Result; +public: + explicit StringSwitch(StringRef Str) : Str(Str), Result(0) {} + template < unsigned N > StringSwitch & Case(const char (&S)[N], + const T & Value) { + return *this; + } + R Default(const T & Value) const { + return Value; + } +}; +} + +using namespace clang; + +AttributeList::Kind AttributeList::getKind(const IdentifierInfo * Name) { + llvm::StringRef AttrName = Name->getName(); + if (AttrName.startswith("__") && AttrName.endswith("__")) + AttrName = AttrName.substr(2, AttrName.size() - 4); + + return llvm::StringSwitch < AttributeList::Kind > (AttrName) + .Case("weak", AT_weak) + .Case("weakref", AT_weakref) + .Case("pure", AT_pure) + .Case("mode", AT_mode) + .Case("used", AT_used) + .Case("alias", AT_alias) + .Case("align", AT_aligned) + .Case("final", AT_final) + .Case("cdecl", AT_cdecl) + .Case("const", AT_const) + .Case("__const", AT_const) + .Case("blocks", AT_blocks) + .Case("format", AT_format) + .Case("hiding", AT_hiding) + .Case("malloc", AT_malloc) + .Case("packed", AT_packed) + .Case("unused", AT_unused) + .Case("aligned", AT_aligned) + .Case("cleanup", AT_cleanup) + .Case("naked", AT_naked) + .Case("nodebug", AT_nodebug) + .Case("nonnull", AT_nonnull) + .Case("nothrow", AT_nothrow) + .Case("objc_gc", AT_objc_gc) + .Case("regparm", AT_regparm) + .Case("section", AT_section) + .Case("stdcall", AT_stdcall) + .Case("annotate", AT_annotate) + .Case("fastcall", AT_fastcall) + .Case("ibaction", AT_IBAction) + .Case("iboutlet", AT_IBOutlet) + .Case("iboutletcollection", AT_IBOutletCollection) + .Case("noreturn", AT_noreturn) + .Case("noinline", AT_noinline) + .Case("override", AT_override) + .Case("sentinel", AT_sentinel) + .Case("NSObject", AT_nsobject) + .Case("dllimport", AT_dllimport) + .Case("dllexport", AT_dllexport) + .Case("may_alias", IgnoredAttribute) + .Case("base_check", AT_base_check) + .Case("deprecated", AT_deprecated) + .Case("visibility", AT_visibility) + .Case("destructor", AT_destructor) + .Case("format_arg", AT_format_arg) + .Case("gnu_inline", AT_gnu_inline) + .Case("weak_import", AT_weak_import) + .Case("vecreturn", AT_vecreturn) + .Case("vector_size", AT_vector_size) + .Case("constructor", AT_constructor) + .Case("unavailable", AT_unavailable) + .Case("overloadable", AT_overloadable) + .Case("address_space", AT_address_space) + .Case("always_inline", AT_always_inline) + .Case("returns_twice", AT_returns_twice) + .Case("vec_type_hint", IgnoredAttribute) + .Case("objc_exception", AT_objc_exception) + .Case("ext_vector_type", AT_ext_vector_type) + .Case("transparent_union", AT_transparent_union) + .Case("analyzer_noreturn", AT_analyzer_noreturn) + .Case("warn_unused_result", AT_warn_unused_result) + .Case("carries_dependency", AT_carries_dependency) + .Case("ns_returns_not_retained", AT_ns_returns_not_retained) + .Case("ns_returns_retained", AT_ns_returns_retained) + .Case("cf_returns_not_retained", AT_cf_returns_not_retained) + .Case("cf_returns_retained", AT_cf_returns_retained) + .Case("ownership_returns", AT_ownership_returns) + .Case("ownership_holds", AT_ownership_holds) + .Case("ownership_takes", AT_ownership_takes) + .Case("reqd_work_group_size", AT_reqd_wg_size) + .Case("init_priority", AT_init_priority) + .Case("no_instrument_function", AT_no_instrument_function) + .Case("thiscall", AT_thiscall) + .Case("pascal", AT_pascal) + .Case("__cdecl", AT_cdecl) + .Case("__stdcall", AT_stdcall) + .Case("__fastcall", AT_fastcall) + .Case("__thiscall", AT_thiscall) + .Case("__pascal", AT_pascal) + .Default(UnknownAttribute); +} + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:186:1 %s 2>&1 | FileCheck -check-prefix=CHECK-tokens %s +// CHECK-tokens: Keyword: "typedef" [1:1 - 1:8] +// CHECK-tokens: Keyword: "long" [1:9 - 1:13] +// CHECK-tokens: Keyword: "unsigned" [1:14 - 1:22] +// CHECK-tokens: Keyword: "int" [1:23 - 1:26] +// CHECK-tokens: Identifier: "__darwin_size_t" [1:27 - 1:42] TypedefDecl=__darwin_size_t:1:27 (Definition) +// CHECK-tokens: Punctuation: ";" [1:42 - 1:43] +// CHECK-tokens: Keyword: "typedef" [2:1 - 2:8] +// CHECK-tokens: Identifier: "__darwin_size_t" [2:9 - 2:24] +// CHECK-tokens: Identifier: "size_t" [2:25 - 2:31] TypedefDecl=size_t:2:25 (Definition) +// CHECK-tokens: Punctuation: ";" [2:31 - 2:32] +// CHECK-tokens: Keyword: "namespace" [3:1 - 3:10] +// CHECK-tokens: Identifier: "std" [3:11 - 3:14] Namespace=std:3:11 (Definition) +// CHECK-tokens: Punctuation: "{" [3:15 - 3:16] Namespace=std:3:11 (Definition) +// CHECK-tokens: Keyword: "template" [4:3 - 4:11] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Punctuation: "<" [4:12 - 4:13] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Keyword: "class" [4:14 - 4:19] TemplateTypeParameter=_T1:4:20 (Definition) +// CHECK-tokens: Identifier: "_T1" [4:20 - 4:23] TemplateTypeParameter=_T1:4:20 (Definition) +// CHECK-tokens: Punctuation: "," [4:23 - 4:24] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Keyword: "class" [4:25 - 4:30] TemplateTypeParameter=_T2:4:31 (Definition) +// CHECK-tokens: Identifier: "_T2" [4:31 - 4:34] TemplateTypeParameter=_T2:4:31 (Definition) +// CHECK-tokens: Punctuation: ">" [4:35 - 4:36] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Keyword: "struct" [4:37 - 4:43] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Identifier: "pair" [4:44 - 4:48] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Punctuation: "{" [4:49 - 4:50] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Identifier: "_T2" [4:51 - 4:54] TypeRef=_T2:4:31 +// CHECK-tokens: Identifier: "second" [4:55 - 4:61] FieldDecl=second:4:55 (Definition) +// CHECK-tokens: Punctuation: ";" [4:61 - 4:62] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Punctuation: "}" [4:63 - 4:64] ClassTemplate=pair:4:44 (Definition) +// CHECK-tokens: Punctuation: ";" [4:64 - 4:65] Namespace=std:3:11 (Definition) +// CHECK-tokens: Punctuation: "}" [5:1 - 5:2] Namespace=std:3:11 (Definition) +// CHECK-tokens: Keyword: "extern" [6:1 - 6:7] +// CHECK-tokens: Literal: ""C"" [6:8 - 6:11] UnexposedDecl=:6:8 (Definition) +// CHECK-tokens: Punctuation: "{" [6:12 - 6:13] UnexposedDecl=:6:8 (Definition) +// CHECK-tokens: Keyword: "int" [7:3 - 7:6] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Identifier: "memcmp" [7:7 - 7:13] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Punctuation: "(" [7:13 - 7:14] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Keyword: "const" [7:14 - 7:19] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Keyword: "void" [7:20 - 7:24] ParmDecl=:7:26 (Definition) +// CHECK-tokens: Punctuation: "*" [7:25 - 7:26] ParmDecl=:7:26 (Definition) +// CHECK-tokens: Punctuation: "," [7:26 - 7:27] ParmDecl=:7:26 (Definition) +// CHECK-tokens: Keyword: "const" [7:28 - 7:33] FunctionDecl=memcmp:7:7 +// CHECK-tokens: Keyword: "void" [7:34 - 7:38] ParmDecl=:7:40 (Definition) +// CHECK-tokens: Punctuation: "*" [7:39 - 7:40] ParmDecl=:7:40 (Definition) +// CHECK-tokens: Punctuation: "," [7:40 - 7:41] ParmDecl=:7:40 (Definition) +// CHECK-tokens: Identifier: "size_t" [7:42 - 7:48] TypeRef=size_t:2:25 +// CHECK-tokens: Punctuation: ")" [7:48 - 7:49] ParmDecl=:7:48 (Definition) +// CHECK-tokens: Punctuation: ";" [7:49 - 7:50] UnexposedDecl=:6:8 (Definition) +// CHECK-tokens: Identifier: "size_t" [8:3 - 8:9] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "strlen" [8:10 - 8:16] FunctionDecl=strlen:8:10 +// CHECK-tokens: Punctuation: "(" [8:16 - 8:17] FunctionDecl=strlen:8:10 +// CHECK-tokens: Keyword: "const" [8:17 - 8:22] FunctionDecl=strlen:8:10 +// CHECK-tokens: Keyword: "char" [8:23 - 8:27] ParmDecl=:8:29 (Definition) +// CHECK-tokens: Punctuation: "*" [8:28 - 8:29] ParmDecl=:8:29 (Definition) +// CHECK-tokens: Punctuation: ")" [8:29 - 8:30] ParmDecl=:8:29 (Definition) +// CHECK-tokens: Punctuation: ";" [8:30 - 8:31] +// CHECK-tokens: Punctuation: "}" [9:1 - 9:2] +// CHECK-tokens: Keyword: "namespace" [10:1 - 10:10] +// CHECK-tokens: Identifier: "clang" [10:17 - 10:22] Namespace=clang:10:17 (Definition) +// CHECK-tokens: Punctuation: "{" [10:23 - 10:24] Namespace=clang:10:17 (Definition) +// CHECK-tokens: Keyword: "class" [11:3 - 11:8] ClassDecl=IdentifierInfo:11:9 +// CHECK-tokens: Identifier: "IdentifierInfo" [11:9 - 11:23] ClassDecl=IdentifierInfo:11:9 +// CHECK-tokens: Punctuation: ";" [11:23 - 11:24] Namespace=clang:10:17 (Definition) +// CHECK-tokens: Keyword: "class" [12:3 - 12:8] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Identifier: "AttributeList" [12:9 - 12:22] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Punctuation: "{" [12:23 - 12:24] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Keyword: "enum" [13:5 - 13:9] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "Kind" [13:10 - 13:14] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Punctuation: "{" [13:15 - 13:16] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_IBAction" [14:7 - 14:18] EnumConstantDecl=AT_IBAction:14:7 (Definition) +// CHECK-tokens: Punctuation: "," [14:18 - 14:19] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_IBOutlet" [14:20 - 14:31] EnumConstantDecl=AT_IBOutlet:14:20 (Definition) +// CHECK-tokens: Punctuation: "," [14:31 - 14:32] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_IBOutletCollection" [14:33 - 14:54] EnumConstantDecl=AT_IBOutletCollection:14:33 (Definition) +// CHECK-tokens: Punctuation: "," [14:54 - 14:55] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_address_space" [15:7 - 15:23] EnumConstantDecl=AT_address_space:15:7 (Definition) +// CHECK-tokens: Punctuation: "," [15:23 - 15:24] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_alias" [15:25 - 15:33] EnumConstantDecl=AT_alias:15:25 (Definition) +// CHECK-tokens: Punctuation: "," [15:33 - 15:34] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_aligned" [15:35 - 15:45] EnumConstantDecl=AT_aligned:15:35 (Definition) +// CHECK-tokens: Punctuation: "," [15:45 - 15:46] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_always_inline" [15:47 - 15:63] EnumConstantDecl=AT_always_inline:15:47 (Definition) +// CHECK-tokens: Punctuation: "," [15:63 - 15:64] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_analyzer_noreturn" [16:7 - 16:27] EnumConstantDecl=AT_analyzer_noreturn:16:7 (Definition) +// CHECK-tokens: Punctuation: "," [16:27 - 16:28] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_annotate" [16:29 - 16:40] EnumConstantDecl=AT_annotate:16:29 (Definition) +// CHECK-tokens: Punctuation: "," [16:40 - 16:41] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_base_check" [16:42 - 16:55] EnumConstantDecl=AT_base_check:16:42 (Definition) +// CHECK-tokens: Punctuation: "," [16:55 - 16:56] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_blocks" [16:57 - 16:66] EnumConstantDecl=AT_blocks:16:57 (Definition) +// CHECK-tokens: Punctuation: "," [16:66 - 16:67] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_carries_dependency" [17:7 - 17:28] EnumConstantDecl=AT_carries_dependency:17:7 (Definition) +// CHECK-tokens: Punctuation: "," [17:28 - 17:29] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_cdecl" [17:30 - 17:38] EnumConstantDecl=AT_cdecl:17:30 (Definition) +// CHECK-tokens: Punctuation: "," [17:38 - 17:39] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_cleanup" [17:40 - 17:50] EnumConstantDecl=AT_cleanup:17:40 (Definition) +// CHECK-tokens: Punctuation: "," [17:50 - 17:51] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_const" [17:52 - 17:60] EnumConstantDecl=AT_const:17:52 (Definition) +// CHECK-tokens: Punctuation: "," [17:60 - 17:61] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_constructor" [17:62 - 17:76] EnumConstantDecl=AT_constructor:17:62 (Definition) +// CHECK-tokens: Punctuation: "," [17:76 - 17:77] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_deprecated" [18:7 - 18:20] EnumConstantDecl=AT_deprecated:18:7 (Definition) +// CHECK-tokens: Punctuation: "," [18:20 - 18:21] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_destructor" [18:22 - 18:35] EnumConstantDecl=AT_destructor:18:22 (Definition) +// CHECK-tokens: Punctuation: "," [18:35 - 18:36] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_dllexport" [18:37 - 18:49] EnumConstantDecl=AT_dllexport:18:37 (Definition) +// CHECK-tokens: Punctuation: "," [18:49 - 18:50] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_dllimport" [18:51 - 18:63] EnumConstantDecl=AT_dllimport:18:51 (Definition) +// CHECK-tokens: Punctuation: "," [18:63 - 18:64] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ext_vector_type" [19:7 - 19:25] EnumConstantDecl=AT_ext_vector_type:19:7 (Definition) +// CHECK-tokens: Punctuation: "," [19:25 - 19:26] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_fastcall" [19:27 - 19:38] EnumConstantDecl=AT_fastcall:19:27 (Definition) +// CHECK-tokens: Punctuation: "," [19:38 - 19:39] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_final" [19:40 - 19:48] EnumConstantDecl=AT_final:19:40 (Definition) +// CHECK-tokens: Punctuation: "," [19:48 - 19:49] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_format" [19:50 - 19:59] EnumConstantDecl=AT_format:19:50 (Definition) +// CHECK-tokens: Punctuation: "," [19:59 - 19:60] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_format_arg" [19:61 - 19:74] EnumConstantDecl=AT_format_arg:19:61 (Definition) +// CHECK-tokens: Punctuation: "," [19:74 - 19:75] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_gnu_inline" [20:7 - 20:20] EnumConstantDecl=AT_gnu_inline:20:7 (Definition) +// CHECK-tokens: Punctuation: "," [20:20 - 20:21] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_hiding" [20:22 - 20:31] EnumConstantDecl=AT_hiding:20:22 (Definition) +// CHECK-tokens: Punctuation: "," [20:31 - 20:32] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_malloc" [20:33 - 20:42] EnumConstantDecl=AT_malloc:20:33 (Definition) +// CHECK-tokens: Punctuation: "," [20:42 - 20:43] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_mode" [20:44 - 20:51] EnumConstantDecl=AT_mode:20:44 (Definition) +// CHECK-tokens: Punctuation: "," [20:51 - 20:52] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_naked" [20:53 - 20:61] EnumConstantDecl=AT_naked:20:53 (Definition) +// CHECK-tokens: Punctuation: "," [20:61 - 20:62] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_nodebug" [20:63 - 20:73] EnumConstantDecl=AT_nodebug:20:63 (Definition) +// CHECK-tokens: Punctuation: "," [20:73 - 20:74] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_noinline" [21:7 - 21:18] EnumConstantDecl=AT_noinline:21:7 (Definition) +// CHECK-tokens: Punctuation: "," [21:18 - 21:19] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_no_instrument_function" [21:20 - 21:45] EnumConstantDecl=AT_no_instrument_function:21:20 (Definition) +// CHECK-tokens: Punctuation: "," [21:45 - 21:46] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_nonnull" [21:47 - 21:57] EnumConstantDecl=AT_nonnull:21:47 (Definition) +// CHECK-tokens: Punctuation: "," [21:57 - 21:58] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_noreturn" [21:59 - 21:70] EnumConstantDecl=AT_noreturn:21:59 (Definition) +// CHECK-tokens: Punctuation: "," [21:70 - 21:71] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_nothrow" [22:7 - 22:17] EnumConstantDecl=AT_nothrow:22:7 (Definition) +// CHECK-tokens: Punctuation: "," [22:17 - 22:18] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_nsobject" [22:19 - 22:30] EnumConstantDecl=AT_nsobject:22:19 (Definition) +// CHECK-tokens: Punctuation: "," [22:30 - 22:31] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_objc_exception" [22:32 - 22:49] EnumConstantDecl=AT_objc_exception:22:32 (Definition) +// CHECK-tokens: Punctuation: "," [22:49 - 22:50] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_override" [22:51 - 22:62] EnumConstantDecl=AT_override:22:51 (Definition) +// CHECK-tokens: Punctuation: "," [22:62 - 22:63] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_cf_returns_not_retained" [23:7 - 23:33] EnumConstantDecl=AT_cf_returns_not_retained:23:7 (Definition) +// CHECK-tokens: Punctuation: "," [23:33 - 23:34] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_cf_returns_retained" [23:35 - 23:57] EnumConstantDecl=AT_cf_returns_retained:23:35 (Definition) +// CHECK-tokens: Punctuation: "," [23:57 - 23:58] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ns_returns_not_retained" [24:7 - 24:33] EnumConstantDecl=AT_ns_returns_not_retained:24:7 (Definition) +// CHECK-tokens: Punctuation: "," [24:33 - 24:34] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ns_returns_retained" [24:35 - 24:57] EnumConstantDecl=AT_ns_returns_retained:24:35 (Definition) +// CHECK-tokens: Punctuation: "," [24:57 - 24:58] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_objc_gc" [24:59 - 24:69] EnumConstantDecl=AT_objc_gc:24:59 (Definition) +// CHECK-tokens: Punctuation: "," [24:69 - 24:70] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_overloadable" [25:7 - 25:22] EnumConstantDecl=AT_overloadable:25:7 (Definition) +// CHECK-tokens: Punctuation: "," [25:22 - 25:23] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ownership_holds" [25:24 - 25:42] EnumConstantDecl=AT_ownership_holds:25:24 (Definition) +// CHECK-tokens: Punctuation: "," [25:42 - 25:43] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ownership_returns" [25:44 - 25:64] EnumConstantDecl=AT_ownership_returns:25:44 (Definition) +// CHECK-tokens: Punctuation: "," [25:64 - 25:65] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_ownership_takes" [26:7 - 26:25] EnumConstantDecl=AT_ownership_takes:26:7 (Definition) +// CHECK-tokens: Punctuation: "," [26:25 - 26:26] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_packed" [26:27 - 26:36] EnumConstantDecl=AT_packed:26:27 (Definition) +// CHECK-tokens: Punctuation: "," [26:36 - 26:37] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_pascal" [26:38 - 26:47] EnumConstantDecl=AT_pascal:26:38 (Definition) +// CHECK-tokens: Punctuation: "," [26:47 - 26:48] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_pure" [26:49 - 26:56] EnumConstantDecl=AT_pure:26:49 (Definition) +// CHECK-tokens: Punctuation: "," [26:56 - 26:57] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_regparm" [26:58 - 26:68] EnumConstantDecl=AT_regparm:26:58 (Definition) +// CHECK-tokens: Punctuation: "," [26:68 - 26:69] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_section" [27:7 - 27:17] EnumConstantDecl=AT_section:27:7 (Definition) +// CHECK-tokens: Punctuation: "," [27:17 - 27:18] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_sentinel" [27:19 - 27:30] EnumConstantDecl=AT_sentinel:27:19 (Definition) +// CHECK-tokens: Punctuation: "," [27:30 - 27:31] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_stdcall" [27:32 - 27:42] EnumConstantDecl=AT_stdcall:27:32 (Definition) +// CHECK-tokens: Punctuation: "," [27:42 - 27:43] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_thiscall" [27:44 - 27:55] EnumConstantDecl=AT_thiscall:27:44 (Definition) +// CHECK-tokens: Punctuation: "," [27:55 - 27:56] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_transparent_union" [27:57 - 27:77] EnumConstantDecl=AT_transparent_union:27:57 (Definition) +// CHECK-tokens: Punctuation: "," [27:77 - 27:78] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_unavailable" [28:7 - 28:21] EnumConstantDecl=AT_unavailable:28:7 (Definition) +// CHECK-tokens: Punctuation: "," [28:21 - 28:22] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_unused" [28:23 - 28:32] EnumConstantDecl=AT_unused:28:23 (Definition) +// CHECK-tokens: Punctuation: "," [28:32 - 28:33] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_used" [28:34 - 28:41] EnumConstantDecl=AT_used:28:34 (Definition) +// CHECK-tokens: Punctuation: "," [28:41 - 28:42] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_vecreturn" [28:43 - 28:55] EnumConstantDecl=AT_vecreturn:28:43 (Definition) +// CHECK-tokens: Punctuation: "," [28:55 - 28:56] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_vector_size" [28:57 - 28:71] EnumConstantDecl=AT_vector_size:28:57 (Definition) +// CHECK-tokens: Punctuation: "," [28:71 - 28:72] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_visibility" [29:7 - 29:20] EnumConstantDecl=AT_visibility:29:7 (Definition) +// CHECK-tokens: Punctuation: "," [29:20 - 29:21] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_warn_unused_result" [29:22 - 29:43] EnumConstantDecl=AT_warn_unused_result:29:22 (Definition) +// CHECK-tokens: Punctuation: "," [29:43 - 29:44] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_weak" [29:45 - 29:52] EnumConstantDecl=AT_weak:29:45 (Definition) +// CHECK-tokens: Punctuation: "," [29:52 - 29:53] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_weakref" [29:54 - 29:64] EnumConstantDecl=AT_weakref:29:54 (Definition) +// CHECK-tokens: Punctuation: "," [29:64 - 29:65] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_weak_import" [30:7 - 30:21] EnumConstantDecl=AT_weak_import:30:7 (Definition) +// CHECK-tokens: Punctuation: "," [30:21 - 30:22] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_reqd_wg_size" [30:23 - 30:38] EnumConstantDecl=AT_reqd_wg_size:30:23 (Definition) +// CHECK-tokens: Punctuation: "," [30:38 - 30:39] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_init_priority" [30:40 - 30:56] EnumConstantDecl=AT_init_priority:30:40 (Definition) +// CHECK-tokens: Punctuation: "," [30:56 - 30:57] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "AT_returns_twice" [31:7 - 31:23] EnumConstantDecl=AT_returns_twice:31:7 (Definition) +// CHECK-tokens: Punctuation: "," [31:23 - 31:24] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Identifier: "IgnoredAttribute" [31:25 - 31:41] EnumConstantDecl=IgnoredAttribute:31:25 (Definition) +// CHECK-tokens: Punctuation: "}" [32:5 - 32:6] EnumDecl=Kind:13:10 (Definition) +// CHECK-tokens: Punctuation: ";" [32:6 - 32:7] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Keyword: "static" [33:5 - 33:11] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Identifier: "Kind" [33:12 - 33:16] TypeRef=enum clang::AttributeList::Kind:13:10 +// CHECK-tokens: Identifier: "getKind" [33:17 - 33:24] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Punctuation: "(" [33:24 - 33:25] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Keyword: "const" [33:25 - 33:30] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Identifier: "IdentifierInfo" [33:31 - 33:45] TypeRef=class clang::IdentifierInfo:66:7 +// CHECK-tokens: Punctuation: "*" [33:46 - 33:47] ParmDecl=Name:33:48 (Definition) +// CHECK-tokens: Identifier: "Name" [33:48 - 33:52] ParmDecl=Name:33:48 (Definition) +// CHECK-tokens: Punctuation: ")" [33:52 - 33:53] CXXMethod=getKind:33:17 (static) +// CHECK-tokens: Punctuation: ";" [33:53 - 33:54] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Punctuation: "}" [34:3 - 34:4] ClassDecl=AttributeList:12:9 (Definition) +// CHECK-tokens: Punctuation: ";" [34:4 - 34:5] Namespace=clang:10:17 (Definition) +// CHECK-tokens: Punctuation: "}" [35:1 - 35:2] Namespace=clang:10:17 (Definition) +// CHECK-tokens: Identifier: "size_t" [36:1 - 36:7] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "magic_length" [36:8 - 36:20] FunctionDecl=magic_length:36:8 +// CHECK-tokens: Punctuation: "(" [36:20 - 36:21] FunctionDecl=magic_length:36:8 +// CHECK-tokens: Keyword: "const" [36:21 - 36:26] FunctionDecl=magic_length:36:8 +// CHECK-tokens: Keyword: "char" [36:27 - 36:31] ParmDecl=s:36:33 (Definition) +// CHECK-tokens: Punctuation: "*" [36:32 - 36:33] ParmDecl=s:36:33 (Definition) +// CHECK-tokens: Identifier: "s" [36:33 - 36:34] ParmDecl=s:36:33 (Definition) +// CHECK-tokens: Punctuation: ")" [36:34 - 36:35] FunctionDecl=magic_length:36:8 +// CHECK-tokens: Punctuation: ";" [36:35 - 36:36] +// CHECK-tokens: Keyword: "namespace" [37:1 - 37:10] +// CHECK-tokens: Identifier: "llvm" [37:11 - 37:15] Namespace=llvm:37:11 (Definition) +// CHECK-tokens: Punctuation: "{" [37:16 - 37:17] Namespace=llvm:37:11 (Definition) +// CHECK-tokens: Keyword: "class" [38:1 - 38:6] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Identifier: "StringRef" [38:7 - 38:16] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Punctuation: "{" [38:17 - 38:18] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "public" [39:1 - 39:7] CXXAccessSpecifier=:39:1 (Definition) +// CHECK-tokens: Punctuation: ":" [39:7 - 39:8] CXXAccessSpecifier=:39:1 (Definition) +// CHECK-tokens: Keyword: "typedef" [40:3 - 40:10] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "const" [40:11 - 40:16] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "char" [40:17 - 40:21] TypedefDecl=iterator:40:23 (Definition) +// CHECK-tokens: Punctuation: "*" [40:22 - 40:23] TypedefDecl=iterator:40:23 (Definition) +// CHECK-tokens: Identifier: "iterator" [40:23 - 40:31] TypedefDecl=iterator:40:23 (Definition) +// CHECK-tokens: Punctuation: ";" [40:31 - 40:32] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "static" [41:3 - 41:9] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "const" [41:10 - 41:15] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Identifier: "size_t" [41:16 - 41:22] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "npos" [41:23 - 41:27] VarDecl=npos:41:23 +// CHECK-tokens: Punctuation: "=" [41:28 - 41:29] VarDecl=npos:41:23 +// CHECK-tokens: Punctuation: "~" [41:30 - 41:31] UnaryOperator= +// CHECK-tokens: Identifier: "size_t" [41:31 - 41:37] TypeRef=size_t:2:25 +// CHECK-tokens: Punctuation: "(" [41:37 - 41:38] CXXFunctionalCastExpr= +// CHECK-tokens: Literal: "0" [41:38 - 41:39] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [41:39 - 41:40] CXXFunctionalCastExpr +// CHECK-tokens: Punctuation: ";" [41:40 - 41:41] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "private" [42:1 - 42:8] CXXAccessSpecifier=:42:1 (Definition) +// CHECK-tokens: Punctuation: ":" [42:8 - 42:9] CXXAccessSpecifier=:42:1 (Definition) +// CHECK-tokens: Keyword: "const" [43:3 - 43:8] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "char" [43:9 - 43:13] FieldDecl=Data:43:15 (Definition) +// CHECK-tokens: Punctuation: "*" [43:14 - 43:15] FieldDecl=Data:43:15 (Definition) +// CHECK-tokens: Identifier: "Data" [43:15 - 43:19] FieldDecl=Data:43:15 (Definition) +// CHECK-tokens: Punctuation: ";" [43:19 - 43:20] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Identifier: "size_t" [44:3 - 44:9] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "Length" [44:10 - 44:16] FieldDecl=Length:44:10 (Definition) +// CHECK-tokens: Punctuation: ";" [44:16 - 44:17] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Keyword: "static" [45:3 - 45:9] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Identifier: "size_t" [45:10 - 45:16] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "min" [45:17 - 45:20] CXXMethod=min:45:17 (Definition) (static) +// CHECK-tokens: Punctuation: "(" [45:20 - 45:21] CXXMethod=min:45:17 (Definition) (static) +// CHECK-tokens: Identifier: "size_t" [45:21 - 45:27] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "a" [45:28 - 45:29] ParmDecl=a:45:28 (Definition) +// CHECK-tokens: Punctuation: "," [45:29 - 45:30] CXXMethod=min:45:17 (Definition) (static) +// CHECK-tokens: Identifier: "size_t" [45:31 - 45:37] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "b" [45:38 - 45:39] ParmDecl=b:45:38 (Definition) +// CHECK-tokens: Punctuation: ")" [45:39 - 45:40] CXXMethod=min:45:17 (Definition) (static) +// CHECK-tokens: Punctuation: "{" [45:41 - 45:42] CompoundStmt= +// CHECK-tokens: Keyword: "return" [45:43 - 45:49] ReturnStmt= +// CHECK-tokens: Identifier: "a" [45:50 - 45:51] DeclRefExpr=a:45:28 +// CHECK-tokens: Punctuation: "<" [45:52 - 45:53] BinaryOperator= +// CHECK-tokens: Identifier: "b" [45:54 - 45:55] DeclRefExpr=b:45:38 +// CHECK-tokens: Punctuation: "?" [45:56 - 45:57] ConditionalOperator= +// CHECK-tokens: Identifier: "a" [45:58 - 45:59] DeclRefExpr=a:45:28 +// CHECK-tokens: Punctuation: ":" [45:60 - 45:61] ConditionalOperator +// CHECK-tokens: Identifier: "b" [45:62 - 45:63] DeclRefExpr=b:45:38 +// CHECK-tokens: Punctuation: ";" [45:63 - 45:64] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [45:65 - 45:66] CompoundStmt= +// CHECK-tokens: Keyword: "public" [46:1 - 46:7] CXXAccessSpecifier=:46:1 (Definition) +// CHECK-tokens: Punctuation: ":" [46:7 - 46:8] CXXAccessSpecifier=:46:1 (Definition) +// CHECK-tokens: Identifier: "StringRef" [47:3 - 47:12] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Punctuation: "(" [47:12 - 47:13] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Punctuation: ")" [47:13 - 47:14] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Punctuation: ":" [47:14 - 47:15] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Identifier: "Data" [47:16 - 47:20] MemberRef=Data:43:15 +// CHECK-tokens: Punctuation: "(" [47:20 - 47:21] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Literal: "0" [47:21 - 47:22] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [47:22 - 47:23] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Punctuation: "," [47:23 - 47:24] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Identifier: "Length" [47:25 - 47:31] MemberRef=Length:44:10 +// CHECK-tokens: Punctuation: "(" [47:31 - 47:32] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Literal: "0" [47:32 - 47:33] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [47:33 - 47:34] CXXConstructor=StringRef:47:3 (Definition) +// CHECK-tokens: Punctuation: "{" [47:35 - 47:36] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [47:36 - 47:37] CompoundStmt= +// CHECK-tokens: Identifier: "StringRef" [48:3 - 48:12] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Punctuation: "(" [48:12 - 48:13] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Keyword: "const" [48:13 - 48:18] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Keyword: "char" [48:19 - 48:23] ParmDecl=Str:48:25 (Definition) +// CHECK-tokens: Punctuation: "*" [48:24 - 48:25] ParmDecl=Str:48:25 (Definition) +// CHECK-tokens: Identifier: "Str" [48:25 - 48:28] ParmDecl=Str:48:25 (Definition) +// CHECK-tokens: Punctuation: ")" [48:28 - 48:29] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Punctuation: ":" [48:30 - 48:31] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Identifier: "Data" [48:32 - 48:36] MemberRef=Data:43:15 +// CHECK-tokens: Punctuation: "(" [48:36 - 48:37] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Identifier: "Str" [48:37 - 48:40] DeclRefExpr=Str:48:25 +// CHECK-tokens: Punctuation: ")" [48:40 - 48:41] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Punctuation: "," [48:41 - 48:42] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Identifier: "Length" [48:43 - 48:49] MemberRef=Length:44:10 +// CHECK-tokens: Punctuation: "(" [48:49 - 48:50] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Identifier: "magic_length" [48:50 - 48:62] DeclRefExpr=magic_length:36:8 +// CHECK-tokens: Punctuation: "(" [48:62 - 48:63] CallExpr=magic_length:36:8 +// CHECK-tokens: Identifier: "Str" [48:63 - 48:66] DeclRefExpr=Str:48:25 +// CHECK-tokens: Punctuation: ")" [48:66 - 48:67] CallExpr=magic_length:36:8 +// CHECK-tokens: Punctuation: ")" [48:67 - 48:68] CXXConstructor=StringRef:48:3 (Definition) +// CHECK-tokens: Punctuation: "{" [48:69 - 48:70] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [48:70 - 48:71] CompoundStmt= +// CHECK-tokens: Identifier: "StringRef" [49:3 - 49:12] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Punctuation: "(" [49:12 - 49:13] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Keyword: "const" [49:13 - 49:18] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Keyword: "char" [49:19 - 49:23] ParmDecl=data:49:25 (Definition) +// CHECK-tokens: Punctuation: "*" [49:24 - 49:25] ParmDecl=data:49:25 (Definition) +// CHECK-tokens: Identifier: "data" [49:25 - 49:29] ParmDecl=data:49:25 (Definition) +// CHECK-tokens: Punctuation: "," [49:29 - 49:30] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Identifier: "size_t" [49:31 - 49:37] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "length" [49:38 - 49:44] ParmDecl=length:49:38 (Definition) +// CHECK-tokens: Punctuation: ")" [49:44 - 49:45] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Punctuation: ":" [49:46 - 49:47] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Identifier: "Data" [49:48 - 49:52] MemberRef=Data:43:15 +// CHECK-tokens: Punctuation: "(" [49:52 - 49:53] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Identifier: "data" [49:53 - 49:57] DeclRefExpr=data:49:25 +// CHECK-tokens: Punctuation: ")" [49:57 - 49:58] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Punctuation: "," [49:58 - 49:59] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Identifier: "Length" [49:60 - 49:66] MemberRef=Length:44:10 +// CHECK-tokens: Punctuation: "(" [49:66 - 49:67] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Identifier: "length" [49:67 - 49:73] DeclRefExpr=length:49:38 +// CHECK-tokens: Punctuation: ")" [49:73 - 49:74] CXXConstructor=StringRef:49:3 (Definition) +// CHECK-tokens: Punctuation: "{" [49:75 - 49:76] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [49:76 - 49:77] CompoundStmt= +// CHECK-tokens: Identifier: "iterator" [50:3 - 50:11] TypeRef=iterator:40:23 +// CHECK-tokens: Identifier: "end" [50:12 - 50:15] CXXMethod=end:50:12 (Definition) +// CHECK-tokens: Punctuation: "(" [50:15 - 50:16] CXXMethod=end:50:12 (Definition) +// CHECK-tokens: Punctuation: ")" [50:16 - 50:17] CXXMethod=end:50:12 (Definition) +// CHECK-tokens: Keyword: "const" [50:18 - 50:23] CXXMethod=end:50:12 (Definition) +// CHECK-tokens: Punctuation: "{" [50:24 - 50:25] CompoundStmt= +// CHECK-tokens: Keyword: "return" [50:26 - 50:32] ReturnStmt= +// CHECK-tokens: Identifier: "Data" [50:33 - 50:37] MemberRefExpr=Data:43:15 +// CHECK-tokens: Punctuation: ";" [50:37 - 50:38] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [50:39 - 50:40] CompoundStmt= +// CHECK-tokens: Identifier: "size_t" [51:3 - 51:9] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "size" [51:10 - 51:14] CXXMethod=size:51:10 (Definition) +// CHECK-tokens: Punctuation: "(" [51:14 - 51:15] CXXMethod=size:51:10 (Definition) +// CHECK-tokens: Punctuation: ")" [51:15 - 51:16] CXXMethod=size:51:10 (Definition) +// CHECK-tokens: Keyword: "const" [51:17 - 51:22] CXXMethod=size:51:10 (Definition) +// CHECK-tokens: Punctuation: "{" [51:23 - 51:24] CompoundStmt= +// CHECK-tokens: Keyword: "return" [51:25 - 51:31] ReturnStmt= +// CHECK-tokens: Identifier: "Length" [51:32 - 51:38] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: ";" [51:38 - 51:39] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [51:40 - 51:41] CompoundStmt= +// CHECK-tokens: Keyword: "bool" [52:3 - 52:7] CXXMethod=startswith:52:8 (Definition) +// CHECK-tokens: Identifier: "startswith" [52:8 - 52:18] CXXMethod=startswith:52:8 (Definition) +// CHECK-tokens: Punctuation: "(" [52:18 - 52:19] CXXMethod=startswith:52:8 (Definition) +// CHECK-tokens: Identifier: "StringRef" [52:19 - 52:28] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "Prefix" [52:29 - 52:35] ParmDecl=Prefix:52:29 (Definition) +// CHECK-tokens: Punctuation: ")" [52:35 - 52:36] CXXMethod=startswith:52:8 (Definition) +// CHECK-tokens: Keyword: "const" [52:37 - 52:42] CXXMethod=startswith:52:8 (Definition) +// CHECK-tokens: Punctuation: "{" [52:43 - 52:44] CompoundStmt= +// CHECK-tokens: Keyword: "return" [53:5 - 53:11] ReturnStmt= +// CHECK-tokens: Identifier: "Length" [53:12 - 53:18] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: ">=" [53:19 - 53:21] BinaryOperator= +// CHECK-tokens: Identifier: "Prefix" [53:22 - 53:28] DeclRefExpr=Prefix:52:29 +// CHECK-tokens: Punctuation: "." [53:28 - 53:29] MemberRefExpr=Length:44:10 +// CHECK-tokens: Identifier: "Length" [53:29 - 53:35] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: "&&" [53:36 - 53:38] BinaryOperator= +// CHECK-tokens: Identifier: "memcmp" [54:11 - 54:17] DeclRefExpr=memcmp:7:7 +// CHECK-tokens: Punctuation: "(" [54:17 - 54:18] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "Data" [54:18 - 54:22] MemberRefExpr=Data:43:15 +// CHECK-tokens: Punctuation: "," [54:22 - 54:23] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "Prefix" [54:24 - 54:30] DeclRefExpr=Prefix:52:29 +// CHECK-tokens: Punctuation: "." [54:30 - 54:31] MemberRefExpr=Data:43:15 +// CHECK-tokens: Identifier: "Data" [54:31 - 54:35] MemberRefExpr=Data:43:15 +// CHECK-tokens: Punctuation: "," [54:35 - 54:36] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "Prefix" [54:37 - 54:43] DeclRefExpr=Prefix:52:29 +// CHECK-tokens: Punctuation: "." [54:43 - 54:44] MemberRefExpr=Length:44:10 +// CHECK-tokens: Identifier: "Length" [54:44 - 54:50] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: ")" [54:50 - 54:51] CallExpr=memcmp:7:7 +// CHECK-tokens: Punctuation: "==" [54:52 - 54:54] BinaryOperator= +// CHECK-tokens: Literal: "0" [54:55 - 54:56] IntegerLiteral= +// CHECK-tokens: Punctuation: ";" [54:56 - 54:57] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [55:3 - 55:4] CompoundStmt= +// CHECK-tokens: Keyword: "bool" [56:3 - 56:7] CXXMethod=endswith:56:8 (Definition) +// CHECK-tokens: Identifier: "endswith" [56:8 - 56:16] CXXMethod=endswith:56:8 (Definition) +// CHECK-tokens: Punctuation: "(" [56:16 - 56:17] CXXMethod=endswith:56:8 (Definition) +// CHECK-tokens: Identifier: "StringRef" [56:17 - 56:26] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "Suffix" [56:27 - 56:33] ParmDecl=Suffix:56:27 (Definition) +// CHECK-tokens: Punctuation: ")" [56:33 - 56:34] CXXMethod=endswith:56:8 (Definition) +// CHECK-tokens: Keyword: "const" [56:35 - 56:40] CXXMethod=endswith:56:8 (Definition) +// CHECK-tokens: Punctuation: "{" [56:41 - 56:42] CompoundStmt= +// CHECK-tokens: Keyword: "return" [57:5 - 57:11] ReturnStmt= +// CHECK-tokens: Identifier: "Length" [57:12 - 57:18] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: ">=" [57:19 - 57:21] BinaryOperator= +// CHECK-tokens: Identifier: "Suffix" [57:22 - 57:28] DeclRefExpr=Suffix:56:27 +// CHECK-tokens: Punctuation: "." [57:28 - 57:29] MemberRefExpr=Length:44:10 +// CHECK-tokens: Identifier: "Length" [57:29 - 57:35] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: "&&" [57:36 - 57:38] BinaryOperator= +// CHECK-tokens: Identifier: "memcmp" [58:7 - 58:13] DeclRefExpr=memcmp:7:7 +// CHECK-tokens: Punctuation: "(" [58:13 - 58:14] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "end" [58:14 - 58:17] MemberRefExpr=end:50:12 +// CHECK-tokens: Punctuation: "(" [58:17 - 58:18] CallExpr=end:50:12 +// CHECK-tokens: Punctuation: ")" [58:18 - 58:19] CallExpr=end:50:12 +// CHECK-tokens: Punctuation: "-" [58:20 - 58:21] BinaryOperator= +// CHECK-tokens: Identifier: "Suffix" [58:22 - 58:28] DeclRefExpr=Suffix:56:27 +// CHECK-tokens: Punctuation: "." [58:28 - 58:29] MemberRefExpr=Length:44:10 +// CHECK-tokens: Identifier: "Length" [58:29 - 58:35] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: "," [58:35 - 58:36] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "Suffix" [58:37 - 58:43] DeclRefExpr=Suffix:56:27 +// CHECK-tokens: Punctuation: "." [58:43 - 58:44] MemberRefExpr=Data:43:15 +// CHECK-tokens: Identifier: "Data" [58:44 - 58:48] MemberRefExpr=Data:43:15 +// CHECK-tokens: Punctuation: "," [58:48 - 58:49] CallExpr=memcmp:7:7 +// CHECK-tokens: Identifier: "Suffix" [58:50 - 58:56] DeclRefExpr=Suffix:56:27 +// CHECK-tokens: Punctuation: "." [58:56 - 58:57] MemberRefExpr=Length:44:10 +// CHECK-tokens: Identifier: "Length" [58:57 - 58:63] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: ")" [58:63 - 58:64] CallExpr=memcmp:7:7 +// CHECK-tokens: Punctuation: "==" [58:65 - 58:67] BinaryOperator= +// CHECK-tokens: Literal: "0" [58:68 - 58:69] IntegerLiteral= +// CHECK-tokens: Punctuation: ";" [58:69 - 58:70] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [59:3 - 59:4] CompoundStmt= +// CHECK-tokens: Identifier: "StringRef" [60:3 - 60:12] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "substr" [60:13 - 60:19] CXXMethod=substr:60:13 (Definition) +// CHECK-tokens: Punctuation: "(" [60:19 - 60:20] CXXMethod=substr:60:13 (Definition) +// CHECK-tokens: Identifier: "size_t" [60:20 - 60:26] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "Start" [60:27 - 60:32] ParmDecl=Start:60:27 (Definition) +// CHECK-tokens: Punctuation: "," [60:32 - 60:33] CXXMethod=substr:60:13 (Definition) +// CHECK-tokens: Identifier: "size_t" [60:34 - 60:40] TypeRef=size_t:2:25 +// CHECK-tokens: Identifier: "N" [60:41 - 60:42] ParmDecl=N:60:41 (Definition) +// CHECK-tokens: Punctuation: "=" [60:43 - 60:44] ParmDecl=N:60:41 (Definition) +// CHECK-tokens: Identifier: "npos" [60:45 - 60:49] DeclRefExpr=npos:41:23 +// CHECK-tokens: Punctuation: ")" [60:49 - 60:50] CXXMethod=substr:60:13 (Definition) +// CHECK-tokens: Keyword: "const" [60:51 - 60:56] CXXMethod=substr:60:13 (Definition) +// CHECK-tokens: Punctuation: "{" [60:57 - 60:58] CompoundStmt= +// CHECK-tokens: Keyword: "return" [61:5 - 61:11] ReturnStmt= +// CHECK-tokens: Identifier: "StringRef" [61:12 - 61:21] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Punctuation: "(" [61:21 - 61:22] CallExpr=StringRef:49:3 +// CHECK-tokens: Identifier: "Data" [61:22 - 61:26] MemberRefExpr=Data:43:15 +// CHECK-tokens: Punctuation: "+" [61:27 - 61:28] BinaryOperator= +// CHECK-tokens: Identifier: "Start" [61:29 - 61:34] DeclRefExpr=Start:60:27 +// CHECK-tokens: Punctuation: "," [61:34 - 61:35] CallExpr=StringRef:49:3 +// CHECK-tokens: Identifier: "min" [61:36 - 61:39] DeclRefExpr=min:45:17 +// CHECK-tokens: Punctuation: "(" [61:39 - 61:40] CallExpr=min:45:17 +// CHECK-tokens: Identifier: "N" [61:40 - 61:41] DeclRefExpr=N:60:41 +// CHECK-tokens: Punctuation: "," [61:41 - 61:42] CallExpr=min:45:17 +// CHECK-tokens: Identifier: "Length" [61:43 - 61:49] MemberRefExpr=Length:44:10 +// CHECK-tokens: Punctuation: "-" [61:50 - 61:51] BinaryOperator= +// CHECK-tokens: Identifier: "Start" [61:52 - 61:57] DeclRefExpr=Start:60:27 +// CHECK-tokens: Punctuation: ")" [61:57 - 61:58] CallExpr=min:45:17 +// CHECK-tokens: Punctuation: ")" [61:58 - 61:59] CallExpr=StringRef:49:3 +// CHECK-tokens: Punctuation: ";" [61:59 - 61:60] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [62:3 - 62:4] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [63:1 - 63:2] ClassDecl=StringRef:38:7 (Definition) +// CHECK-tokens: Punctuation: ";" [63:2 - 63:3] Namespace=llvm:37:11 (Definition) +// CHECK-tokens: Punctuation: "}" [64:1 - 64:2] Namespace=llvm:37:11 (Definition) +// CHECK-tokens: Keyword: "namespace" [65:1 - 65:10] +// CHECK-tokens: Identifier: "clang" [65:11 - 65:16] Namespace=clang:65:11 (Definition) +// CHECK-tokens: Punctuation: "{" [65:17 - 65:18] Namespace=clang:65:11 (Definition) +// CHECK-tokens: Keyword: "class" [66:1 - 66:6] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Identifier: "IdentifierInfo" [66:7 - 66:21] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Punctuation: "{" [66:22 - 66:23] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Keyword: "public" [67:1 - 67:7] CXXAccessSpecifier=:67:1 (Definition) +// CHECK-tokens: Punctuation: ":" [67:7 - 67:8] CXXAccessSpecifier=:67:1 (Definition) +// CHECK-tokens: Identifier: "IdentifierInfo" [67:8 - 67:22] CXXConstructor=IdentifierInfo:67:8 +// CHECK-tokens: Punctuation: "(" [67:22 - 67:23] CXXConstructor=IdentifierInfo:67:8 +// CHECK-tokens: Punctuation: ")" [67:23 - 67:24] CXXConstructor=IdentifierInfo:67:8 +// CHECK-tokens: Punctuation: ";" [67:24 - 67:25] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Keyword: "const" [68:3 - 68:8] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Keyword: "char" [68:9 - 68:13] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Punctuation: "*" [68:14 - 68:15] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Identifier: "getNameStart" [68:15 - 68:27] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Punctuation: "(" [68:27 - 68:28] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Punctuation: ")" [68:28 - 68:29] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Keyword: "const" [68:30 - 68:35] CXXMethod=getNameStart:68:15 (Definition) +// CHECK-tokens: Punctuation: "{" [68:36 - 68:37] CompoundStmt= +// CHECK-tokens: Keyword: "typedef" [69:5 - 69:12] DeclStmt= +// CHECK-tokens: Identifier: "std" [69:13 - 69:16] NamespaceRef=std:3:11 +// CHECK-tokens: Punctuation: "::" [69:16 - 69:18] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Identifier: "pair" [69:18 - 69:22] TemplateRef=pair:4:44 +// CHECK-tokens: Punctuation: "<" [69:23 - 69:24] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Identifier: "IdentifierInfo" [69:25 - 69:39] TypeRef=class clang::IdentifierInfo:66:7 +// CHECK-tokens: Punctuation: "," [69:39 - 69:40] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Keyword: "const" [69:41 - 69:46] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Keyword: "char" [69:47 - 69:51] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Punctuation: "*" [69:52 - 69:53] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Punctuation: ">" [69:53 - 69:54] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Identifier: "actualtype" [69:54 - 69:64] TypedefDecl=actualtype:69:54 (Definition) +// CHECK-tokens: Punctuation: ";" [69:64 - 69:65] DeclStmt= +// CHECK-tokens: Keyword: "return" [70:5 - 70:11] ReturnStmt= +// CHECK-tokens: Punctuation: "(" [70:12 - 70:13] ParenExpr= +// CHECK-tokens: Punctuation: "(" [70:13 - 70:14] CStyleCastExpr= +// CHECK-tokens: Keyword: "const" [70:14 - 70:19] CStyleCastExpr= +// CHECK-tokens: Identifier: "actualtype" [70:20 - 70:30] TypeRef=actualtype:69:54 +// CHECK-tokens: Punctuation: "*" [70:31 - 70:32] CStyleCastExpr= +// CHECK-tokens: Punctuation: ")" [70:32 - 70:33] CStyleCastExpr= +// CHECK-tokens: Keyword: "this" [70:34 - 70:38] CXXThisExpr= +// CHECK-tokens: Punctuation: ")" [70:38 - 70:39] ParenExpr= +// CHECK-tokens: Punctuation: "->" [70:39 - 70:41] MemberRefExpr=second:4:55 +// CHECK-tokens: Identifier: "second" [70:41 - 70:47] MemberRefExpr=second:4:55 +// CHECK-tokens: Punctuation: ";" [70:47 - 70:48] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [71:3 - 71:4] CompoundStmt= +// CHECK-tokens: Keyword: "unsigned" [72:3 - 72:11] CXXMethod=getLength:72:12 (Definition) +// CHECK-tokens: Identifier: "getLength" [72:12 - 72:21] CXXMethod=getLength:72:12 (Definition) +// CHECK-tokens: Punctuation: "(" [72:21 - 72:22] CXXMethod=getLength:72:12 (Definition) +// CHECK-tokens: Punctuation: ")" [72:22 - 72:23] CXXMethod=getLength:72:12 (Definition) +// CHECK-tokens: Keyword: "const" [72:24 - 72:29] CXXMethod=getLength:72:12 (Definition) +// CHECK-tokens: Punctuation: "{" [72:30 - 72:31] CompoundStmt= +// CHECK-tokens: Keyword: "typedef" [73:5 - 73:12] DeclStmt= +// CHECK-tokens: Identifier: "std" [73:13 - 73:16] NamespaceRef=std:3:11 +// CHECK-tokens: Punctuation: "::" [73:16 - 73:18] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Identifier: "pair" [73:18 - 73:22] TemplateRef=pair:4:44 +// CHECK-tokens: Punctuation: "<" [73:23 - 73:24] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Identifier: "IdentifierInfo" [73:25 - 73:39] TypeRef=class clang::IdentifierInfo:66:7 +// CHECK-tokens: Punctuation: "," [73:39 - 73:40] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Keyword: "const" [73:41 - 73:46] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Keyword: "char" [73:47 - 73:51] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Punctuation: "*" [73:52 - 73:53] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Punctuation: ">" [73:53 - 73:54] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Identifier: "actualtype" [73:54 - 73:64] TypedefDecl=actualtype:73:54 (Definition) +// CHECK-tokens: Punctuation: ";" [73:64 - 73:65] DeclStmt= +// CHECK-tokens: Keyword: "const" [74:5 - 74:10] DeclStmt= +// CHECK-tokens: Keyword: "char" [74:11 - 74:15] VarDecl=p:74:17 (Definition) +// CHECK-tokens: Punctuation: "*" [74:16 - 74:17] VarDecl=p:74:17 (Definition) +// CHECK-tokens: Identifier: "p" [74:17 - 74:18] VarDecl=p:74:17 (Definition) +// CHECK-tokens: Punctuation: "=" [74:19 - 74:20] VarDecl=p:74:17 (Definition) +// CHECK-tokens: Punctuation: "(" [74:21 - 74:22] ParenExpr= +// CHECK-tokens: Punctuation: "(" [74:22 - 74:23] CStyleCastExpr= +// CHECK-tokens: Keyword: "const" [74:23 - 74:28] CStyleCastExpr= +// CHECK-tokens: Identifier: "actualtype" [74:29 - 74:39] TypeRef=actualtype:73:54 +// CHECK-tokens: Punctuation: "*" [74:40 - 74:41] CStyleCastExpr= +// CHECK-tokens: Punctuation: ")" [74:41 - 74:42] CStyleCastExpr= +// CHECK-tokens: Keyword: "this" [74:43 - 74:47] CXXThisExpr= +// CHECK-tokens: Punctuation: ")" [74:47 - 74:48] ParenExpr= +// CHECK-tokens: Punctuation: "->" [74:48 - 74:50] MemberRefExpr=second:4:55 +// CHECK-tokens: Identifier: "second" [74:50 - 74:56] MemberRefExpr=second:4:55 +// CHECK-tokens: Punctuation: "-" [74:57 - 74:58] BinaryOperator= +// CHECK-tokens: Literal: "2" [74:59 - 74:60] IntegerLiteral= +// CHECK-tokens: Punctuation: ";" [74:60 - 74:61] DeclStmt= +// CHECK-tokens: Keyword: "return" [75:5 - 75:11] ReturnStmt= +// CHECK-tokens: Punctuation: "(" [75:12 - 75:13] ParenExpr= +// CHECK-tokens: Punctuation: "(" [75:13 - 75:14] ParenExpr= +// CHECK-tokens: Punctuation: "(" [75:14 - 75:15] CStyleCastExpr= +// CHECK-tokens: Keyword: "unsigned" [75:15 - 75:23] CStyleCastExpr= +// CHECK-tokens: Punctuation: ")" [75:23 - 75:24] CStyleCastExpr= +// CHECK-tokens: Identifier: "p" [75:25 - 75:26] DeclRefExpr=p:74:17 +// CHECK-tokens: Punctuation: "[" [75:26 - 75:27] ArraySubscriptExpr= +// CHECK-tokens: Literal: "0" [75:27 - 75:28] IntegerLiteral= +// CHECK-tokens: Punctuation: "]" [75:28 - 75:29] ArraySubscriptExpr= +// CHECK-tokens: Punctuation: ")" [75:29 - 75:30] ParenExpr= +// CHECK-tokens: Punctuation: "|" [75:31 - 75:32] BinaryOperator= +// CHECK-tokens: Punctuation: "(" [75:33 - 75:34] ParenExpr= +// CHECK-tokens: Punctuation: "(" [75:34 - 75:35] ParenExpr= +// CHECK-tokens: Punctuation: "(" [75:35 - 75:36] CStyleCastExpr= +// CHECK-tokens: Keyword: "unsigned" [75:36 - 75:44] CStyleCastExpr= +// CHECK-tokens: Punctuation: ")" [75:44 - 75:45] CStyleCastExpr= +// CHECK-tokens: Identifier: "p" [75:46 - 75:47] DeclRefExpr=p:74:17 +// CHECK-tokens: Punctuation: "[" [75:47 - 75:48] ArraySubscriptExpr= +// CHECK-tokens: Literal: "1" [75:48 - 75:49] IntegerLiteral= +// CHECK-tokens: Punctuation: "]" [75:49 - 75:50] ArraySubscriptExpr= +// CHECK-tokens: Punctuation: ")" [75:50 - 75:51] ParenExpr= +// CHECK-tokens: Punctuation: "<<" [75:52 - 75:54] BinaryOperator= +// CHECK-tokens: Literal: "8" [75:55 - 75:56] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [75:56 - 75:57] ParenExpr= +// CHECK-tokens: Punctuation: ")" [75:57 - 75:58] ParenExpr= +// CHECK-tokens: Punctuation: "-" [75:59 - 75:60] BinaryOperator= +// CHECK-tokens: Literal: "1" [75:61 - 75:62] IntegerLiteral= +// CHECK-tokens: Punctuation: ";" [75:62 - 75:63] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [76:3 - 76:4] CompoundStmt= +// CHECK-tokens: Identifier: "llvm" [77:3 - 77:7] NamespaceRef=llvm:37:11 +// CHECK-tokens: Punctuation: "::" [77:7 - 77:9] CXXMethod=getName:77:19 (Definition) +// CHECK-tokens: Identifier: "StringRef" [77:9 - 77:18] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "getName" [77:19 - 77:26] CXXMethod=getName:77:19 (Definition) +// CHECK-tokens: Punctuation: "(" [77:26 - 77:27] CXXMethod=getName:77:19 (Definition) +// CHECK-tokens: Punctuation: ")" [77:27 - 77:28] CXXMethod=getName:77:19 (Definition) +// CHECK-tokens: Keyword: "const" [77:29 - 77:34] CXXMethod=getName:77:19 (Definition) +// CHECK-tokens: Punctuation: "{" [77:35 - 77:36] CompoundStmt= +// CHECK-tokens: Keyword: "return" [78:5 - 78:11] ReturnStmt= +// CHECK-tokens: Identifier: "llvm" [78:12 - 78:16] NamespaceRef=llvm:37:11 +// CHECK-tokens: Punctuation: "::" [78:16 - 78:18] CallExpr=StringRef:49:3 +// CHECK-tokens: Identifier: "StringRef" [78:18 - 78:27] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Punctuation: "(" [78:27 - 78:28] CallExpr=StringRef:49:3 +// CHECK-tokens: Identifier: "getNameStart" [78:28 - 78:40] MemberRefExpr=getNameStart:68:15 +// CHECK-tokens: Punctuation: "(" [78:40 - 78:41] CallExpr=getNameStart:68:15 +// CHECK-tokens: Punctuation: ")" [78:41 - 78:42] CallExpr=getNameStart:68:15 +// CHECK-tokens: Punctuation: "," [78:42 - 78:43] CallExpr=StringRef:49:3 +// CHECK-tokens: Identifier: "getLength" [78:44 - 78:53] MemberRefExpr=getLength:72:12 +// CHECK-tokens: Punctuation: "(" [78:53 - 78:54] CallExpr=getLength:72:12 +// CHECK-tokens: Punctuation: ")" [78:54 - 78:55] CallExpr=getLength:72:12 +// CHECK-tokens: Punctuation: ")" [78:55 - 78:56] CallExpr=StringRef:49:3 +// CHECK-tokens: Punctuation: ";" [78:56 - 78:57] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [79:3 - 79:4] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [80:1 - 80:2] ClassDecl=IdentifierInfo:66:7 (Definition) +// CHECK-tokens: Punctuation: ";" [80:2 - 80:3] Namespace=clang:65:11 (Definition) +// CHECK-tokens: Punctuation: "}" [81:1 - 81:2] Namespace=clang:65:11 (Definition) +// CHECK-tokens: Keyword: "namespace" [82:1 - 82:10] +// CHECK-tokens: Identifier: "llvm" [82:11 - 82:15] Namespace=llvm:82:11 (Definition) +// CHECK-tokens: Punctuation: "{" [82:16 - 82:17] Namespace=llvm:82:11 (Definition) +// CHECK-tokens: Keyword: "template" [83:1 - 83:9] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Punctuation: "<" [83:10 - 83:11] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "typename" [83:12 - 83:20] TemplateTypeParameter=T:83:21 (Definition) +// CHECK-tokens: Identifier: "T" [83:21 - 83:22] TemplateTypeParameter=T:83:21 (Definition) +// CHECK-tokens: Punctuation: "," [83:22 - 83:23] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "typename" [83:24 - 83:32] TemplateTypeParameter=R:83:33 (Definition) +// CHECK-tokens: Identifier: "R" [83:33 - 83:34] TemplateTypeParameter=R:83:33 (Definition) +// CHECK-tokens: Punctuation: "=" [83:35 - 83:36] TemplateTypeParameter=R:83:33 (Definition) +// CHECK-tokens: Identifier: "T" [83:37 - 83:38] TypeRef=T:83:21 +// CHECK-tokens: Punctuation: ">" [83:39 - 83:40] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "class" [83:41 - 83:46] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Identifier: "StringSwitch" [83:47 - 83:59] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Punctuation: "{" [83:60 - 83:61] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Identifier: "StringRef" [84:3 - 84:12] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "Str" [84:13 - 84:16] FieldDecl=Str:84:13 (Definition) +// CHECK-tokens: Punctuation: ";" [84:16 - 84:17] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "const" [85:3 - 85:8] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Identifier: "T" [85:9 - 85:10] TypeRef=T:83:21 +// CHECK-tokens: Punctuation: "*" [85:11 - 85:12] FieldDecl=Result:85:12 (Definition) +// CHECK-tokens: Identifier: "Result" [85:12 - 85:18] FieldDecl=Result:85:12 (Definition) +// CHECK-tokens: Punctuation: ";" [85:18 - 85:19] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Keyword: "public" [86:1 - 86:7] CXXAccessSpecifier=:86:1 (Definition) +// CHECK-tokens: Punctuation: ":" [86:7 - 86:8] CXXAccessSpecifier=:86:1 (Definition) +// CHECK-tokens: Keyword: "explicit" [87:3 - 87:11] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Identifier: "StringSwitch" [87:12 - 87:24] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Punctuation: "(" [87:24 - 87:25] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Identifier: "StringRef" [87:25 - 87:34] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "Str" [87:35 - 87:38] ParmDecl=Str:87:35 (Definition) +// CHECK-tokens: Punctuation: ")" [87:38 - 87:39] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Punctuation: ":" [87:40 - 87:41] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Identifier: "Str" [87:42 - 87:45] MemberRef=Str:84:13 +// CHECK-tokens: Punctuation: "(" [87:45 - 87:46] UnexposedExpr= +// CHECK-tokens: Identifier: "Str" [87:46 - 87:49] DeclRefExpr=Str:87:35 +// CHECK-tokens: Punctuation: ")" [87:49 - 87:50] UnexposedExpr= +// CHECK-tokens: Punctuation: "," [87:50 - 87:51] CXXConstructor=StringSwitch<T, R>:87:12 (Definition) +// CHECK-tokens: Identifier: "Result" [87:52 - 87:58] MemberRef=Result:85:12 +// CHECK-tokens: Punctuation: "(" [87:58 - 87:59] UnexposedExpr= +// CHECK-tokens: Literal: "0" [87:59 - 87:60] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [87:60 - 87:61] UnexposedExpr= +// CHECK-tokens: Punctuation: "{" [87:62 - 87:63] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [87:63 - 87:64] CompoundStmt= +// CHECK-tokens: Keyword: "template" [88:3 - 88:11] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Punctuation: "<" [88:12 - 88:13] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "unsigned" [88:14 - 88:22] NonTypeTemplateParameter=N:88:23 (Definition) +// CHECK-tokens: Identifier: "N" [88:23 - 88:24] NonTypeTemplateParameter=N:88:23 (Definition) +// CHECK-tokens: Punctuation: ">" [88:25 - 88:26] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Identifier: "StringSwitch" [88:27 - 88:39] TypeRef=StringSwitch<T, R>:83:47 +// CHECK-tokens: Punctuation: "&" [88:40 - 88:41] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Identifier: "Case" [88:42 - 88:46] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Punctuation: "(" [88:46 - 88:47] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "const" [88:47 - 88:52] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "char" [88:53 - 88:57] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Punctuation: "(" [88:58 - 88:59] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Punctuation: "&" [88:59 - 88:60] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Identifier: "S" [88:60 - 88:61] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Punctuation: ")" [88:61 - 88:62] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Punctuation: "[" [88:62 - 88:63] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Identifier: "N" [88:63 - 88:64] DeclRefExpr=N:88:23 +// CHECK-tokens: Punctuation: "]" [88:64 - 88:65] ParmDecl=S:88:60 (Definition) +// CHECK-tokens: Punctuation: "," [88:65 - 88:66] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Keyword: "const" [89:47 - 89:52] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Identifier: "T" [89:53 - 89:54] TypeRef=T:83:21 +// CHECK-tokens: Punctuation: "&" [89:55 - 89:56] ParmDecl=Value:89:57 (Definition) +// CHECK-tokens: Identifier: "Value" [89:57 - 89:62] ParmDecl=Value:89:57 (Definition) +// CHECK-tokens: Punctuation: ")" [89:62 - 89:63] FunctionTemplate=Case:88:42 (Definition) +// CHECK-tokens: Punctuation: "{" [89:64 - 89:65] CompoundStmt= +// CHECK-tokens: Keyword: "return" [90:5 - 90:11] ReturnStmt= +// CHECK-tokens: Punctuation: "*" [90:12 - 90:13] UnaryOperator= +// CHECK-tokens: Keyword: "this" [90:13 - 90:17] CXXThisExpr= +// CHECK-tokens: Punctuation: ";" [90:17 - 90:18] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [91:3 - 91:4] CompoundStmt= +// CHECK-tokens: Identifier: "R" [92:3 - 92:4] TypeRef=R:83:33 +// CHECK-tokens: Identifier: "Default" [92:5 - 92:12] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Punctuation: "(" [92:12 - 92:13] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Keyword: "const" [92:13 - 92:18] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Identifier: "T" [92:19 - 92:20] TypeRef=T:83:21 +// CHECK-tokens: Punctuation: "&" [92:21 - 92:22] ParmDecl=Value:92:23 (Definition) +// CHECK-tokens: Identifier: "Value" [92:23 - 92:28] ParmDecl=Value:92:23 (Definition) +// CHECK-tokens: Punctuation: ")" [92:28 - 92:29] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Keyword: "const" [92:30 - 92:35] CXXMethod=Default:92:5 (Definition) +// CHECK-tokens: Punctuation: "{" [92:36 - 92:37] CompoundStmt= +// CHECK-tokens: Keyword: "return" [93:5 - 93:11] ReturnStmt= +// CHECK-tokens: Identifier: "Value" [93:12 - 93:17] DeclRefExpr=Value:92:23 +// CHECK-tokens: Punctuation: ";" [93:17 - 93:18] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [94:3 - 94:4] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [95:1 - 95:2] ClassTemplate=StringSwitch:83:47 (Definition) +// CHECK-tokens: Punctuation: ";" [95:2 - 95:3] Namespace=llvm:82:11 (Definition) +// CHECK-tokens: Punctuation: "}" [96:1 - 96:2] Namespace=llvm:82:11 (Definition) +// CHECK-tokens: Keyword: "using" [98:1 - 98:6] UsingDirective=:98:17 +// CHECK-tokens: Keyword: "namespace" [98:7 - 98:16] UsingDirective=:98:17 +// CHECK-tokens: Identifier: "clang" [98:17 - 98:22] NamespaceRef=clang:10:17 +// CHECK-tokens: Punctuation: ";" [98:22 - 98:23] +// CHECK-tokens: Identifier: "AttributeList" [100:1 - 100:14] TypeRef=class clang::AttributeList:12:9 +// CHECK-tokens: Punctuation: "::" [100:14 - 100:16] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Identifier: "Kind" [100:16 - 100:20] TypeRef=enum clang::AttributeList::Kind:13:10 +// CHECK-tokens: Identifier: "AttributeList" [100:21 - 100:34] TypeRef=class clang::AttributeList:12:9 +// CHECK-tokens: Punctuation: "::" [100:34 - 100:36] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Identifier: "getKind" [100:36 - 100:43] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Punctuation: "(" [100:43 - 100:44] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Keyword: "const" [100:44 - 100:49] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Identifier: "IdentifierInfo" [100:50 - 100:64] TypeRef=class clang::IdentifierInfo:66:7 +// CHECK-tokens: Punctuation: "*" [100:65 - 100:66] ParmDecl=Name:100:67 (Definition) +// CHECK-tokens: Identifier: "Name" [100:67 - 100:71] ParmDecl=Name:100:67 (Definition) +// CHECK-tokens: Punctuation: ")" [100:71 - 100:72] CXXMethod=getKind:100:36 (Definition) (static) +// CHECK-tokens: Punctuation: "{" [100:73 - 100:74] CompoundStmt= +// CHECK-tokens: Identifier: "llvm" [101:3 - 101:7] NamespaceRef=llvm:82:11 +// CHECK-tokens: Punctuation: "::" [101:7 - 101:9] VarDecl=AttrName:101:19 (Definition) +// CHECK-tokens: Identifier: "StringRef" [101:9 - 101:18] TypeRef=class llvm::StringRef:38:7 +// CHECK-tokens: Identifier: "AttrName" [101:19 - 101:27] VarDecl=AttrName:101:19 (Definition) +// CHECK-tokens: Punctuation: "=" [101:28 - 101:29] VarDecl=AttrName:101:19 (Definition) +// CHECK-tokens: Identifier: "Name" [101:30 - 101:34] DeclRefExpr=Name:100:67 +// CHECK-tokens: Punctuation: "->" [101:34 - 101:36] MemberRefExpr=getName:77:19 +// CHECK-tokens: Identifier: "getName" [101:36 - 101:43] MemberRefExpr=getName:77:19 +// CHECK-tokens: Punctuation: "(" [101:43 - 101:44] CallExpr=getName:77:19 +// CHECK-tokens: Punctuation: ")" [101:44 - 101:45] CallExpr=getName:77:19 +// CHECK-tokens: Punctuation: ";" [101:45 - 101:46] DeclStmt= +// CHECK-tokens: Keyword: "if" [102:3 - 102:5] IfStmt= +// CHECK-tokens: Punctuation: "(" [102:6 - 102:7] IfStmt= +// CHECK-tokens: Identifier: "AttrName" [102:7 - 102:15] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: "." [102:15 - 102:16] MemberRefExpr=startswith:52:8 +// CHECK-tokens: Identifier: "startswith" [102:16 - 102:26] MemberRefExpr=startswith:52:8 +// CHECK-tokens: Punctuation: "(" [102:26 - 102:27] CallExpr=startswith:52:8 +// CHECK-tokens: Literal: ""__"" [102:27 - 102:31] StringLiteral= +// CHECK-tokens: Punctuation: ")" [102:31 - 102:32] CallExpr=startswith:52:8 +// CHECK-tokens: Punctuation: "&&" [102:33 - 102:35] BinaryOperator= +// CHECK-tokens: Identifier: "AttrName" [102:36 - 102:44] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: "." [102:44 - 102:45] MemberRefExpr=endswith:56:8 +// CHECK-tokens: Identifier: "endswith" [102:45 - 102:53] MemberRefExpr=endswith:56:8 +// CHECK-tokens: Punctuation: "(" [102:53 - 102:54] CallExpr=endswith:56:8 +// CHECK-tokens: Literal: ""__"" [102:54 - 102:58] StringLiteral= +// CHECK-tokens: Punctuation: ")" [102:58 - 102:59] CallExpr=endswith:56:8 +// CHECK-tokens: Punctuation: ")" [102:59 - 102:60] IfStmt= +// CHECK-tokens: Identifier: "AttrName" [103:5 - 103:13] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: "=" [103:14 - 103:15] DeclRefExpr=operator=:38:7 +// CHECK-tokens: Identifier: "AttrName" [103:16 - 103:24] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: "." [103:24 - 103:25] MemberRefExpr=substr:60:13 +// CHECK-tokens: Identifier: "substr" [103:25 - 103:31] MemberRefExpr=substr:60:13 +// CHECK-tokens: Punctuation: "(" [103:31 - 103:32] CallExpr=substr:60:13 +// CHECK-tokens: Literal: "2" [103:32 - 103:33] IntegerLiteral= +// CHECK-tokens: Punctuation: "," [103:33 - 103:34] CallExpr=substr:60:13 +// CHECK-tokens: Identifier: "AttrName" [103:35 - 103:43] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: "." [103:43 - 103:44] MemberRefExpr=size:51:10 +// CHECK-tokens: Identifier: "size" [103:44 - 103:48] MemberRefExpr=size:51:10 +// CHECK-tokens: Punctuation: "(" [103:48 - 103:49] CallExpr=size:51:10 +// CHECK-tokens: Punctuation: ")" [103:49 - 103:50] CallExpr=size:51:10 +// CHECK-tokens: Punctuation: "-" [103:51 - 103:52] BinaryOperator= +// CHECK-tokens: Literal: "4" [103:53 - 103:54] IntegerLiteral= +// CHECK-tokens: Punctuation: ")" [103:54 - 103:55] CallExpr=substr:60:13 +// CHECK-tokens: Punctuation: ";" [103:55 - 103:56] CompoundStmt= +// CHECK-tokens: Keyword: "return" [105:3 - 105:9] ReturnStmt= +// FIXME: Missing "llvm" namespace reference below +// CHECK-tokens: Identifier: "llvm" [105:10 - 105:14] NamespaceRef=llvm:82:11 +// CHECK-tokens: Punctuation: "::" [105:14 - 105:16] CXXFunctionalCastExpr= +// CHECK-tokens: Identifier: "StringSwitch" [105:16 - 105:28] TemplateRef=StringSwitch:83:47 +// CHECK-tokens: Punctuation: "<" [105:29 - 105:30] CXXFunctionalCastExpr= +// CHECK-tokens: Identifier: "AttributeList" [105:31 - 105:44] TypeRef=class clang::AttributeList:12:9 +// CHECK-tokens: Punctuation: "::" [105:44 - 105:46] CXXFunctionalCastExpr= +// CHECK-tokens: Identifier: "Kind" [105:46 - 105:50] TypeRef=enum clang::AttributeList::Kind:13:10 +// CHECK-tokens: Punctuation: ">" [105:51 - 105:52] CallExpr=StringSwitch:87:12 +// CHECK-tokens: Punctuation: "(" [105:53 - 105:54] CallExpr=StringSwitch:87:12 +// CHECK-tokens: Identifier: "AttrName" [105:54 - 105:62] DeclRefExpr=AttrName:101:19 +// CHECK-tokens: Punctuation: ")" [105:62 - 105:63] CXXFunctionalCastExpr= +// CHECK-tokens: Punctuation: "." [106:5 - 106:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [106:6 - 106:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [106:10 - 106:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""weak"" [106:11 - 106:17] StringLiteral= +// CHECK-tokens: Punctuation: "," [106:17 - 106:18] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_weak" [106:19 - 106:26] DeclRefExpr=AT_weak:29:45 +// CHECK-tokens: Punctuation: ")" [106:26 - 106:27] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [107:5 - 107:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [107:6 - 107:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [107:10 - 107:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""weakref"" [107:11 - 107:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [107:20 - 107:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_weakref" [107:22 - 107:32] DeclRefExpr=AT_weakref:29:54 +// CHECK-tokens: Punctuation: ")" [107:32 - 107:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [108:5 - 108:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [108:6 - 108:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [108:10 - 108:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""pure"" [108:11 - 108:17] StringLiteral= +// CHECK-tokens: Punctuation: "," [108:17 - 108:18] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_pure" [108:19 - 108:26] DeclRefExpr=AT_pure:26:49 +// CHECK-tokens: Punctuation: ")" [108:26 - 108:27] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [109:5 - 109:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [109:6 - 109:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [109:10 - 109:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""mode"" [109:11 - 109:17] StringLiteral= +// CHECK-tokens: Punctuation: "," [109:17 - 109:18] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_mode" [109:19 - 109:26] DeclRefExpr=AT_mode:20:44 +// CHECK-tokens: Punctuation: ")" [109:26 - 109:27] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [110:5 - 110:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [110:6 - 110:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [110:10 - 110:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""used"" [110:11 - 110:17] StringLiteral= +// CHECK-tokens: Punctuation: "," [110:17 - 110:18] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_used" [110:19 - 110:26] DeclRefExpr=AT_used:28:34 +// CHECK-tokens: Punctuation: ")" [110:26 - 110:27] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [111:5 - 111:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [111:6 - 111:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [111:10 - 111:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""alias"" [111:11 - 111:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [111:18 - 111:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_alias" [111:20 - 111:28] DeclRefExpr=AT_alias:15:25 +// CHECK-tokens: Punctuation: ")" [111:28 - 111:29] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [112:5 - 112:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [112:6 - 112:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [112:10 - 112:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""align"" [112:11 - 112:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [112:18 - 112:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_aligned" [112:20 - 112:30] DeclRefExpr=AT_aligned:15:35 +// CHECK-tokens: Punctuation: ")" [112:30 - 112:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [113:5 - 113:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [113:6 - 113:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [113:10 - 113:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""final"" [113:11 - 113:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [113:18 - 113:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_final" [113:20 - 113:28] DeclRefExpr=AT_final:19:40 +// CHECK-tokens: Punctuation: ")" [113:28 - 113:29] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [114:5 - 114:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [114:6 - 114:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [114:10 - 114:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""cdecl"" [114:11 - 114:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [114:18 - 114:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_cdecl" [114:20 - 114:28] DeclRefExpr=AT_cdecl:17:30 +// CHECK-tokens: Punctuation: ")" [114:28 - 114:29] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [115:5 - 115:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [115:6 - 115:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [115:10 - 115:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""const"" [115:11 - 115:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [115:18 - 115:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_const" [115:20 - 115:28] DeclRefExpr=AT_const:17:52 +// CHECK-tokens: Punctuation: ")" [115:28 - 115:29] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [116:5 - 116:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [116:6 - 116:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [116:10 - 116:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__const"" [116:11 - 116:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [116:20 - 116:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_const" [116:22 - 116:30] DeclRefExpr=AT_const:17:52 +// CHECK-tokens: Punctuation: ")" [116:30 - 116:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [117:5 - 117:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [117:6 - 117:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [117:10 - 117:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""blocks"" [117:11 - 117:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [117:19 - 117:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_blocks" [117:21 - 117:30] DeclRefExpr=AT_blocks:16:57 +// CHECK-tokens: Punctuation: ")" [117:30 - 117:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [118:5 - 118:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [118:6 - 118:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [118:10 - 118:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""format"" [118:11 - 118:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [118:19 - 118:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_format" [118:21 - 118:30] DeclRefExpr=AT_format:19:50 +// CHECK-tokens: Punctuation: ")" [118:30 - 118:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [119:5 - 119:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [119:6 - 119:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [119:10 - 119:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""hiding"" [119:11 - 119:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [119:19 - 119:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_hiding" [119:21 - 119:30] DeclRefExpr=AT_hiding:20:22 +// CHECK-tokens: Punctuation: ")" [119:30 - 119:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [120:5 - 120:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [120:6 - 120:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [120:10 - 120:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""malloc"" [120:11 - 120:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [120:19 - 120:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_malloc" [120:21 - 120:30] DeclRefExpr=AT_malloc:20:33 +// CHECK-tokens: Punctuation: ")" [120:30 - 120:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [121:5 - 121:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [121:6 - 121:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [121:10 - 121:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""packed"" [121:11 - 121:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [121:19 - 121:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_packed" [121:21 - 121:30] DeclRefExpr=AT_packed:26:27 +// CHECK-tokens: Punctuation: ")" [121:30 - 121:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [122:5 - 122:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [122:6 - 122:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [122:10 - 122:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""unused"" [122:11 - 122:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [122:19 - 122:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_unused" [122:21 - 122:30] DeclRefExpr=AT_unused:28:23 +// CHECK-tokens: Punctuation: ")" [122:30 - 122:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [123:5 - 123:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [123:6 - 123:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [123:10 - 123:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""aligned"" [123:11 - 123:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [123:20 - 123:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_aligned" [123:22 - 123:32] DeclRefExpr=AT_aligned:15:35 +// CHECK-tokens: Punctuation: ")" [123:32 - 123:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [124:5 - 124:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [124:6 - 124:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [124:10 - 124:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""cleanup"" [124:11 - 124:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [124:20 - 124:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_cleanup" [124:22 - 124:32] DeclRefExpr=AT_cleanup:17:40 +// CHECK-tokens: Punctuation: ")" [124:32 - 124:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [125:5 - 125:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [125:6 - 125:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [125:10 - 125:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""naked"" [125:11 - 125:18] StringLiteral= +// CHECK-tokens: Punctuation: "," [125:18 - 125:19] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_naked" [125:20 - 125:28] DeclRefExpr=AT_naked:20:53 +// CHECK-tokens: Punctuation: ")" [125:28 - 125:29] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [126:5 - 126:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [126:6 - 126:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [126:10 - 126:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""nodebug"" [126:11 - 126:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [126:20 - 126:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_nodebug" [126:22 - 126:32] DeclRefExpr=AT_nodebug:20:63 +// CHECK-tokens: Punctuation: ")" [126:32 - 126:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [127:5 - 127:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [127:6 - 127:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [127:10 - 127:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""nonnull"" [127:11 - 127:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [127:20 - 127:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_nonnull" [127:22 - 127:32] DeclRefExpr=AT_nonnull:21:47 +// CHECK-tokens: Punctuation: ")" [127:32 - 127:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [128:5 - 128:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [128:6 - 128:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [128:10 - 128:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""nothrow"" [128:11 - 128:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [128:20 - 128:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_nothrow" [128:22 - 128:32] DeclRefExpr=AT_nothrow:22:7 +// CHECK-tokens: Punctuation: ")" [128:32 - 128:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [129:5 - 129:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [129:6 - 129:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [129:10 - 129:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""objc_gc"" [129:11 - 129:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [129:20 - 129:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_objc_gc" [129:22 - 129:32] DeclRefExpr=AT_objc_gc:24:59 +// CHECK-tokens: Punctuation: ")" [129:32 - 129:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [130:5 - 130:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [130:6 - 130:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [130:10 - 130:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""regparm"" [130:11 - 130:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [130:20 - 130:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_regparm" [130:22 - 130:32] DeclRefExpr=AT_regparm:26:58 +// CHECK-tokens: Punctuation: ")" [130:32 - 130:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [131:5 - 131:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [131:6 - 131:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [131:10 - 131:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""section"" [131:11 - 131:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [131:20 - 131:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_section" [131:22 - 131:32] DeclRefExpr=AT_section:27:7 +// CHECK-tokens: Punctuation: ")" [131:32 - 131:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [132:5 - 132:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [132:6 - 132:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [132:10 - 132:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""stdcall"" [132:11 - 132:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [132:20 - 132:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_stdcall" [132:22 - 132:32] DeclRefExpr=AT_stdcall:27:32 +// CHECK-tokens: Punctuation: ")" [132:32 - 132:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [133:5 - 133:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [133:6 - 133:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [133:10 - 133:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""annotate"" [133:11 - 133:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [133:21 - 133:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_annotate" [133:23 - 133:34] DeclRefExpr=AT_annotate:16:29 +// CHECK-tokens: Punctuation: ")" [133:34 - 133:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [134:5 - 134:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [134:6 - 134:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [134:10 - 134:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""fastcall"" [134:11 - 134:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [134:21 - 134:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_fastcall" [134:23 - 134:34] DeclRefExpr=AT_fastcall:19:27 +// CHECK-tokens: Punctuation: ")" [134:34 - 134:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [135:5 - 135:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [135:6 - 135:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [135:10 - 135:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ibaction"" [135:11 - 135:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [135:21 - 135:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_IBAction" [135:23 - 135:34] DeclRefExpr=AT_IBAction:14:7 +// CHECK-tokens: Punctuation: ")" [135:34 - 135:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [136:5 - 136:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [136:6 - 136:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [136:10 - 136:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""iboutlet"" [136:11 - 136:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [136:21 - 136:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_IBOutlet" [136:23 - 136:34] DeclRefExpr=AT_IBOutlet:14:20 +// CHECK-tokens: Punctuation: ")" [136:34 - 136:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [137:5 - 137:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [137:6 - 137:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [137:10 - 137:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""iboutletcollection"" [137:11 - 137:31] StringLiteral= +// CHECK-tokens: Punctuation: "," [137:31 - 137:32] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_IBOutletCollection" [137:33 - 137:54] DeclRefExpr=AT_IBOutletCollection:14:33 +// CHECK-tokens: Punctuation: ")" [137:54 - 137:55] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [138:5 - 138:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [138:6 - 138:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [138:10 - 138:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""noreturn"" [138:11 - 138:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [138:21 - 138:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_noreturn" [138:23 - 138:34] DeclRefExpr=AT_noreturn:21:59 +// CHECK-tokens: Punctuation: ")" [138:34 - 138:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [139:5 - 139:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [139:6 - 139:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [139:10 - 139:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""noinline"" [139:11 - 139:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [139:21 - 139:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_noinline" [139:23 - 139:34] DeclRefExpr=AT_noinline:21:7 +// CHECK-tokens: Punctuation: ")" [139:34 - 139:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [140:5 - 140:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [140:6 - 140:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [140:10 - 140:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""override"" [140:11 - 140:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [140:21 - 140:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_override" [140:23 - 140:34] DeclRefExpr=AT_override:22:51 +// CHECK-tokens: Punctuation: ")" [140:34 - 140:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [141:5 - 141:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [141:6 - 141:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [141:10 - 141:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""sentinel"" [141:11 - 141:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [141:21 - 141:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_sentinel" [141:23 - 141:34] DeclRefExpr=AT_sentinel:27:19 +// CHECK-tokens: Punctuation: ")" [141:34 - 141:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [142:5 - 142:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [142:6 - 142:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [142:10 - 142:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""NSObject"" [142:11 - 142:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [142:21 - 142:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_nsobject" [142:23 - 142:34] DeclRefExpr=AT_nsobject:22:19 +// CHECK-tokens: Punctuation: ")" [142:34 - 142:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [143:5 - 143:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [143:6 - 143:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [143:10 - 143:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""dllimport"" [143:11 - 143:22] StringLiteral= +// CHECK-tokens: Punctuation: "," [143:22 - 143:23] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_dllimport" [143:24 - 143:36] DeclRefExpr=AT_dllimport:18:51 +// CHECK-tokens: Punctuation: ")" [143:36 - 143:37] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [144:5 - 144:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [144:6 - 144:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [144:10 - 144:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""dllexport"" [144:11 - 144:22] StringLiteral= +// CHECK-tokens: Punctuation: "," [144:22 - 144:23] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_dllexport" [144:24 - 144:36] DeclRefExpr=AT_dllexport:18:37 +// CHECK-tokens: Punctuation: ")" [144:36 - 144:37] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [145:5 - 145:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [145:6 - 145:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [145:10 - 145:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""may_alias"" [145:11 - 145:22] StringLiteral= +// CHECK-tokens: Punctuation: "," [145:22 - 145:23] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "IgnoredAttribute" [145:24 - 145:40] DeclRefExpr=IgnoredAttribute:31:25 +// CHECK-tokens: Punctuation: ")" [145:40 - 145:41] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [146:5 - 146:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [146:6 - 146:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [146:10 - 146:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""base_check"" [146:11 - 146:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [146:23 - 146:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_base_check" [146:25 - 146:38] DeclRefExpr=AT_base_check:16:42 +// CHECK-tokens: Punctuation: ")" [146:38 - 146:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [147:5 - 147:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [147:6 - 147:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [147:10 - 147:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""deprecated"" [147:11 - 147:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [147:23 - 147:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_deprecated" [147:25 - 147:38] DeclRefExpr=AT_deprecated:18:7 +// CHECK-tokens: Punctuation: ")" [147:38 - 147:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [148:5 - 148:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [148:6 - 148:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [148:10 - 148:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""visibility"" [148:11 - 148:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [148:23 - 148:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_visibility" [148:25 - 148:38] DeclRefExpr=AT_visibility:29:7 +// CHECK-tokens: Punctuation: ")" [148:38 - 148:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [149:5 - 149:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [149:6 - 149:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [149:10 - 149:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""destructor"" [149:11 - 149:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [149:23 - 149:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_destructor" [149:25 - 149:38] DeclRefExpr=AT_destructor:18:22 +// CHECK-tokens: Punctuation: ")" [149:38 - 149:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [150:5 - 150:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [150:6 - 150:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [150:10 - 150:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""format_arg"" [150:11 - 150:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [150:23 - 150:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_format_arg" [150:25 - 150:38] DeclRefExpr=AT_format_arg:19:61 +// CHECK-tokens: Punctuation: ")" [150:38 - 150:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [151:5 - 151:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [151:6 - 151:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [151:10 - 151:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""gnu_inline"" [151:11 - 151:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [151:23 - 151:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_gnu_inline" [151:25 - 151:38] DeclRefExpr=AT_gnu_inline:20:7 +// CHECK-tokens: Punctuation: ")" [151:38 - 151:39] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [152:5 - 152:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [152:6 - 152:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [152:10 - 152:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""weak_import"" [152:11 - 152:24] StringLiteral= +// CHECK-tokens: Punctuation: "," [152:24 - 152:25] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_weak_import" [152:26 - 152:40] DeclRefExpr=AT_weak_import:30:7 +// CHECK-tokens: Punctuation: ")" [152:40 - 152:41] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [153:5 - 153:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [153:6 - 153:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [153:10 - 153:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""vecreturn"" [153:11 - 153:22] StringLiteral= +// CHECK-tokens: Punctuation: "," [153:22 - 153:23] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_vecreturn" [153:24 - 153:36] DeclRefExpr=AT_vecreturn:28:43 +// CHECK-tokens: Punctuation: ")" [153:36 - 153:37] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [154:5 - 154:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [154:6 - 154:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [154:10 - 154:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""vector_size"" [154:11 - 154:24] StringLiteral= +// CHECK-tokens: Punctuation: "," [154:24 - 154:25] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_vector_size" [154:26 - 154:40] DeclRefExpr=AT_vector_size:28:57 +// CHECK-tokens: Punctuation: ")" [154:40 - 154:41] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [155:5 - 155:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [155:6 - 155:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [155:10 - 155:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""constructor"" [155:11 - 155:24] StringLiteral= +// CHECK-tokens: Punctuation: "," [155:24 - 155:25] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_constructor" [155:26 - 155:40] DeclRefExpr=AT_constructor:17:62 +// CHECK-tokens: Punctuation: ")" [155:40 - 155:41] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [156:5 - 156:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [156:6 - 156:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [156:10 - 156:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""unavailable"" [156:11 - 156:24] StringLiteral= +// CHECK-tokens: Punctuation: "," [156:24 - 156:25] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_unavailable" [156:26 - 156:40] DeclRefExpr=AT_unavailable:28:7 +// CHECK-tokens: Punctuation: ")" [156:40 - 156:41] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [157:5 - 157:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [157:6 - 157:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [157:10 - 157:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""overloadable"" [157:11 - 157:25] StringLiteral= +// CHECK-tokens: Punctuation: "," [157:25 - 157:26] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_overloadable" [157:27 - 157:42] DeclRefExpr=AT_overloadable:25:7 +// CHECK-tokens: Punctuation: ")" [157:42 - 157:43] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [158:5 - 158:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [158:6 - 158:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [158:10 - 158:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""address_space"" [158:11 - 158:26] StringLiteral= +// CHECK-tokens: Punctuation: "," [158:26 - 158:27] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_address_space" [158:28 - 158:44] DeclRefExpr=AT_address_space:15:7 +// CHECK-tokens: Punctuation: ")" [158:44 - 158:45] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [159:5 - 159:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [159:6 - 159:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [159:10 - 159:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""always_inline"" [159:11 - 159:26] StringLiteral= +// CHECK-tokens: Punctuation: "," [159:26 - 159:27] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_always_inline" [159:28 - 159:44] DeclRefExpr=AT_always_inline:15:47 +// CHECK-tokens: Punctuation: ")" [159:44 - 159:45] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [160:5 - 160:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [160:6 - 160:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [160:10 - 160:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""returns_twice"" [160:11 - 160:26] StringLiteral= +// CHECK-tokens: Punctuation: "," [160:26 - 160:27] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_returns_twice" [160:28 - 160:44] DeclRefExpr=AT_returns_twice:31:7 +// CHECK-tokens: Punctuation: ")" [160:44 - 160:45] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [161:5 - 161:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [161:6 - 161:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [161:10 - 161:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""vec_type_hint"" [161:11 - 161:26] StringLiteral= +// CHECK-tokens: Punctuation: "," [161:26 - 161:27] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "IgnoredAttribute" [161:28 - 161:44] DeclRefExpr=IgnoredAttribute:31:25 +// CHECK-tokens: Punctuation: ")" [161:44 - 161:45] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [162:5 - 162:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [162:6 - 162:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [162:10 - 162:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""objc_exception"" [162:11 - 162:27] StringLiteral= +// CHECK-tokens: Punctuation: "," [162:27 - 162:28] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_objc_exception" [162:29 - 162:46] DeclRefExpr=AT_objc_exception:22:32 +// CHECK-tokens: Punctuation: ")" [162:46 - 162:47] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [163:5 - 163:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [163:6 - 163:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [163:10 - 163:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ext_vector_type"" [163:11 - 163:28] StringLiteral= +// CHECK-tokens: Punctuation: "," [163:28 - 163:29] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ext_vector_type" [163:30 - 163:48] DeclRefExpr=AT_ext_vector_type:19:7 +// CHECK-tokens: Punctuation: ")" [163:48 - 163:49] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [164:5 - 164:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [164:6 - 164:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [164:10 - 164:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""transparent_union"" [164:11 - 164:30] StringLiteral= +// CHECK-tokens: Punctuation: "," [164:30 - 164:31] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_transparent_union" [164:32 - 164:52] DeclRefExpr=AT_transparent_union:27:57 +// CHECK-tokens: Punctuation: ")" [164:52 - 164:53] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [165:5 - 165:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [165:6 - 165:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [165:10 - 165:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""analyzer_noreturn"" [165:11 - 165:30] StringLiteral= +// CHECK-tokens: Punctuation: "," [165:30 - 165:31] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_analyzer_noreturn" [165:32 - 165:52] DeclRefExpr=AT_analyzer_noreturn:16:7 +// CHECK-tokens: Punctuation: ")" [165:52 - 165:53] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [166:5 - 166:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [166:6 - 166:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [166:10 - 166:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""warn_unused_result"" [166:11 - 166:31] StringLiteral= +// CHECK-tokens: Punctuation: "," [166:31 - 166:32] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_warn_unused_result" [166:33 - 166:54] DeclRefExpr=AT_warn_unused_result:29:22 +// CHECK-tokens: Punctuation: ")" [166:54 - 166:55] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [167:5 - 167:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [167:6 - 167:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [167:10 - 167:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""carries_dependency"" [167:11 - 167:31] StringLiteral= +// CHECK-tokens: Punctuation: "," [167:31 - 167:32] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_carries_dependency" [167:33 - 167:54] DeclRefExpr=AT_carries_dependency:17:7 +// CHECK-tokens: Punctuation: ")" [167:54 - 167:55] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [168:5 - 168:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [168:6 - 168:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [168:10 - 168:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ns_returns_not_retained"" [168:11 - 168:36] StringLiteral= +// CHECK-tokens: Punctuation: "," [168:36 - 168:37] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ns_returns_not_retained" [168:38 - 168:64] DeclRefExpr=AT_ns_returns_not_retained:24:7 +// CHECK-tokens: Punctuation: ")" [168:64 - 168:65] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [169:5 - 169:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [169:6 - 169:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [169:10 - 169:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ns_returns_retained"" [169:11 - 169:32] StringLiteral= +// CHECK-tokens: Punctuation: "," [169:32 - 169:33] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ns_returns_retained" [169:34 - 169:56] DeclRefExpr=AT_ns_returns_retained:24:35 +// CHECK-tokens: Punctuation: ")" [169:56 - 169:57] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [170:5 - 170:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [170:6 - 170:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [170:10 - 170:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""cf_returns_not_retained"" [170:11 - 170:36] StringLiteral= +// CHECK-tokens: Punctuation: "," [170:36 - 170:37] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_cf_returns_not_retained" [170:38 - 170:64] DeclRefExpr=AT_cf_returns_not_retained:23:7 +// CHECK-tokens: Punctuation: ")" [170:64 - 170:65] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [171:5 - 171:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [171:6 - 171:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [171:10 - 171:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""cf_returns_retained"" [171:11 - 171:32] StringLiteral= +// CHECK-tokens: Punctuation: "," [171:32 - 171:33] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_cf_returns_retained" [171:34 - 171:56] DeclRefExpr=AT_cf_returns_retained:23:35 +// CHECK-tokens: Punctuation: ")" [171:56 - 171:57] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [172:5 - 172:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [172:6 - 172:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [172:10 - 172:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ownership_returns"" [172:11 - 172:30] StringLiteral= +// CHECK-tokens: Punctuation: "," [172:30 - 172:31] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ownership_returns" [172:32 - 172:52] DeclRefExpr=AT_ownership_returns:25:44 +// CHECK-tokens: Punctuation: ")" [172:52 - 172:53] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [173:5 - 173:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [173:6 - 173:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [173:10 - 173:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ownership_holds"" [173:11 - 173:28] StringLiteral= +// CHECK-tokens: Punctuation: "," [173:28 - 173:29] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ownership_holds" [173:30 - 173:48] DeclRefExpr=AT_ownership_holds:25:24 +// CHECK-tokens: Punctuation: ")" [173:48 - 173:49] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [174:5 - 174:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [174:6 - 174:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [174:10 - 174:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""ownership_takes"" [174:11 - 174:28] StringLiteral= +// CHECK-tokens: Punctuation: "," [174:28 - 174:29] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_ownership_takes" [174:30 - 174:48] DeclRefExpr=AT_ownership_takes:26:7 +// CHECK-tokens: Punctuation: ")" [174:48 - 174:49] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [175:5 - 175:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [175:6 - 175:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [175:10 - 175:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""reqd_work_group_size"" [175:11 - 175:33] StringLiteral= +// CHECK-tokens: Punctuation: "," [175:33 - 175:34] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_reqd_wg_size" [175:35 - 175:50] DeclRefExpr=AT_reqd_wg_size:30:23 +// CHECK-tokens: Punctuation: ")" [175:50 - 175:51] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [176:5 - 176:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [176:6 - 176:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [176:10 - 176:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""init_priority"" [176:11 - 176:26] StringLiteral= +// CHECK-tokens: Punctuation: "," [176:26 - 176:27] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_init_priority" [176:28 - 176:44] DeclRefExpr=AT_init_priority:30:40 +// CHECK-tokens: Punctuation: ")" [176:44 - 176:45] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [177:5 - 177:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [177:6 - 177:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [177:10 - 177:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""no_instrument_function"" [177:11 - 177:35] StringLiteral= +// CHECK-tokens: Punctuation: "," [177:35 - 177:36] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_no_instrument_function" [177:37 - 177:62] DeclRefExpr=AT_no_instrument_function:21:20 +// CHECK-tokens: Punctuation: ")" [177:62 - 177:63] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [178:5 - 178:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [178:6 - 178:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [178:10 - 178:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""thiscall"" [178:11 - 178:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [178:21 - 178:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_thiscall" [178:23 - 178:34] DeclRefExpr=AT_thiscall:27:44 +// CHECK-tokens: Punctuation: ")" [178:34 - 178:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [179:5 - 179:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [179:6 - 179:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [179:10 - 179:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""pascal"" [179:11 - 179:19] StringLiteral= +// CHECK-tokens: Punctuation: "," [179:19 - 179:20] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_pascal" [179:21 - 179:30] DeclRefExpr=AT_pascal:26:38 +// CHECK-tokens: Punctuation: ")" [179:30 - 179:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [180:5 - 180:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [180:6 - 180:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [180:10 - 180:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__cdecl"" [180:11 - 180:20] StringLiteral= +// CHECK-tokens: Punctuation: "," [180:20 - 180:21] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_cdecl" [180:22 - 180:30] DeclRefExpr=AT_cdecl:17:30 +// CHECK-tokens: Punctuation: ")" [180:30 - 180:31] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [181:5 - 181:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [181:6 - 181:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [181:10 - 181:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__stdcall"" [181:11 - 181:22] StringLiteral= +// CHECK-tokens: Punctuation: "," [181:22 - 181:23] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_stdcall" [181:24 - 181:34] DeclRefExpr=AT_stdcall:27:32 +// CHECK-tokens: Punctuation: ")" [181:34 - 181:35] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [182:5 - 182:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [182:6 - 182:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [182:10 - 182:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__fastcall"" [182:11 - 182:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [182:23 - 182:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_fastcall" [182:25 - 182:36] DeclRefExpr=AT_fastcall:19:27 +// CHECK-tokens: Punctuation: ")" [182:36 - 182:37] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [183:5 - 183:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [183:6 - 183:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [183:10 - 183:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__thiscall"" [183:11 - 183:23] StringLiteral= +// CHECK-tokens: Punctuation: "," [183:23 - 183:24] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_thiscall" [183:25 - 183:36] DeclRefExpr=AT_thiscall:27:44 +// CHECK-tokens: Punctuation: ")" [183:36 - 183:37] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [184:5 - 184:6] MemberRefExpr=Case:88:42 +// CHECK-tokens: Identifier: "Case" [184:6 - 184:10] MemberRefExpr=Case:88:42 +// CHECK-tokens: Punctuation: "(" [184:10 - 184:11] CallExpr=Case:88:42 +// CHECK-tokens: Literal: ""__pascal"" [184:11 - 184:21] StringLiteral= +// CHECK-tokens: Punctuation: "," [184:21 - 184:22] CallExpr=Case:88:42 +// CHECK-tokens: Identifier: "AT_pascal" [184:23 - 184:32] DeclRefExpr=AT_pascal:26:38 +// CHECK-tokens: Punctuation: ")" [184:32 - 184:33] CallExpr=Case:88:42 +// CHECK-tokens: Punctuation: "." [185:5 - 185:6] MemberRefExpr=Default:92:5 +// CHECK-tokens: Identifier: "Default" [185:6 - 185:13] MemberRefExpr=Default:92:5 +// CHECK-tokens: Punctuation: "(" [185:13 - 185:14] CallExpr=Default:92:5 +// CHECK-tokens: Identifier: "UnknownAttribute" [185:14 - 185:30] DeclRefExpr=UnknownAttribute:31:43 +// CHECK-tokens: Punctuation: ")" [185:30 - 185:31] CallExpr=Default:92:5 +// CHECK-tokens: Punctuation: ";" [185:31 - 185:32] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [186:1 - 186:2] CompoundStmt= + +// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s +// CHECK: 1:27: TypedefDecl=__darwin_size_t:1:27 (Definition) Extent=[1:1 - 1:42] +// CHECK: 2:25: TypedefDecl=size_t:2:25 (Definition) Extent=[2:1 - 2:31] +// CHECK: 2:9: TypeRef=__darwin_size_t:1:27 Extent=[2:9 - 2:24] +// CHECK: 3:11: Namespace=std:3:11 (Definition) Extent=[3:1 - 5:2] +// CHECK: 4:44: ClassTemplate=pair:4:44 (Definition) Extent=[4:3 - 4:64] +// CHECK: 4:20: TemplateTypeParameter=_T1:4:20 (Definition) Extent=[4:14 - 4:23] +// CHECK: 4:31: TemplateTypeParameter=_T2:4:31 (Definition) Extent=[4:25 - 4:34] +// CHECK: 4:55: FieldDecl=second:4:55 (Definition) Extent=[4:51 - 4:61] +// CHECK: 6:8: UnexposedDecl=:6:8 (Definition) Extent=[6:1 - 9:2] +// CHECK: 7:7: FunctionDecl=memcmp:7:7 Extent=[7:3 - 7:49] +// CHECK: 7:26: ParmDecl=:7:26 (Definition) Extent=[7:14 - 7:27] +// CHECK: 7:40: ParmDecl=:7:40 (Definition) Extent=[7:28 - 7:41] +// CHECK: 7:48: ParmDecl=:7:48 (Definition) Extent=[7:42 - 7:49] +// CHECK: 7:42: TypeRef=size_t:2:25 Extent=[7:42 - 7:48] +// CHECK: 8:10: FunctionDecl=strlen:8:10 Extent=[8:3 - 8:30] +// CHECK: 8:3: TypeRef=size_t:2:25 Extent=[8:3 - 8:9] +// CHECK: 8:29: ParmDecl=:8:29 (Definition) Extent=[8:17 - 8:30] +// CHECK: 10:17: Namespace=clang:10:17 (Definition) Extent=[10:1 - 35:2] +// CHECK: 11:9: ClassDecl=IdentifierInfo:11:9 Extent=[11:3 - 11:23] +// CHECK: 12:9: ClassDecl=AttributeList:12:9 (Definition) Extent=[12:3 - 34:4] +// CHECK: 13:10: EnumDecl=Kind:13:10 (Definition) Extent=[13:5 - 32:6] +// CHECK: 14:7: EnumConstantDecl=AT_IBAction:14:7 (Definition) Extent=[14:7 - 14:18] +// CHECK: 14:20: EnumConstantDecl=AT_IBOutlet:14:20 (Definition) Extent=[14:20 - 14:31] +// CHECK: 14:33: EnumConstantDecl=AT_IBOutletCollection:14:33 (Definition) Extent=[14:33 - 14:54] +// CHECK: 15:7: EnumConstantDecl=AT_address_space:15:7 (Definition) Extent=[15:7 - 15:23] +// CHECK: 15:25: EnumConstantDecl=AT_alias:15:25 (Definition) Extent=[15:25 - 15:33] +// CHECK: 15:35: EnumConstantDecl=AT_aligned:15:35 (Definition) Extent=[15:35 - 15:45] +// CHECK: 15:47: EnumConstantDecl=AT_always_inline:15:47 (Definition) Extent=[15:47 - 15:63] +// CHECK: 16:7: EnumConstantDecl=AT_analyzer_noreturn:16:7 (Definition) Extent=[16:7 - 16:27] +// CHECK: 16:29: EnumConstantDecl=AT_annotate:16:29 (Definition) Extent=[16:29 - 16:40] +// CHECK: 16:42: EnumConstantDecl=AT_base_check:16:42 (Definition) Extent=[16:42 - 16:55] +// CHECK: 16:57: EnumConstantDecl=AT_blocks:16:57 (Definition) Extent=[16:57 - 16:66] +// CHECK: 17:7: EnumConstantDecl=AT_carries_dependency:17:7 (Definition) Extent=[17:7 - 17:28] +// CHECK: 17:30: EnumConstantDecl=AT_cdecl:17:30 (Definition) Extent=[17:30 - 17:38] +// CHECK: 17:40: EnumConstantDecl=AT_cleanup:17:40 (Definition) Extent=[17:40 - 17:50] +// CHECK: 17:52: EnumConstantDecl=AT_const:17:52 (Definition) Extent=[17:52 - 17:60] +// CHECK: 17:62: EnumConstantDecl=AT_constructor:17:62 (Definition) Extent=[17:62 - 17:76] +// CHECK: 18:7: EnumConstantDecl=AT_deprecated:18:7 (Definition) Extent=[18:7 - 18:20] +// CHECK: 18:22: EnumConstantDecl=AT_destructor:18:22 (Definition) Extent=[18:22 - 18:35] +// CHECK: 18:37: EnumConstantDecl=AT_dllexport:18:37 (Definition) Extent=[18:37 - 18:49] +// CHECK: 18:51: EnumConstantDecl=AT_dllimport:18:51 (Definition) Extent=[18:51 - 18:63] +// CHECK: 19:7: EnumConstantDecl=AT_ext_vector_type:19:7 (Definition) Extent=[19:7 - 19:25] +// CHECK: 19:27: EnumConstantDecl=AT_fastcall:19:27 (Definition) Extent=[19:27 - 19:38] +// CHECK: 19:40: EnumConstantDecl=AT_final:19:40 (Definition) Extent=[19:40 - 19:48] +// CHECK: 19:50: EnumConstantDecl=AT_format:19:50 (Definition) Extent=[19:50 - 19:59] +// CHECK: 19:61: EnumConstantDecl=AT_format_arg:19:61 (Definition) Extent=[19:61 - 19:74] +// CHECK: 20:7: EnumConstantDecl=AT_gnu_inline:20:7 (Definition) Extent=[20:7 - 20:20] +// CHECK: 20:22: EnumConstantDecl=AT_hiding:20:22 (Definition) Extent=[20:22 - 20:31] +// CHECK: 20:33: EnumConstantDecl=AT_malloc:20:33 (Definition) Extent=[20:33 - 20:42] +// CHECK: 20:44: EnumConstantDecl=AT_mode:20:44 (Definition) Extent=[20:44 - 20:51] +// CHECK: 20:53: EnumConstantDecl=AT_naked:20:53 (Definition) Extent=[20:53 - 20:61] +// CHECK: 20:63: EnumConstantDecl=AT_nodebug:20:63 (Definition) Extent=[20:63 - 20:73] +// CHECK: 21:7: EnumConstantDecl=AT_noinline:21:7 (Definition) Extent=[21:7 - 21:18] +// CHECK: 21:20: EnumConstantDecl=AT_no_instrument_function:21:20 (Definition) Extent=[21:20 - 21:45] +// CHECK: 21:47: EnumConstantDecl=AT_nonnull:21:47 (Definition) Extent=[21:47 - 21:57] +// CHECK: 21:59: EnumConstantDecl=AT_noreturn:21:59 (Definition) Extent=[21:59 - 21:70] +// CHECK: 22:7: EnumConstantDecl=AT_nothrow:22:7 (Definition) Extent=[22:7 - 22:17] +// CHECK: 22:19: EnumConstantDecl=AT_nsobject:22:19 (Definition) Extent=[22:19 - 22:30] +// CHECK: 22:32: EnumConstantDecl=AT_objc_exception:22:32 (Definition) Extent=[22:32 - 22:49] +// CHECK: 22:51: EnumConstantDecl=AT_override:22:51 (Definition) Extent=[22:51 - 22:62] +// CHECK: 23:7: EnumConstantDecl=AT_cf_returns_not_retained:23:7 (Definition) Extent=[23:7 - 23:33] +// CHECK: 23:35: EnumConstantDecl=AT_cf_returns_retained:23:35 (Definition) Extent=[23:35 - 23:57] +// CHECK: 24:7: EnumConstantDecl=AT_ns_returns_not_retained:24:7 (Definition) Extent=[24:7 - 24:33] +// CHECK: 24:35: EnumConstantDecl=AT_ns_returns_retained:24:35 (Definition) Extent=[24:35 - 24:57] +// CHECK: 24:59: EnumConstantDecl=AT_objc_gc:24:59 (Definition) Extent=[24:59 - 24:69] +// CHECK: 25:7: EnumConstantDecl=AT_overloadable:25:7 (Definition) Extent=[25:7 - 25:22] +// CHECK: 25:24: EnumConstantDecl=AT_ownership_holds:25:24 (Definition) Extent=[25:24 - 25:42] +// CHECK: 25:44: EnumConstantDecl=AT_ownership_returns:25:44 (Definition) Extent=[25:44 - 25:64] +// CHECK: 26:7: EnumConstantDecl=AT_ownership_takes:26:7 (Definition) Extent=[26:7 - 26:25] +// CHECK: 26:27: EnumConstantDecl=AT_packed:26:27 (Definition) Extent=[26:27 - 26:36] +// CHECK: 26:38: EnumConstantDecl=AT_pascal:26:38 (Definition) Extent=[26:38 - 26:47] +// CHECK: 26:49: EnumConstantDecl=AT_pure:26:49 (Definition) Extent=[26:49 - 26:56] +// CHECK: 26:58: EnumConstantDecl=AT_regparm:26:58 (Definition) Extent=[26:58 - 26:68] +// CHECK: 27:7: EnumConstantDecl=AT_section:27:7 (Definition) Extent=[27:7 - 27:17] +// CHECK: 27:19: EnumConstantDecl=AT_sentinel:27:19 (Definition) Extent=[27:19 - 27:30] +// CHECK: 27:32: EnumConstantDecl=AT_stdcall:27:32 (Definition) Extent=[27:32 - 27:42] +// CHECK: 27:44: EnumConstantDecl=AT_thiscall:27:44 (Definition) Extent=[27:44 - 27:55] +// CHECK: 27:57: EnumConstantDecl=AT_transparent_union:27:57 (Definition) Extent=[27:57 - 27:77] +// CHECK: 28:7: EnumConstantDecl=AT_unavailable:28:7 (Definition) Extent=[28:7 - 28:21] +// CHECK: 28:23: EnumConstantDecl=AT_unused:28:23 (Definition) Extent=[28:23 - 28:32] +// CHECK: 28:34: EnumConstantDecl=AT_used:28:34 (Definition) Extent=[28:34 - 28:41] +// CHECK: 28:43: EnumConstantDecl=AT_vecreturn:28:43 (Definition) Extent=[28:43 - 28:55] +// CHECK: 28:57: EnumConstantDecl=AT_vector_size:28:57 (Definition) Extent=[28:57 - 28:71] +// CHECK: 29:7: EnumConstantDecl=AT_visibility:29:7 (Definition) Extent=[29:7 - 29:20] +// CHECK: 29:22: EnumConstantDecl=AT_warn_unused_result:29:22 (Definition) Extent=[29:22 - 29:43] +// CHECK: 29:45: EnumConstantDecl=AT_weak:29:45 (Definition) Extent=[29:45 - 29:52] +// CHECK: 29:54: EnumConstantDecl=AT_weakref:29:54 (Definition) Extent=[29:54 - 29:64] +// CHECK: 30:7: EnumConstantDecl=AT_weak_import:30:7 (Definition) Extent=[30:7 - 30:21] +// CHECK: 30:23: EnumConstantDecl=AT_reqd_wg_size:30:23 (Definition) Extent=[30:23 - 30:38] +// CHECK: 30:40: EnumConstantDecl=AT_init_priority:30:40 (Definition) Extent=[30:40 - 30:56] +// CHECK: 31:7: EnumConstantDecl=AT_returns_twice:31:7 (Definition) Extent=[31:7 - 31:23] +// CHECK: 31:25: EnumConstantDecl=IgnoredAttribute:31:25 (Definition) Extent=[31:25 - 31:41] +// CHECK: 33:17: CXXMethod=getKind:33:17 (static) Extent=[33:5 - 33:53] +// CHECK: 33:12: TypeRef=enum clang::AttributeList::Kind:13:10 Extent=[33:12 - 33:16] +// CHECK: 33:48: ParmDecl=Name:33:48 (Definition) Extent=[33:25 - 33:52] +// CHECK: 33:31: TypeRef=class clang::IdentifierInfo:66:7 Extent=[33:31 - 33:45] +// CHECK: 36:8: FunctionDecl=magic_length:36:8 Extent=[36:1 - 36:35] +// CHECK: 36:1: TypeRef=size_t:2:25 Extent=[36:1 - 36:7] +// CHECK: 36:33: ParmDecl=s:36:33 (Definition) Extent=[36:21 - 36:34] +// CHECK: 37:11: Namespace=llvm:37:11 (Definition) Extent=[37:1 - 64:2] +// CHECK: 38:7: ClassDecl=StringRef:38:7 (Definition) Extent=[38:1 - 63:2] +// CHECK: 39:1: CXXAccessSpecifier=:39:1 (Definition) Extent=[39:1 - 39:8] +// CHECK: 40:23: TypedefDecl=iterator:40:23 (Definition) Extent=[40:3 - 40:31] +// CHECK: 41:23: VarDecl=npos:41:23 Extent=[41:3 - 41:40] +// CHECK: 41:16: TypeRef=size_t:2:25 Extent=[41:16 - 41:22] +// CHECK: 41:30: UnaryOperator= Extent=[41:30 - 41:40] +// CHECK: 41:31: CXXFunctionalCastExpr= Extent=[41:31 - 41:40] +// CHECK: 41:31: TypeRef=size_t:2:25 Extent=[41:31 - 41:37] +// CHECK: 41:38: UnexposedExpr= Extent=[41:38 - 41:39] +// CHECK: 41:38: IntegerLiteral= Extent=[41:38 - 41:39] +// CHECK: 42:1: CXXAccessSpecifier=:42:1 (Definition) Extent=[42:1 - 42:9] +// CHECK: 43:15: FieldDecl=Data:43:15 (Definition) Extent=[43:3 - 43:19] +// CHECK: 44:10: FieldDecl=Length:44:10 (Definition) Extent=[44:3 - 44:16] +// CHECK: 44:3: TypeRef=size_t:2:25 Extent=[44:3 - 44:9] +// CHECK: 45:17: CXXMethod=min:45:17 (Definition) (static) Extent=[45:3 - 45:66] +// CHECK: 45:10: TypeRef=size_t:2:25 Extent=[45:10 - 45:16] +// CHECK: 45:28: ParmDecl=a:45:28 (Definition) Extent=[45:21 - 45:29] +// CHECK: 45:21: TypeRef=size_t:2:25 Extent=[45:21 - 45:27] +// CHECK: 45:38: ParmDecl=b:45:38 (Definition) Extent=[45:31 - 45:39] +// CHECK: 45:31: TypeRef=size_t:2:25 Extent=[45:31 - 45:37] +// CHECK: 45:41: CompoundStmt= Extent=[45:41 - 45:66] +// CHECK: 45:43: ReturnStmt= Extent=[45:43 - 45:63] +// CHECK: 45:50: ConditionalOperator= Extent=[45:50 - 45:63] +// CHECK: 45:50: BinaryOperator= Extent=[45:50 - 45:55] +// CHECK: 45:50: DeclRefExpr=a:45:28 Extent=[45:50 - 45:51] +// CHECK: 45:54: DeclRefExpr=b:45:38 Extent=[45:54 - 45:55] +// CHECK: 45:58: DeclRefExpr=a:45:28 Extent=[45:58 - 45:59] +// CHECK: 45:62: DeclRefExpr=b:45:38 Extent=[45:62 - 45:63] +// CHECK: 46:1: CXXAccessSpecifier=:46:1 (Definition) Extent=[46:1 - 46:8] +// CHECK: 47:3: CXXConstructor=StringRef:47:3 (Definition) Extent=[47:3 - 47:37] +// CHECK: 47:16: MemberRef=Data:43:15 Extent=[47:16 - 47:20] +// CHECK: 47:21: UnexposedExpr= Extent=[47:21 - 47:22] +// CHECK: 47:21: IntegerLiteral= Extent=[47:21 - 47:22] +// CHECK: 47:25: MemberRef=Length:44:10 Extent=[47:25 - 47:31] +// CHECK: 47:32: UnexposedExpr= Extent=[47:32 - 47:33] +// CHECK: 47:32: IntegerLiteral= Extent=[47:32 - 47:33] +// CHECK: 47:35: CompoundStmt= Extent=[47:35 - 47:37] +// CHECK: 48:3: CXXConstructor=StringRef:48:3 (Definition) Extent=[48:3 - 48:71] +// CHECK: 48:25: ParmDecl=Str:48:25 (Definition) Extent=[48:13 - 48:28] +// CHECK: 48:32: MemberRef=Data:43:15 Extent=[48:32 - 48:36] +// CHECK: 48:37: DeclRefExpr=Str:48:25 Extent=[48:37 - 48:40] +// CHECK: 48:43: MemberRef=Length:44:10 Extent=[48:43 - 48:49] +// CHECK: 48:50: CallExpr=magic_length:36:8 Extent=[48:50 - 48:67] +// CHECK: 48:50: UnexposedExpr=magic_length:36:8 Extent=[48:50 - 48:62] +// CHECK: 48:50: DeclRefExpr=magic_length:36:8 Extent=[48:50 - 48:62] +// CHECK: 48:63: DeclRefExpr=Str:48:25 Extent=[48:63 - 48:66] +// CHECK: 48:69: CompoundStmt= Extent=[48:69 - 48:71] +// CHECK: 49:3: CXXConstructor=StringRef:49:3 (Definition) Extent=[49:3 - 49:77] +// CHECK: 49:25: ParmDecl=data:49:25 (Definition) Extent=[49:13 - 49:29] +// CHECK: 49:38: ParmDecl=length:49:38 (Definition) Extent=[49:31 - 49:44] +// CHECK: 49:31: TypeRef=size_t:2:25 Extent=[49:31 - 49:37] +// CHECK: 49:48: MemberRef=Data:43:15 Extent=[49:48 - 49:52] +// CHECK: 49:53: DeclRefExpr=data:49:25 Extent=[49:53 - 49:57] +// CHECK: 49:60: MemberRef=Length:44:10 Extent=[49:60 - 49:66] +// CHECK: 49:67: DeclRefExpr=length:49:38 Extent=[49:67 - 49:73] +// CHECK: 49:75: CompoundStmt= Extent=[49:75 - 49:77] +// CHECK: 50:12: CXXMethod=end:50:12 (Definition) Extent=[50:3 - 50:40] +// CHECK: 50:3: TypeRef=iterator:40:23 Extent=[50:3 - 50:11] +// CHECK: 50:24: CompoundStmt= Extent=[50:24 - 50:40] +// CHECK: 50:26: ReturnStmt= Extent=[50:26 - 50:37] +// CHECK: 50:33: MemberRefExpr=Data:43:15 Extent=[50:33 - 50:37] +// CHECK: 51:10: CXXMethod=size:51:10 (Definition) Extent=[51:3 - 51:41] +// CHECK: 51:3: TypeRef=size_t:2:25 Extent=[51:3 - 51:9] +// CHECK: 51:23: CompoundStmt= Extent=[51:23 - 51:41] +// CHECK: 51:25: ReturnStmt= Extent=[51:25 - 51:38] +// CHECK: 51:32: MemberRefExpr=Length:44:10 Extent=[51:32 - 51:38] +// CHECK: 52:8: CXXMethod=startswith:52:8 (Definition) Extent=[52:3 - 55:4] +// CHECK: 52:29: ParmDecl=Prefix:52:29 (Definition) Extent=[52:19 - 52:35] +// CHECK: 52:19: TypeRef=class llvm::StringRef:38:7 Extent=[52:19 - 52:28] +// CHECK: 52:43: CompoundStmt= Extent=[52:43 - 55:4] +// CHECK: 53:5: ReturnStmt= Extent=[53:5 - 54:56] +// CHECK: 53:12: BinaryOperator= Extent=[53:12 - 54:56] +// CHECK: 53:12: BinaryOperator= Extent=[53:12 - 53:35] +// CHECK: 53:12: UnexposedExpr=Length:44:10 Extent=[53:12 - 53:18] +// CHECK: 53:12: MemberRefExpr=Length:44:10 Extent=[53:12 - 53:18] +// CHECK: 53:29: MemberRefExpr=Length:44:10 SingleRefName=[53:29 - 53:35] RefName=[53:29 - 53:35] Extent=[53:22 - 53:35] +// CHECK: 53:22: DeclRefExpr=Prefix:52:29 Extent=[53:22 - 53:28] +// CHECK: 54:11: BinaryOperator= Extent=[54:11 - 54:56] +// CHECK: 54:11: CallExpr=memcmp:7:7 Extent=[54:11 - 54:51] +// CHECK: 54:11: UnexposedExpr=memcmp:7:7 Extent=[54:11 - 54:17] +// CHECK: 54:11: DeclRefExpr=memcmp:7:7 Extent=[54:11 - 54:17] +// CHECK: 54:18: UnexposedExpr=Data:43:15 Extent=[54:18 - 54:22] +// CHECK: 54:18: MemberRefExpr=Data:43:15 Extent=[54:18 - 54:22] +// CHECK: 54:31: UnexposedExpr=Data:43:15 Extent=[54:24 - 54:35] +// CHECK: 54:31: MemberRefExpr=Data:43:15 SingleRefName=[54:31 - 54:35] RefName=[54:31 - 54:35] Extent=[54:24 - 54:35] +// CHECK: 54:24: DeclRefExpr=Prefix:52:29 Extent=[54:24 - 54:30] +// CHECK: 54:44: MemberRefExpr=Length:44:10 SingleRefName=[54:44 - 54:50] RefName=[54:44 - 54:50] Extent=[54:37 - 54:50] +// CHECK: 54:37: DeclRefExpr=Prefix:52:29 Extent=[54:37 - 54:43] +// CHECK: 54:55: IntegerLiteral= Extent=[54:55 - 54:56] +// CHECK: 56:8: CXXMethod=endswith:56:8 (Definition) Extent=[56:3 - 59:4] +// CHECK: 56:27: ParmDecl=Suffix:56:27 (Definition) Extent=[56:17 - 56:33] +// CHECK: 56:17: TypeRef=class llvm::StringRef:38:7 Extent=[56:17 - 56:26] +// CHECK: 56:41: CompoundStmt= Extent=[56:41 - 59:4] +// CHECK: 57:5: ReturnStmt= Extent=[57:5 - 58:69] +// CHECK: 57:12: BinaryOperator= Extent=[57:12 - 58:69] +// CHECK: 57:12: BinaryOperator= Extent=[57:12 - 57:35] +// CHECK: 57:12: UnexposedExpr=Length:44:10 Extent=[57:12 - 57:18] +// CHECK: 57:12: MemberRefExpr=Length:44:10 Extent=[57:12 - 57:18] +// CHECK: 57:29: MemberRefExpr=Length:44:10 SingleRefName=[57:29 - 57:35] RefName=[57:29 - 57:35] Extent=[57:22 - 57:35] +// CHECK: 57:22: DeclRefExpr=Suffix:56:27 Extent=[57:22 - 57:28] +// CHECK: 58:7: BinaryOperator= Extent=[58:7 - 58:69] +// CHECK: 58:7: CallExpr=memcmp:7:7 Extent=[58:7 - 58:64] +// CHECK: 58:7: UnexposedExpr=memcmp:7:7 Extent=[58:7 - 58:13] +// CHECK: 58:7: DeclRefExpr=memcmp:7:7 Extent=[58:7 - 58:13] +// CHECK: 58:14: UnexposedExpr= Extent=[58:14 - 58:35] +// CHECK: 58:14: BinaryOperator= Extent=[58:14 - 58:35] +// CHECK: 58:14: CallExpr=end:50:12 Extent=[58:14 - 58:19] +// CHECK: 58:14: MemberRefExpr=end:50:12 Extent=[58:14 - 58:17] +// CHECK: 58:29: MemberRefExpr=Length:44:10 SingleRefName=[58:29 - 58:35] RefName=[58:29 - 58:35] Extent=[58:22 - 58:35] +// CHECK: 58:22: DeclRefExpr=Suffix:56:27 Extent=[58:22 - 58:28] +// CHECK: 58:44: UnexposedExpr=Data:43:15 Extent=[58:37 - 58:48] +// CHECK: 58:44: MemberRefExpr=Data:43:15 SingleRefName=[58:44 - 58:48] RefName=[58:44 - 58:48] Extent=[58:37 - 58:48] +// CHECK: 58:37: DeclRefExpr=Suffix:56:27 Extent=[58:37 - 58:43] +// CHECK: 58:57: MemberRefExpr=Length:44:10 SingleRefName=[58:57 - 58:63] RefName=[58:57 - 58:63] Extent=[58:50 - 58:63] +// CHECK: 58:50: DeclRefExpr=Suffix:56:27 Extent=[58:50 - 58:56] +// CHECK: 58:68: IntegerLiteral= Extent=[58:68 - 58:69] +// CHECK: 60:13: CXXMethod=substr:60:13 (Definition) Extent=[60:3 - 62:4] +// CHECK: 60:3: TypeRef=class llvm::StringRef:38:7 Extent=[60:3 - 60:12] +// CHECK: 60:27: ParmDecl=Start:60:27 (Definition) Extent=[60:20 - 60:32] +// CHECK: 60:20: TypeRef=size_t:2:25 Extent=[60:20 - 60:26] +// CHECK: 60:41: ParmDecl=N:60:41 (Definition) Extent=[60:34 - 60:49] +// CHECK: 60:34: TypeRef=size_t:2:25 Extent=[60:34 - 60:40] +// CHECK: 60:45: DeclRefExpr=npos:41:23 Extent=[60:45 - 60:49] +// CHECK: 60:57: CompoundStmt= Extent=[60:57 - 62:4] +// CHECK: 61:5: ReturnStmt= Extent=[61:5 - 61:59] +// CHECK: 61:12: CallExpr= Extent=[61:12 - 61:59] +// CHECK: 61:12: UnexposedExpr=StringRef:49:3 Extent=[61:12 - 61:59] +// CHECK: 61:12: CallExpr=StringRef:49:3 Extent=[61:12 - 61:59] +// CHECK: 61:12: TypeRef=class llvm::StringRef:38:7 Extent=[61:12 - 61:21] +// CHECK: 61:22: BinaryOperator= Extent=[61:22 - 61:34] +// CHECK: 61:22: UnexposedExpr=Data:43:15 Extent=[61:22 - 61:26] +// CHECK: 61:22: MemberRefExpr=Data:43:15 Extent=[61:22 - 61:26] +// CHECK: 61:29: DeclRefExpr=Start:60:27 Extent=[61:29 - 61:34] +// CHECK: 61:36: CallExpr=min:45:17 Extent=[61:36 - 61:58] +// CHECK: 61:36: UnexposedExpr=min:45:17 Extent=[61:36 - 61:39] +// CHECK: 61:36: DeclRefExpr=min:45:17 Extent=[61:36 - 61:39] +// CHECK: 61:40: DeclRefExpr=N:60:41 Extent=[61:40 - 61:41] +// CHECK: 61:43: BinaryOperator= Extent=[61:43 - 61:57] +// CHECK: 61:43: UnexposedExpr=Length:44:10 Extent=[61:43 - 61:49] +// CHECK: 61:43: MemberRefExpr=Length:44:10 Extent=[61:43 - 61:49] +// CHECK: 61:52: DeclRefExpr=Start:60:27 Extent=[61:52 - 61:57] +// CHECK: 65:11: Namespace=clang:65:11 (Definition) Extent=[65:1 - 81:2] +// CHECK: 66:7: ClassDecl=IdentifierInfo:66:7 (Definition) Extent=[66:1 - 80:2] +// CHECK: 67:1: CXXAccessSpecifier=:67:1 (Definition) Extent=[67:1 - 67:8] +// CHECK: 67:8: CXXConstructor=IdentifierInfo:67:8 Extent=[67:8 - 67:24] +// CHECK: 68:15: CXXMethod=getNameStart:68:15 (Definition) Extent=[68:3 - 71:4] +// CHECK: 68:36: CompoundStmt= Extent=[68:36 - 71:4] +// CHECK: 69:5: DeclStmt= Extent=[69:5 - 69:65] +// CHECK: 69:54: TypedefDecl=actualtype:69:54 (Definition) Extent=[69:5 - 69:64] +// CHECK: 69:18: TemplateRef=pair:4:44 Extent=[69:18 - 69:22] +// CHECK: 69:25: TypeRef=class clang::IdentifierInfo:66:7 Extent=[69:25 - 69:39] +// CHECK: 70:5: ReturnStmt= Extent=[70:5 - 70:47] +// CHECK: 70:41: MemberRefExpr=second:4:55 SingleRefName=[70:41 - 70:47] RefName=[70:41 - 70:47] Extent=[70:12 - 70:47] +// CHECK: 70:12: ParenExpr= Extent=[70:12 - 70:39] +// CHECK: 70:13: CStyleCastExpr= Extent=[70:13 - 70:38] +// CHECK: 70:20: TypeRef=actualtype:69:54 Extent=[70:20 - 70:30] +// CHECK: 70:34: CXXThisExpr= Extent=[70:34 - 70:38] +// CHECK: 72:12: CXXMethod=getLength:72:12 (Definition) Extent=[72:3 - 76:4] +// CHECK: 72:30: CompoundStmt= Extent=[72:30 - 76:4] +// CHECK: 73:5: DeclStmt= Extent=[73:5 - 73:65] +// CHECK: 73:54: TypedefDecl=actualtype:73:54 (Definition) Extent=[73:5 - 73:64] +// CHECK: 73:18: TemplateRef=pair:4:44 Extent=[73:18 - 73:22] +// CHECK: 73:25: TypeRef=class clang::IdentifierInfo:66:7 Extent=[73:25 - 73:39] +// CHECK: 74:5: DeclStmt= Extent=[74:5 - 74:61] +// CHECK: 74:17: VarDecl=p:74:17 (Definition) Extent=[74:5 - 74:60] +// CHECK: 74:21: BinaryOperator= Extent=[74:21 - 74:60] +// CHECK: 74:50: UnexposedExpr=second:4:55 Extent=[74:21 - 74:56] +// CHECK: 74:50: MemberRefExpr=second:4:55 SingleRefName=[74:50 - 74:56] RefName=[74:50 - 74:56] Extent=[74:21 - 74:56] +// CHECK: 74:21: ParenExpr= Extent=[74:21 - 74:48] +// CHECK: 74:22: CStyleCastExpr= Extent=[74:22 - 74:47] +// CHECK: 74:29: TypeRef=actualtype:73:54 Extent=[74:29 - 74:39] +// CHECK: 74:43: CXXThisExpr= Extent=[74:43 - 74:47] +// CHECK: 74:59: IntegerLiteral= Extent=[74:59 - 74:60] +// CHECK: 75:5: ReturnStmt= Extent=[75:5 - 75:62] +// CHECK: 75:12: BinaryOperator= Extent=[75:12 - 75:62] +// CHECK: 75:12: ParenExpr= Extent=[75:12 - 75:58] +// CHECK: 75:13: BinaryOperator= Extent=[75:13 - 75:57] +// CHECK: 75:13: ParenExpr= Extent=[75:13 - 75:30] +// CHECK: 75:14: CStyleCastExpr= Extent=[75:14 - 75:29] +// CHECK: 75:25: UnexposedExpr= Extent=[75:25 - 75:29] +// CHECK: 75:25: UnexposedExpr= Extent=[75:25 - 75:29] +// CHECK: 75:25: ArraySubscriptExpr= Extent=[75:25 - 75:29] +// CHECK: 75:25: DeclRefExpr=p:74:17 Extent=[75:25 - 75:26] +// CHECK: 75:27: IntegerLiteral= Extent=[75:27 - 75:28] +// CHECK: 75:33: ParenExpr= Extent=[75:33 - 75:57] +// CHECK: 75:34: BinaryOperator= Extent=[75:34 - 75:56] +// CHECK: 75:34: ParenExpr= Extent=[75:34 - 75:51] +// CHECK: 75:35: CStyleCastExpr= Extent=[75:35 - 75:50] +// CHECK: 75:46: UnexposedExpr= Extent=[75:46 - 75:50] +// CHECK: 75:46: UnexposedExpr= Extent=[75:46 - 75:50] +// CHECK: 75:46: ArraySubscriptExpr= Extent=[75:46 - 75:50] +// CHECK: 75:46: DeclRefExpr=p:74:17 Extent=[75:46 - 75:47] +// CHECK: 75:48: IntegerLiteral= Extent=[75:48 - 75:49] +// CHECK: 75:55: IntegerLiteral= Extent=[75:55 - 75:56] +// CHECK: 75:61: UnexposedExpr= Extent=[75:61 - 75:62] +// CHECK: 75:61: IntegerLiteral= Extent=[75:61 - 75:62] +// CHECK: 77:19: CXXMethod=getName:77:19 (Definition) Extent=[77:3 - 79:4] +// CHECK: 77:35: CompoundStmt= Extent=[77:35 - 79:4] +// CHECK: 78:5: ReturnStmt= Extent=[78:5 - 78:56] +// CHECK: 78:12: CallExpr= Extent=[78:12 - 78:56] +// CHECK: 78:12: UnexposedExpr=StringRef:49:3 Extent=[78:12 - 78:56] +// CHECK: 78:12: CallExpr=StringRef:49:3 Extent=[78:12 - 78:56] +// CHECK: 78:28: CallExpr=getNameStart:68:15 Extent=[78:28 - 78:42] +// CHECK: 78:28: MemberRefExpr=getNameStart:68:15 Extent=[78:28 - 78:40] +// CHECK: 78:44: UnexposedExpr=getLength:72:12 Extent=[78:44 - 78:55] +// CHECK: 78:44: CallExpr=getLength:72:12 Extent=[78:44 - 78:55] +// CHECK: 78:44: MemberRefExpr=getLength:72:12 Extent=[78:44 - 78:53] +// CHECK: 82:11: Namespace=llvm:82:11 (Definition) Extent=[82:1 - 96:2] +// CHECK: 83:47: ClassTemplate=StringSwitch:83:47 (Definition) Extent=[83:1 - 95:2] +// CHECK: 83:21: TemplateTypeParameter=T:83:21 (Definition) Extent=[83:12 - 83:22] +// CHECK: 83:33: TemplateTypeParameter=R:83:33 (Definition) Extent=[83:24 - 83:38] +// CHECK: 84:13: FieldDecl=Str:84:13 (Definition) Extent=[84:3 - 84:16] +// CHECK: 84:3: TypeRef=class llvm::StringRef:38:7 Extent=[84:3 - 84:12] +// CHECK: 85:12: FieldDecl=Result:85:12 (Definition) Extent=[85:3 - 85:18] +// CHECK: 86:1: CXXAccessSpecifier=:86:1 (Definition) Extent=[86:1 - 86:8] +// CHECK: 87:12: CXXConstructor=StringSwitch<T, R>:87:12 (Definition) Extent=[87:3 - 87:64] +// CHECK: 87:35: ParmDecl=Str:87:35 (Definition) Extent=[87:25 - 87:38] +// CHECK: 87:25: TypeRef=class llvm::StringRef:38:7 Extent=[87:25 - 87:34] +// CHECK: 87:42: MemberRef=Str:84:13 Extent=[87:42 - 87:45] +// CHECK: 87:45: UnexposedExpr= Extent=[87:45 - 87:50] +// CHECK: 87:46: DeclRefExpr=Str:87:35 Extent=[87:46 - 87:49] +// CHECK: 87:52: MemberRef=Result:85:12 Extent=[87:52 - 87:58] +// CHECK: 87:58: UnexposedExpr= Extent=[87:58 - 87:61] +// CHECK: 87:59: IntegerLiteral= Extent=[87:59 - 87:60] +// CHECK: 87:62: CompoundStmt= Extent=[87:62 - 87:64] +// CHECK: 88:42: FunctionTemplate=Case:88:42 (Definition) Extent=[88:3 - 91:4] +// CHECK: 88:23: NonTypeTemplateParameter=N:88:23 (Definition) Extent=[88:14 - 88:24] +// CHECK: 88:60: ParmDecl=S:88:60 (Definition) Extent=[88:47 - 88:65] +// CHECK: 88:63: DeclRefExpr=N:88:23 Extent=[88:63 - 88:64] +// CHECK: 89:57: ParmDecl=Value:89:57 (Definition) Extent=[89:47 - 89:62] +// CHECK: 89:64: CompoundStmt= Extent=[89:64 - 91:4] +// CHECK: 90:5: ReturnStmt= Extent=[90:5 - 90:17] +// CHECK: 90:12: UnaryOperator= Extent=[90:12 - 90:17] +// CHECK: 90:13: CXXThisExpr= Extent=[90:13 - 90:17] +// CHECK: 92:5: CXXMethod=Default:92:5 (Definition) Extent=[92:3 - 94:4] +// CHECK: 92:23: ParmDecl=Value:92:23 (Definition) Extent=[92:13 - 92:28] +// CHECK: 92:36: CompoundStmt= Extent=[92:36 - 94:4] +// CHECK: 93:5: ReturnStmt= Extent=[93:5 - 93:17] +// CHECK: 93:12: DeclRefExpr=Value:92:23 Extent=[93:12 - 93:17] +// CHECK: 98:17: UsingDirective=:98:17 Extent=[98:1 - 98:22] +// CHECK: 98:17: NamespaceRef=clang:10:17 Extent=[98:17 - 98:22] +// CHECK: 100:36: CXXMethod=getKind:100:36 (Definition) (static) Extent=[100:1 - 186:2] +// CHECK: 100:21: TypeRef=class clang::AttributeList:12:9 Extent=[100:21 - 100:34] +// CHECK: 100:67: ParmDecl=Name:100:67 (Definition) Extent=[100:44 - 100:71] +// CHECK: 100:50: TypeRef=class clang::IdentifierInfo:66:7 Extent=[100:50 - 100:64] +// CHECK: 100:73: CompoundStmt= Extent=[100:73 - 186:2] +// CHECK: 101:3: DeclStmt= Extent=[101:3 - 101:46] +// CHECK: 101:19: VarDecl=AttrName:101:19 (Definition) Extent=[101:3 - 101:45] +// CHECK: 101:30: CallExpr= Extent=[101:30 - 101:45] +// CHECK: 101:30: UnexposedExpr=getName:77:19 Extent=[101:30 - 101:45] +// CHECK: 101:30: CallExpr=getName:77:19 Extent=[101:30 - 101:45] +// CHECK: 101:36: MemberRefExpr=getName:77:19 SingleRefName=[101:36 - 101:43] RefName=[101:36 - 101:43] Extent=[101:30 - 101:43] +// CHECK: 101:30: DeclRefExpr=Name:100:67 Extent=[101:30 - 101:34] +// CHECK: 102:3: IfStmt= Extent=[102:3 - 103:55] +// CHECK: 102:7: BinaryOperator= Extent=[102:7 - 102:59] +// CHECK: 102:7: CallExpr=startswith:52:8 Extent=[102:7 - 102:32] +// CHECK: 102:16: MemberRefExpr=startswith:52:8 SingleRefName=[102:16 - 102:26] RefName=[102:16 - 102:26] Extent=[102:7 - 102:26] +// CHECK: 102:7: UnexposedExpr=AttrName:101:19 Extent=[102:7 - 102:15] +// CHECK: 102:7: DeclRefExpr=AttrName:101:19 Extent=[102:7 - 102:15] +// CHECK: 102:27: CallExpr= Extent=[102:27 - 102:31] +// CHECK: 102:27: UnexposedExpr=StringRef:48:3 Extent=[102:27 - 102:31] +// CHECK: 102:27: UnexposedExpr=StringRef:48:3 Extent=[102:27 - 102:31] +// CHECK: 102:27: CallExpr=StringRef:48:3 Extent=[102:27 - 102:31] +// CHECK: 102:27: UnexposedExpr= Extent=[102:27 - 102:31] +// CHECK: 102:27: StringLiteral= Extent=[102:27 - 102:31] +// CHECK: 102:36: CallExpr=endswith:56:8 Extent=[102:36 - 102:59] +// CHECK: 102:45: MemberRefExpr=endswith:56:8 SingleRefName=[102:45 - 102:53] RefName=[102:45 - 102:53] Extent=[102:36 - 102:53] +// CHECK: 102:36: UnexposedExpr=AttrName:101:19 Extent=[102:36 - 102:44] +// CHECK: 102:36: DeclRefExpr=AttrName:101:19 Extent=[102:36 - 102:44] +// CHECK: 102:54: CallExpr= Extent=[102:54 - 102:58] +// CHECK: 102:54: UnexposedExpr=StringRef:48:3 Extent=[102:54 - 102:58] +// CHECK: 102:54: UnexposedExpr=StringRef:48:3 Extent=[102:54 - 102:58] +// CHECK: 102:54: CallExpr=StringRef:48:3 Extent=[102:54 - 102:58] +// CHECK: 102:54: UnexposedExpr= Extent=[102:54 - 102:58] +// CHECK: 102:54: StringLiteral= Extent=[102:54 - 102:58] +// CHECK: 103:5: CallExpr=operator=:38:7 Extent=[103:5 - 103:55] +// CHECK: 103:5: DeclRefExpr=AttrName:101:19 Extent=[103:5 - 103:13] +// CHECK: 103:14: UnexposedExpr=operator=:38:7 +// CHECK: 103:14: DeclRefExpr=operator=:38:7 +// CHECK: 103:16: UnexposedExpr=substr:60:13 Extent=[103:16 - 103:55] +// CHECK: 103:16: CallExpr=substr:60:13 Extent=[103:16 - 103:55] +// CHECK: 103:25: MemberRefExpr=substr:60:13 SingleRefName=[103:25 - 103:31] RefName=[103:25 - 103:31] Extent=[103:16 - 103:31] +// CHECK: 103:16: UnexposedExpr=AttrName:101:19 Extent=[103:16 - 103:24] +// CHECK: 103:16: DeclRefExpr=AttrName:101:19 Extent=[103:16 - 103:24] +// CHECK: 103:32: UnexposedExpr= Extent=[103:32 - 103:33] +// CHECK: 103:32: IntegerLiteral= Extent=[103:32 - 103:33] +// CHECK: 103:35: BinaryOperator= Extent=[103:35 - 103:54] +// CHECK: 103:35: CallExpr=size:51:10 Extent=[103:35 - 103:50] +// CHECK: 103:44: MemberRefExpr=size:51:10 SingleRefName=[103:44 - 103:48] RefName=[103:44 - 103:48] Extent=[103:35 - 103:48] +// CHECK: 103:35: UnexposedExpr=AttrName:101:19 Extent=[103:35 - 103:43] +// CHECK: 103:35: DeclRefExpr=AttrName:101:19 Extent=[103:35 - 103:43] +// CHECK: 103:53: UnexposedExpr= Extent=[103:53 - 103:54] +// CHECK: 103:53: IntegerLiteral= Extent=[103:53 - 103:54] +// CHECK: 105:3: ReturnStmt= Extent=[105:3 - 185:31] +// CHECK: 105:10: CallExpr=Default:92:5 Extent=[105:10 - 185:31] +// CHECK: 185:6: MemberRefExpr=Default:92:5 SingleRefName=[185:6 - 185:13] RefName=[185:6 - 185:13] Extent=[105:10 - 185:13] +// CHECK: 105:10: UnexposedExpr=Case:88:42 Extent=[105:10 - 184:33] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 184:33] +// CHECK: 184:6: MemberRefExpr=Case:88:42 SingleRefName=[184:6 - 184:10] RefName=[184:6 - 184:10] Extent=[105:10 - 184:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 183:37] +// CHECK: 183:6: MemberRefExpr=Case:88:42 SingleRefName=[183:6 - 183:10] RefName=[183:6 - 183:10] Extent=[105:10 - 183:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 182:37] +// CHECK: 182:6: MemberRefExpr=Case:88:42 SingleRefName=[182:6 - 182:10] RefName=[182:6 - 182:10] Extent=[105:10 - 182:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 181:35] +// CHECK: 181:6: MemberRefExpr=Case:88:42 SingleRefName=[181:6 - 181:10] RefName=[181:6 - 181:10] Extent=[105:10 - 181:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 180:31] +// CHECK: 180:6: MemberRefExpr=Case:88:42 SingleRefName=[180:6 - 180:10] RefName=[180:6 - 180:10] Extent=[105:10 - 180:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 179:31] +// CHECK: 179:6: MemberRefExpr=Case:88:42 SingleRefName=[179:6 - 179:10] RefName=[179:6 - 179:10] Extent=[105:10 - 179:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 178:35] +// CHECK: 178:6: MemberRefExpr=Case:88:42 SingleRefName=[178:6 - 178:10] RefName=[178:6 - 178:10] Extent=[105:10 - 178:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 177:63] +// CHECK: 177:6: MemberRefExpr=Case:88:42 SingleRefName=[177:6 - 177:10] RefName=[177:6 - 177:10] Extent=[105:10 - 177:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 176:45] +// CHECK: 176:6: MemberRefExpr=Case:88:42 SingleRefName=[176:6 - 176:10] RefName=[176:6 - 176:10] Extent=[105:10 - 176:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 175:51] +// CHECK: 175:6: MemberRefExpr=Case:88:42 SingleRefName=[175:6 - 175:10] RefName=[175:6 - 175:10] Extent=[105:10 - 175:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 174:49] +// CHECK: 174:6: MemberRefExpr=Case:88:42 SingleRefName=[174:6 - 174:10] RefName=[174:6 - 174:10] Extent=[105:10 - 174:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 173:49] +// CHECK: 173:6: MemberRefExpr=Case:88:42 SingleRefName=[173:6 - 173:10] RefName=[173:6 - 173:10] Extent=[105:10 - 173:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 172:53] +// CHECK: 172:6: MemberRefExpr=Case:88:42 SingleRefName=[172:6 - 172:10] RefName=[172:6 - 172:10] Extent=[105:10 - 172:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 171:57] +// CHECK: 171:6: MemberRefExpr=Case:88:42 SingleRefName=[171:6 - 171:10] RefName=[171:6 - 171:10] Extent=[105:10 - 171:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 170:65] +// CHECK: 170:6: MemberRefExpr=Case:88:42 SingleRefName=[170:6 - 170:10] RefName=[170:6 - 170:10] Extent=[105:10 - 170:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 169:57] +// CHECK: 169:6: MemberRefExpr=Case:88:42 SingleRefName=[169:6 - 169:10] RefName=[169:6 - 169:10] Extent=[105:10 - 169:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 168:65] +// CHECK: 168:6: MemberRefExpr=Case:88:42 SingleRefName=[168:6 - 168:10] RefName=[168:6 - 168:10] Extent=[105:10 - 168:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 167:55] +// CHECK: 167:6: MemberRefExpr=Case:88:42 SingleRefName=[167:6 - 167:10] RefName=[167:6 - 167:10] Extent=[105:10 - 167:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 166:55] +// CHECK: 166:6: MemberRefExpr=Case:88:42 SingleRefName=[166:6 - 166:10] RefName=[166:6 - 166:10] Extent=[105:10 - 166:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 165:53] +// CHECK: 165:6: MemberRefExpr=Case:88:42 SingleRefName=[165:6 - 165:10] RefName=[165:6 - 165:10] Extent=[105:10 - 165:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 164:53] +// CHECK: 164:6: MemberRefExpr=Case:88:42 SingleRefName=[164:6 - 164:10] RefName=[164:6 - 164:10] Extent=[105:10 - 164:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 163:49] +// CHECK: 163:6: MemberRefExpr=Case:88:42 SingleRefName=[163:6 - 163:10] RefName=[163:6 - 163:10] Extent=[105:10 - 163:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 162:47] +// CHECK: 162:6: MemberRefExpr=Case:88:42 SingleRefName=[162:6 - 162:10] RefName=[162:6 - 162:10] Extent=[105:10 - 162:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 161:45] +// CHECK: 161:6: MemberRefExpr=Case:88:42 SingleRefName=[161:6 - 161:10] RefName=[161:6 - 161:10] Extent=[105:10 - 161:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 160:45] +// CHECK: 160:6: MemberRefExpr=Case:88:42 SingleRefName=[160:6 - 160:10] RefName=[160:6 - 160:10] Extent=[105:10 - 160:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 159:45] +// CHECK: 159:6: MemberRefExpr=Case:88:42 SingleRefName=[159:6 - 159:10] RefName=[159:6 - 159:10] Extent=[105:10 - 159:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 158:45] +// CHECK: 158:6: MemberRefExpr=Case:88:42 SingleRefName=[158:6 - 158:10] RefName=[158:6 - 158:10] Extent=[105:10 - 158:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 157:43] +// CHECK: 157:6: MemberRefExpr=Case:88:42 SingleRefName=[157:6 - 157:10] RefName=[157:6 - 157:10] Extent=[105:10 - 157:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 156:41] +// CHECK: 156:6: MemberRefExpr=Case:88:42 SingleRefName=[156:6 - 156:10] RefName=[156:6 - 156:10] Extent=[105:10 - 156:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 155:41] +// CHECK: 155:6: MemberRefExpr=Case:88:42 SingleRefName=[155:6 - 155:10] RefName=[155:6 - 155:10] Extent=[105:10 - 155:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 154:41] +// CHECK: 154:6: MemberRefExpr=Case:88:42 SingleRefName=[154:6 - 154:10] RefName=[154:6 - 154:10] Extent=[105:10 - 154:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 153:37] +// CHECK: 153:6: MemberRefExpr=Case:88:42 SingleRefName=[153:6 - 153:10] RefName=[153:6 - 153:10] Extent=[105:10 - 153:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 152:41] +// CHECK: 152:6: MemberRefExpr=Case:88:42 SingleRefName=[152:6 - 152:10] RefName=[152:6 - 152:10] Extent=[105:10 - 152:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 151:39] +// CHECK: 151:6: MemberRefExpr=Case:88:42 SingleRefName=[151:6 - 151:10] RefName=[151:6 - 151:10] Extent=[105:10 - 151:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 150:39] +// CHECK: 150:6: MemberRefExpr=Case:88:42 SingleRefName=[150:6 - 150:10] RefName=[150:6 - 150:10] Extent=[105:10 - 150:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 149:39] +// CHECK: 149:6: MemberRefExpr=Case:88:42 SingleRefName=[149:6 - 149:10] RefName=[149:6 - 149:10] Extent=[105:10 - 149:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 148:39] +// CHECK: 148:6: MemberRefExpr=Case:88:42 SingleRefName=[148:6 - 148:10] RefName=[148:6 - 148:10] Extent=[105:10 - 148:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 147:39] +// CHECK: 147:6: MemberRefExpr=Case:88:42 SingleRefName=[147:6 - 147:10] RefName=[147:6 - 147:10] Extent=[105:10 - 147:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 146:39] +// CHECK: 146:6: MemberRefExpr=Case:88:42 SingleRefName=[146:6 - 146:10] RefName=[146:6 - 146:10] Extent=[105:10 - 146:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 145:41] +// CHECK: 145:6: MemberRefExpr=Case:88:42 SingleRefName=[145:6 - 145:10] RefName=[145:6 - 145:10] Extent=[105:10 - 145:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 144:37] +// CHECK: 144:6: MemberRefExpr=Case:88:42 SingleRefName=[144:6 - 144:10] RefName=[144:6 - 144:10] Extent=[105:10 - 144:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 143:37] +// CHECK: 143:6: MemberRefExpr=Case:88:42 SingleRefName=[143:6 - 143:10] RefName=[143:6 - 143:10] Extent=[105:10 - 143:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 142:35] +// CHECK: 142:6: MemberRefExpr=Case:88:42 SingleRefName=[142:6 - 142:10] RefName=[142:6 - 142:10] Extent=[105:10 - 142:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 141:35] +// CHECK: 141:6: MemberRefExpr=Case:88:42 SingleRefName=[141:6 - 141:10] RefName=[141:6 - 141:10] Extent=[105:10 - 141:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 140:35] +// CHECK: 140:6: MemberRefExpr=Case:88:42 SingleRefName=[140:6 - 140:10] RefName=[140:6 - 140:10] Extent=[105:10 - 140:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 139:35] +// CHECK: 139:6: MemberRefExpr=Case:88:42 SingleRefName=[139:6 - 139:10] RefName=[139:6 - 139:10] Extent=[105:10 - 139:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 138:35] +// CHECK: 138:6: MemberRefExpr=Case:88:42 SingleRefName=[138:6 - 138:10] RefName=[138:6 - 138:10] Extent=[105:10 - 138:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 137:55] +// CHECK: 137:6: MemberRefExpr=Case:88:42 SingleRefName=[137:6 - 137:10] RefName=[137:6 - 137:10] Extent=[105:10 - 137:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 136:35] +// CHECK: 136:6: MemberRefExpr=Case:88:42 SingleRefName=[136:6 - 136:10] RefName=[136:6 - 136:10] Extent=[105:10 - 136:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 135:35] +// CHECK: 135:6: MemberRefExpr=Case:88:42 SingleRefName=[135:6 - 135:10] RefName=[135:6 - 135:10] Extent=[105:10 - 135:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 134:35] +// CHECK: 134:6: MemberRefExpr=Case:88:42 SingleRefName=[134:6 - 134:10] RefName=[134:6 - 134:10] Extent=[105:10 - 134:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 133:35] +// CHECK: 133:6: MemberRefExpr=Case:88:42 SingleRefName=[133:6 - 133:10] RefName=[133:6 - 133:10] Extent=[105:10 - 133:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 132:33] +// CHECK: 132:6: MemberRefExpr=Case:88:42 SingleRefName=[132:6 - 132:10] RefName=[132:6 - 132:10] Extent=[105:10 - 132:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 131:33] +// CHECK: 131:6: MemberRefExpr=Case:88:42 SingleRefName=[131:6 - 131:10] RefName=[131:6 - 131:10] Extent=[105:10 - 131:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 130:33] +// CHECK: 130:6: MemberRefExpr=Case:88:42 SingleRefName=[130:6 - 130:10] RefName=[130:6 - 130:10] Extent=[105:10 - 130:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 129:33] +// CHECK: 129:6: MemberRefExpr=Case:88:42 SingleRefName=[129:6 - 129:10] RefName=[129:6 - 129:10] Extent=[105:10 - 129:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 128:33] +// CHECK: 128:6: MemberRefExpr=Case:88:42 SingleRefName=[128:6 - 128:10] RefName=[128:6 - 128:10] Extent=[105:10 - 128:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 127:33] +// CHECK: 127:6: MemberRefExpr=Case:88:42 SingleRefName=[127:6 - 127:10] RefName=[127:6 - 127:10] Extent=[105:10 - 127:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 126:33] +// CHECK: 126:6: MemberRefExpr=Case:88:42 SingleRefName=[126:6 - 126:10] RefName=[126:6 - 126:10] Extent=[105:10 - 126:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 125:29] +// CHECK: 125:6: MemberRefExpr=Case:88:42 SingleRefName=[125:6 - 125:10] RefName=[125:6 - 125:10] Extent=[105:10 - 125:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 124:33] +// CHECK: 124:6: MemberRefExpr=Case:88:42 SingleRefName=[124:6 - 124:10] RefName=[124:6 - 124:10] Extent=[105:10 - 124:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 123:33] +// CHECK: 123:6: MemberRefExpr=Case:88:42 SingleRefName=[123:6 - 123:10] RefName=[123:6 - 123:10] Extent=[105:10 - 123:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 122:31] +// CHECK: 122:6: MemberRefExpr=Case:88:42 SingleRefName=[122:6 - 122:10] RefName=[122:6 - 122:10] Extent=[105:10 - 122:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 121:31] +// CHECK: 121:6: MemberRefExpr=Case:88:42 SingleRefName=[121:6 - 121:10] RefName=[121:6 - 121:10] Extent=[105:10 - 121:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 120:31] +// CHECK: 120:6: MemberRefExpr=Case:88:42 SingleRefName=[120:6 - 120:10] RefName=[120:6 - 120:10] Extent=[105:10 - 120:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 119:31] +// CHECK: 119:6: MemberRefExpr=Case:88:42 SingleRefName=[119:6 - 119:10] RefName=[119:6 - 119:10] Extent=[105:10 - 119:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 118:31] +// CHECK: 118:6: MemberRefExpr=Case:88:42 SingleRefName=[118:6 - 118:10] RefName=[118:6 - 118:10] Extent=[105:10 - 118:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 117:31] +// CHECK: 117:6: MemberRefExpr=Case:88:42 SingleRefName=[117:6 - 117:10] RefName=[117:6 - 117:10] Extent=[105:10 - 117:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 116:31] +// CHECK: 116:6: MemberRefExpr=Case:88:42 SingleRefName=[116:6 - 116:10] RefName=[116:6 - 116:10] Extent=[105:10 - 116:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 115:29] +// CHECK: 115:6: MemberRefExpr=Case:88:42 SingleRefName=[115:6 - 115:10] RefName=[115:6 - 115:10] Extent=[105:10 - 115:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 114:29] +// CHECK: 114:6: MemberRefExpr=Case:88:42 SingleRefName=[114:6 - 114:10] RefName=[114:6 - 114:10] Extent=[105:10 - 114:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 113:29] +// CHECK: 113:6: MemberRefExpr=Case:88:42 SingleRefName=[113:6 - 113:10] RefName=[113:6 - 113:10] Extent=[105:10 - 113:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 112:31] +// CHECK: 112:6: MemberRefExpr=Case:88:42 SingleRefName=[112:6 - 112:10] RefName=[112:6 - 112:10] Extent=[105:10 - 112:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 111:29] +// CHECK: 111:6: MemberRefExpr=Case:88:42 SingleRefName=[111:6 - 111:10] RefName=[111:6 - 111:10] Extent=[105:10 - 111:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 110:27] +// CHECK: 110:6: MemberRefExpr=Case:88:42 SingleRefName=[110:6 - 110:10] RefName=[110:6 - 110:10] Extent=[105:10 - 110:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 109:27] +// CHECK: 109:6: MemberRefExpr=Case:88:42 SingleRefName=[109:6 - 109:10] RefName=[109:6 - 109:10] Extent=[105:10 - 109:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 108:27] +// CHECK: 108:6: MemberRefExpr=Case:88:42 SingleRefName=[108:6 - 108:10] RefName=[108:6 - 108:10] Extent=[105:10 - 108:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 107:33] +// CHECK: 107:6: MemberRefExpr=Case:88:42 SingleRefName=[107:6 - 107:10] RefName=[107:6 - 107:10] Extent=[105:10 - 107:10] +// CHECK: 105:10: CallExpr=Case:88:42 Extent=[105:10 - 106:27] +// CHECK: 106:6: MemberRefExpr=Case:88:42 SingleRefName=[106:6 - 106:10] RefName=[106:6 - 106:10] Extent=[105:10 - 106:10] +// CHECK: 105:10: CXXFunctionalCastExpr= Extent=[105:10 - 105:63] +// CHECK: 105:16: TemplateRef=StringSwitch:83:47 Extent=[105:16 - 105:28] +// CHECK: 105:10: CallExpr=StringSwitch:87:12 Extent=[105:10 - 105:62] +// CHECK: 105:54: CallExpr=StringRef:38:7 Extent=[105:54 - 105:62] +// CHECK: 105:54: UnexposedExpr=AttrName:101:19 Extent=[105:54 - 105:62] +// CHECK: 105:54: DeclRefExpr=AttrName:101:19 Extent=[105:54 - 105:62] +// CHECK: 106:11: StringLiteral= Extent=[106:11 - 106:17] +// CHECK: 106:19: DeclRefExpr=AT_weak:29:45 Extent=[106:19 - 106:26] +// CHECK: 107:11: StringLiteral= Extent=[107:11 - 107:20] +// CHECK: 107:22: DeclRefExpr=AT_weakref:29:54 Extent=[107:22 - 107:32] +// CHECK: 108:11: StringLiteral= Extent=[108:11 - 108:17] +// CHECK: 108:19: DeclRefExpr=AT_pure:26:49 Extent=[108:19 - 108:26] +// CHECK: 109:11: StringLiteral= Extent=[109:11 - 109:17] +// CHECK: 109:19: DeclRefExpr=AT_mode:20:44 Extent=[109:19 - 109:26] +// CHECK: 110:11: StringLiteral= Extent=[110:11 - 110:17] +// CHECK: 110:19: DeclRefExpr=AT_used:28:34 Extent=[110:19 - 110:26] +// CHECK: 111:11: StringLiteral= Extent=[111:11 - 111:18] +// CHECK: 111:20: DeclRefExpr=AT_alias:15:25 Extent=[111:20 - 111:28] +// CHECK: 112:11: StringLiteral= Extent=[112:11 - 112:18] +// CHECK: 112:20: DeclRefExpr=AT_aligned:15:35 Extent=[112:20 - 112:30] +// CHECK: 113:11: StringLiteral= Extent=[113:11 - 113:18] +// CHECK: 113:20: DeclRefExpr=AT_final:19:40 Extent=[113:20 - 113:28] +// CHECK: 114:11: StringLiteral= Extent=[114:11 - 114:18] +// CHECK: 114:20: DeclRefExpr=AT_cdecl:17:30 Extent=[114:20 - 114:28] +// CHECK: 115:11: StringLiteral= Extent=[115:11 - 115:18] +// CHECK: 115:20: DeclRefExpr=AT_const:17:52 Extent=[115:20 - 115:28] +// CHECK: 116:11: StringLiteral= Extent=[116:11 - 116:20] +// CHECK: 116:22: DeclRefExpr=AT_const:17:52 Extent=[116:22 - 116:30] +// CHECK: 117:11: StringLiteral= Extent=[117:11 - 117:19] +// CHECK: 117:21: DeclRefExpr=AT_blocks:16:57 Extent=[117:21 - 117:30] +// CHECK: 118:11: StringLiteral= Extent=[118:11 - 118:19] +// CHECK: 118:21: DeclRefExpr=AT_format:19:50 Extent=[118:21 - 118:30] +// CHECK: 119:11: StringLiteral= Extent=[119:11 - 119:19] +// CHECK: 119:21: DeclRefExpr=AT_hiding:20:22 Extent=[119:21 - 119:30] +// CHECK: 120:11: StringLiteral= Extent=[120:11 - 120:19] +// CHECK: 120:21: DeclRefExpr=AT_malloc:20:33 Extent=[120:21 - 120:30] +// CHECK: 121:11: StringLiteral= Extent=[121:11 - 121:19] +// CHECK: 121:21: DeclRefExpr=AT_packed:26:27 Extent=[121:21 - 121:30] +// CHECK: 122:11: StringLiteral= Extent=[122:11 - 122:19] +// CHECK: 122:21: DeclRefExpr=AT_unused:28:23 Extent=[122:21 - 122:30] +// CHECK: 123:11: StringLiteral= Extent=[123:11 - 123:20] +// CHECK: 123:22: DeclRefExpr=AT_aligned:15:35 Extent=[123:22 - 123:32] +// CHECK: 124:11: StringLiteral= Extent=[124:11 - 124:20] +// CHECK: 124:22: DeclRefExpr=AT_cleanup:17:40 Extent=[124:22 - 124:32] +// CHECK: 125:11: StringLiteral= Extent=[125:11 - 125:18] +// CHECK: 125:20: DeclRefExpr=AT_naked:20:53 Extent=[125:20 - 125:28] +// CHECK: 126:11: StringLiteral= Extent=[126:11 - 126:20] +// CHECK: 126:22: DeclRefExpr=AT_nodebug:20:63 Extent=[126:22 - 126:32] +// CHECK: 127:11: StringLiteral= Extent=[127:11 - 127:20] +// CHECK: 127:22: DeclRefExpr=AT_nonnull:21:47 Extent=[127:22 - 127:32] +// CHECK: 128:11: StringLiteral= Extent=[128:11 - 128:20] +// CHECK: 128:22: DeclRefExpr=AT_nothrow:22:7 Extent=[128:22 - 128:32] +// CHECK: 129:11: StringLiteral= Extent=[129:11 - 129:20] +// CHECK: 129:22: DeclRefExpr=AT_objc_gc:24:59 Extent=[129:22 - 129:32] +// CHECK: 130:11: StringLiteral= Extent=[130:11 - 130:20] +// CHECK: 130:22: DeclRefExpr=AT_regparm:26:58 Extent=[130:22 - 130:32] +// CHECK: 131:11: StringLiteral= Extent=[131:11 - 131:20] +// CHECK: 131:22: DeclRefExpr=AT_section:27:7 Extent=[131:22 - 131:32] +// CHECK: 132:11: StringLiteral= Extent=[132:11 - 132:20] +// CHECK: 132:22: DeclRefExpr=AT_stdcall:27:32 Extent=[132:22 - 132:32] +// CHECK: 133:11: StringLiteral= Extent=[133:11 - 133:21] +// CHECK: 133:23: DeclRefExpr=AT_annotate:16:29 Extent=[133:23 - 133:34] +// CHECK: 134:11: StringLiteral= Extent=[134:11 - 134:21] +// CHECK: 134:23: DeclRefExpr=AT_fastcall:19:27 Extent=[134:23 - 134:34] +// CHECK: 135:11: StringLiteral= Extent=[135:11 - 135:21] +// CHECK: 135:23: DeclRefExpr=AT_IBAction:14:7 Extent=[135:23 - 135:34] +// CHECK: 136:11: StringLiteral= Extent=[136:11 - 136:21] +// CHECK: 136:23: DeclRefExpr=AT_IBOutlet:14:20 Extent=[136:23 - 136:34] +// CHECK: 137:11: StringLiteral= Extent=[137:11 - 137:31] +// CHECK: 137:33: DeclRefExpr=AT_IBOutletCollection:14:33 Extent=[137:33 - 137:54] +// CHECK: 138:11: StringLiteral= Extent=[138:11 - 138:21] +// CHECK: 138:23: DeclRefExpr=AT_noreturn:21:59 Extent=[138:23 - 138:34] +// CHECK: 139:11: StringLiteral= Extent=[139:11 - 139:21] +// CHECK: 139:23: DeclRefExpr=AT_noinline:21:7 Extent=[139:23 - 139:34] +// CHECK: 140:11: StringLiteral= Extent=[140:11 - 140:21] +// CHECK: 140:23: DeclRefExpr=AT_override:22:51 Extent=[140:23 - 140:34] +// CHECK: 141:11: StringLiteral= Extent=[141:11 - 141:21] +// CHECK: 141:23: DeclRefExpr=AT_sentinel:27:19 Extent=[141:23 - 141:34] +// CHECK: 142:11: StringLiteral= Extent=[142:11 - 142:21] +// CHECK: 142:23: DeclRefExpr=AT_nsobject:22:19 Extent=[142:23 - 142:34] +// CHECK: 143:11: StringLiteral= Extent=[143:11 - 143:22] +// CHECK: 143:24: DeclRefExpr=AT_dllimport:18:51 Extent=[143:24 - 143:36] +// CHECK: 144:11: StringLiteral= Extent=[144:11 - 144:22] +// CHECK: 144:24: DeclRefExpr=AT_dllexport:18:37 Extent=[144:24 - 144:36] +// CHECK: 145:11: StringLiteral= Extent=[145:11 - 145:22] +// CHECK: 146:11: StringLiteral= Extent=[146:11 - 146:23] +// CHECK: 146:25: DeclRefExpr=AT_base_check:16:42 Extent=[146:25 - 146:38] +// CHECK: 147:11: StringLiteral= Extent=[147:11 - 147:23] +// CHECK: 147:25: DeclRefExpr=AT_deprecated:18:7 Extent=[147:25 - 147:38] +// CHECK: 148:11: StringLiteral= Extent=[148:11 - 148:23] +// CHECK: 148:25: DeclRefExpr=AT_visibility:29:7 Extent=[148:25 - 148:38] +// CHECK: 149:11: StringLiteral= Extent=[149:11 - 149:23] +// CHECK: 149:25: DeclRefExpr=AT_destructor:18:22 Extent=[149:25 - 149:38] +// CHECK: 150:11: StringLiteral= Extent=[150:11 - 150:23] +// CHECK: 150:25: DeclRefExpr=AT_format_arg:19:61 Extent=[150:25 - 150:38] +// CHECK: 151:11: StringLiteral= Extent=[151:11 - 151:23] +// CHECK: 151:25: DeclRefExpr=AT_gnu_inline:20:7 Extent=[151:25 - 151:38] +// CHECK: 152:11: StringLiteral= Extent=[152:11 - 152:24] +// CHECK: 152:26: DeclRefExpr=AT_weak_import:30:7 Extent=[152:26 - 152:40] +// CHECK: 153:11: StringLiteral= Extent=[153:11 - 153:22] +// CHECK: 153:24: DeclRefExpr=AT_vecreturn:28:43 Extent=[153:24 - 153:36] +// CHECK: 154:11: StringLiteral= Extent=[154:11 - 154:24] +// CHECK: 154:26: DeclRefExpr=AT_vector_size:28:57 Extent=[154:26 - 154:40] +// CHECK: 155:11: StringLiteral= Extent=[155:11 - 155:24] +// CHECK: 155:26: DeclRefExpr=AT_constructor:17:62 Extent=[155:26 - 155:40] +// CHECK: 156:11: StringLiteral= Extent=[156:11 - 156:24] +// CHECK: 156:26: DeclRefExpr=AT_unavailable:28:7 Extent=[156:26 - 156:40] +// CHECK: 157:11: StringLiteral= Extent=[157:11 - 157:25] +// CHECK: 157:27: DeclRefExpr=AT_overloadable:25:7 Extent=[157:27 - 157:42] +// CHECK: 158:11: StringLiteral= Extent=[158:11 - 158:26] +// CHECK: 158:28: DeclRefExpr=AT_address_space:15:7 Extent=[158:28 - 158:44] +// CHECK: 159:11: StringLiteral= Extent=[159:11 - 159:26] +// CHECK: 159:28: DeclRefExpr=AT_always_inline:15:47 Extent=[159:28 - 159:44] +// CHECK: 160:11: StringLiteral= Extent=[160:11 - 160:26] +// CHECK: 161:11: StringLiteral= Extent=[161:11 - 161:26] +// CHECK: 162:11: StringLiteral= Extent=[162:11 - 162:27] +// CHECK: 162:29: DeclRefExpr=AT_objc_exception:22:32 Extent=[162:29 - 162:46] +// CHECK: 163:11: StringLiteral= Extent=[163:11 - 163:28] +// CHECK: 163:30: DeclRefExpr=AT_ext_vector_type:19:7 Extent=[163:30 - 163:48] +// CHECK: 164:11: StringLiteral= Extent=[164:11 - 164:30] +// CHECK: 164:32: DeclRefExpr=AT_transparent_union:27:57 Extent=[164:32 - 164:52] +// CHECK: 165:11: StringLiteral= Extent=[165:11 - 165:30] +// CHECK: 165:32: DeclRefExpr=AT_analyzer_noreturn:16:7 Extent=[165:32 - 165:52] +// CHECK: 166:11: StringLiteral= Extent=[166:11 - 166:31] +// CHECK: 166:33: DeclRefExpr=AT_warn_unused_result:29:22 Extent=[166:33 - 166:54] +// CHECK: 167:11: StringLiteral= Extent=[167:11 - 167:31] +// CHECK: 167:33: DeclRefExpr=AT_carries_dependency:17:7 Extent=[167:33 - 167:54] +// CHECK: 168:11: StringLiteral= Extent=[168:11 - 168:36] +// CHECK: 168:38: DeclRefExpr=AT_ns_returns_not_retained:24:7 Extent=[168:38 - 168:64] +// CHECK: 169:11: StringLiteral= Extent=[169:11 - 169:32] +// CHECK: 169:34: DeclRefExpr=AT_ns_returns_retained:24:35 Extent=[169:34 - 169:56] +// CHECK: 170:11: StringLiteral= Extent=[170:11 - 170:36] +// CHECK: 170:38: DeclRefExpr=AT_cf_returns_not_retained:23:7 Extent=[170:38 - 170:64] +// CHECK: 171:11: StringLiteral= Extent=[171:11 - 171:32] +// CHECK: 171:34: DeclRefExpr=AT_cf_returns_retained:23:35 Extent=[171:34 - 171:56] +// CHECK: 172:11: StringLiteral= Extent=[172:11 - 172:30] +// CHECK: 172:32: DeclRefExpr=AT_ownership_returns:25:44 Extent=[172:32 - 172:52] +// CHECK: 173:11: StringLiteral= Extent=[173:11 - 173:28] +// CHECK: 173:30: DeclRefExpr=AT_ownership_holds:25:24 Extent=[173:30 - 173:48] +// CHECK: 174:11: StringLiteral= Extent=[174:11 - 174:28] +// CHECK: 174:30: DeclRefExpr=AT_ownership_takes:26:7 Extent=[174:30 - 174:48] +// CHECK: 175:11: StringLiteral= Extent=[175:11 - 175:33] +// CHECK: 175:35: DeclRefExpr=AT_reqd_wg_size:30:23 Extent=[175:35 - 175:50] +// CHECK: 176:11: StringLiteral= Extent=[176:11 - 176:26] +// CHECK: 176:28: DeclRefExpr=AT_init_priority:30:40 Extent=[176:28 - 176:44] +// CHECK: 177:11: StringLiteral= Extent=[177:11 - 177:35] +// CHECK: 177:37: DeclRefExpr=AT_no_instrument_function:21:20 Extent=[177:37 - 177:62] +// CHECK: 178:11: StringLiteral= Extent=[178:11 - 178:21] +// CHECK: 178:23: DeclRefExpr=AT_thiscall:27:44 Extent=[178:23 - 178:34] +// CHECK: 179:11: StringLiteral= Extent=[179:11 - 179:19] +// CHECK: 179:21: DeclRefExpr=AT_pascal:26:38 Extent=[179:21 - 179:30] +// CHECK: 180:11: StringLiteral= Extent=[180:11 - 180:20] +// CHECK: 180:22: DeclRefExpr=AT_cdecl:17:30 Extent=[180:22 - 180:30] +// CHECK: 181:11: StringLiteral= Extent=[181:11 - 181:22] +// CHECK: 181:24: DeclRefExpr=AT_stdcall:27:32 Extent=[181:24 - 181:34] +// CHECK: 182:11: StringLiteral= Extent=[182:11 - 182:23] +// CHECK: 182:25: DeclRefExpr=AT_fastcall:19:27 Extent=[182:25 - 182:36] +// CHECK: 183:11: StringLiteral= Extent=[183:11 - 183:23] +// CHECK: 183:25: DeclRefExpr=AT_thiscall:27:44 Extent=[183:25 - 183:36] +// CHECK: 184:11: StringLiteral= Extent=[184:11 - 184:21] +// CHECK: 184:23: DeclRefExpr=AT_pascal:26:38 Extent=[184:23 - 184:32] + diff --git a/clang/test/Index/recursive-member-access.c b/clang/test/Index/recursive-member-access.c new file mode 100644 index 0000000..6a19f57 --- /dev/null +++ b/clang/test/Index/recursive-member-access.c @@ -0,0 +1,532 @@ +struct rdar8650865 { + struct rdar8650865 *first; + int x; +}; + +int test_rdar8650865(struct rdar8650865 *s) { + return ((((((s->first)->first) + ->first) + ->first) + ->first) + ->first) + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->first + ->x; +} + +// RUN: c-index-test -test-load-source all %s | FileCheck %s +// CHECK: 1:8: StructDecl=rdar8650865:1:8 (Definition) Extent=[1:1 - 4:2] +// CHECK: 2:23: FieldDecl=first:2:23 (Definition) Extent=[2:3 - 2:28] +// CHECK: 2:10: TypeRef=struct rdar8650865:1:8 Extent=[2:10 - 2:21] +// CHECK: 3:7: FieldDecl=x:3:7 (Definition) Extent=[3:3 - 3:8] +// CHECK: 6:5: FunctionDecl=test_rdar8650865:6:5 (Definition) Extent=[6:1 - 124:2] +// CHECK: 6:42: ParmDecl=s:6:42 (Definition) Extent=[6:22 - 6:43] +// CHECK: 6:29: TypeRef=struct rdar8650865:1:8 Extent=[6:29 - 6:40] +// CHECK: 6:45: CompoundStmt= Extent=[6:45 - 124:2] +// CHECK: 7:3: ReturnStmt= Extent=[7:3 - 123:8] +// CHECK: 123:7: MemberRefExpr=x:3:7 SingleRefName=[123:7 - 123:8] RefName=[123:7 - 123:8] Extent=[7:10 - 123:8] +// CHECK: 122:7: MemberRefExpr=first:2:23 SingleRefName=[122:7 - 122:12] RefName=[122:7 - 122:12] Extent=[7:10 - 122:12] +// CHECK: 121:7: MemberRefExpr=first:2:23 SingleRefName=[121:7 - 121:12] RefName=[121:7 - 121:12] Extent=[7:10 - 121:12] +// CHECK: 120:7: MemberRefExpr=first:2:23 SingleRefName=[120:7 - 120:12] RefName=[120:7 - 120:12] Extent=[7:10 - 120:12] +// CHECK: 119:7: MemberRefExpr=first:2:23 SingleRefName=[119:7 - 119:12] RefName=[119:7 - 119:12] Extent=[7:10 - 119:12] +// CHECK: 118:7: MemberRefExpr=first:2:23 SingleRefName=[118:7 - 118:12] RefName=[118:7 - 118:12] Extent=[7:10 - 118:12] +// CHECK: 117:7: MemberRefExpr=first:2:23 SingleRefName=[117:7 - 117:12] RefName=[117:7 - 117:12] Extent=[7:10 - 117:12] +// CHECK: 116:7: MemberRefExpr=first:2:23 SingleRefName=[116:7 - 116:12] RefName=[116:7 - 116:12] Extent=[7:10 - 116:12] +// CHECK: 115:7: MemberRefExpr=first:2:23 SingleRefName=[115:7 - 115:12] RefName=[115:7 - 115:12] Extent=[7:10 - 115:12] +// CHECK: 114:7: MemberRefExpr=first:2:23 SingleRefName=[114:7 - 114:12] RefName=[114:7 - 114:12] Extent=[7:10 - 114:12] +// CHECK: 113:7: MemberRefExpr=first:2:23 SingleRefName=[113:7 - 113:12] RefName=[113:7 - 113:12] Extent=[7:10 - 113:12] +// CHECK: 112:7: MemberRefExpr=first:2:23 SingleRefName=[112:7 - 112:12] RefName=[112:7 - 112:12] Extent=[7:10 - 112:12] +// CHECK: 111:7: MemberRefExpr=first:2:23 SingleRefName=[111:7 - 111:12] RefName=[111:7 - 111:12] Extent=[7:10 - 111:12] +// CHECK: 110:7: MemberRefExpr=first:2:23 SingleRefName=[110:7 - 110:12] RefName=[110:7 - 110:12] Extent=[7:10 - 110:12] +// CHECK: 109:7: MemberRefExpr=first:2:23 SingleRefName=[109:7 - 109:12] RefName=[109:7 - 109:12] Extent=[7:10 - 109:12] +// CHECK: 108:7: MemberRefExpr=first:2:23 SingleRefName=[108:7 - 108:12] RefName=[108:7 - 108:12] Extent=[7:10 - 108:12] +// CHECK: 107:7: MemberRefExpr=first:2:23 SingleRefName=[107:7 - 107:12] RefName=[107:7 - 107:12] Extent=[7:10 - 107:12] +// CHECK: 106:7: MemberRefExpr=first:2:23 SingleRefName=[106:7 - 106:12] RefName=[106:7 - 106:12] Extent=[7:10 - 106:12] +// CHECK: 105:7: MemberRefExpr=first:2:23 SingleRefName=[105:7 - 105:12] RefName=[105:7 - 105:12] Extent=[7:10 - 105:12] +// CHECK: 104:7: MemberRefExpr=first:2:23 SingleRefName=[104:7 - 104:12] RefName=[104:7 - 104:12] Extent=[7:10 - 104:12] +// CHECK: 103:7: MemberRefExpr=first:2:23 SingleRefName=[103:7 - 103:12] RefName=[103:7 - 103:12] Extent=[7:10 - 103:12] +// CHECK: 102:7: MemberRefExpr=first:2:23 SingleRefName=[102:7 - 102:12] RefName=[102:7 - 102:12] Extent=[7:10 - 102:12] +// CHECK: 101:7: MemberRefExpr=first:2:23 SingleRefName=[101:7 - 101:12] RefName=[101:7 - 101:12] Extent=[7:10 - 101:12] +// CHECK: 100:7: MemberRefExpr=first:2:23 SingleRefName=[100:7 - 100:12] RefName=[100:7 - 100:12] Extent=[7:10 - 100:12] +// CHECK: 99:7: MemberRefExpr=first:2:23 SingleRefName=[99:7 - 99:12] RefName=[99:7 - 99:12] Extent=[7:10 - 99:12] +// CHECK: 98:7: MemberRefExpr=first:2:23 SingleRefName=[98:7 - 98:12] RefName=[98:7 - 98:12] Extent=[7:10 - 98:12] +// CHECK: 97:7: MemberRefExpr=first:2:23 SingleRefName=[97:7 - 97:12] RefName=[97:7 - 97:12] Extent=[7:10 - 97:12] +// CHECK: 96:7: MemberRefExpr=first:2:23 SingleRefName=[96:7 - 96:12] RefName=[96:7 - 96:12] Extent=[7:10 - 96:12] +// CHECK: 95:7: MemberRefExpr=first:2:23 SingleRefName=[95:7 - 95:12] RefName=[95:7 - 95:12] Extent=[7:10 - 95:12] +// CHECK: 94:7: MemberRefExpr=first:2:23 SingleRefName=[94:7 - 94:12] RefName=[94:7 - 94:12] Extent=[7:10 - 94:12] +// CHECK: 93:7: MemberRefExpr=first:2:23 SingleRefName=[93:7 - 93:12] RefName=[93:7 - 93:12] Extent=[7:10 - 93:12] +// CHECK: 92:7: MemberRefExpr=first:2:23 SingleRefName=[92:7 - 92:12] RefName=[92:7 - 92:12] Extent=[7:10 - 92:12] +// CHECK: 91:7: MemberRefExpr=first:2:23 SingleRefName=[91:7 - 91:12] RefName=[91:7 - 91:12] Extent=[7:10 - 91:12] +// CHECK: 90:7: MemberRefExpr=first:2:23 SingleRefName=[90:7 - 90:12] RefName=[90:7 - 90:12] Extent=[7:10 - 90:12] +// CHECK: 89:7: MemberRefExpr=first:2:23 SingleRefName=[89:7 - 89:12] RefName=[89:7 - 89:12] Extent=[7:10 - 89:12] +// CHECK: 88:7: MemberRefExpr=first:2:23 SingleRefName=[88:7 - 88:12] RefName=[88:7 - 88:12] Extent=[7:10 - 88:12] +// CHECK: 87:7: MemberRefExpr=first:2:23 SingleRefName=[87:7 - 87:12] RefName=[87:7 - 87:12] Extent=[7:10 - 87:12] +// CHECK: 86:7: MemberRefExpr=first:2:23 SingleRefName=[86:7 - 86:12] RefName=[86:7 - 86:12] Extent=[7:10 - 86:12] +// CHECK: 85:7: MemberRefExpr=first:2:23 SingleRefName=[85:7 - 85:12] RefName=[85:7 - 85:12] Extent=[7:10 - 85:12] +// CHECK: 84:7: MemberRefExpr=first:2:23 SingleRefName=[84:7 - 84:12] RefName=[84:7 - 84:12] Extent=[7:10 - 84:12] +// CHECK: 83:7: MemberRefExpr=first:2:23 SingleRefName=[83:7 - 83:12] RefName=[83:7 - 83:12] Extent=[7:10 - 83:12] +// CHECK: 82:7: MemberRefExpr=first:2:23 SingleRefName=[82:7 - 82:12] RefName=[82:7 - 82:12] Extent=[7:10 - 82:12] +// CHECK: 81:7: MemberRefExpr=first:2:23 SingleRefName=[81:7 - 81:12] RefName=[81:7 - 81:12] Extent=[7:10 - 81:12] +// CHECK: 80:7: MemberRefExpr=first:2:23 SingleRefName=[80:7 - 80:12] RefName=[80:7 - 80:12] Extent=[7:10 - 80:12] +// CHECK: 79:7: MemberRefExpr=first:2:23 SingleRefName=[79:7 - 79:12] RefName=[79:7 - 79:12] Extent=[7:10 - 79:12] +// CHECK: 78:7: MemberRefExpr=first:2:23 SingleRefName=[78:7 - 78:12] RefName=[78:7 - 78:12] Extent=[7:10 - 78:12] +// CHECK: 77:7: MemberRefExpr=first:2:23 SingleRefName=[77:7 - 77:12] RefName=[77:7 - 77:12] Extent=[7:10 - 77:12] +// CHECK: 76:7: MemberRefExpr=first:2:23 SingleRefName=[76:7 - 76:12] RefName=[76:7 - 76:12] Extent=[7:10 - 76:12] +// CHECK: 75:7: MemberRefExpr=first:2:23 SingleRefName=[75:7 - 75:12] RefName=[75:7 - 75:12] Extent=[7:10 - 75:12] +// CHECK: 74:7: MemberRefExpr=first:2:23 SingleRefName=[74:7 - 74:12] RefName=[74:7 - 74:12] Extent=[7:10 - 74:12] +// CHECK: 73:7: MemberRefExpr=first:2:23 SingleRefName=[73:7 - 73:12] RefName=[73:7 - 73:12] Extent=[7:10 - 73:12] +// CHECK: 72:7: MemberRefExpr=first:2:23 SingleRefName=[72:7 - 72:12] RefName=[72:7 - 72:12] Extent=[7:10 - 72:12] +// CHECK: 71:7: MemberRefExpr=first:2:23 SingleRefName=[71:7 - 71:12] RefName=[71:7 - 71:12] Extent=[7:10 - 71:12] +// CHECK: 70:7: MemberRefExpr=first:2:23 SingleRefName=[70:7 - 70:12] RefName=[70:7 - 70:12] Extent=[7:10 - 70:12] +// CHECK: 69:7: MemberRefExpr=first:2:23 SingleRefName=[69:7 - 69:12] RefName=[69:7 - 69:12] Extent=[7:10 - 69:12] +// CHECK: 68:7: MemberRefExpr=first:2:23 SingleRefName=[68:7 - 68:12] RefName=[68:7 - 68:12] Extent=[7:10 - 68:12] +// CHECK: 67:7: MemberRefExpr=first:2:23 SingleRefName=[67:7 - 67:12] RefName=[67:7 - 67:12] Extent=[7:10 - 67:12] +// CHECK: 66:7: MemberRefExpr=first:2:23 SingleRefName=[66:7 - 66:12] RefName=[66:7 - 66:12] Extent=[7:10 - 66:12] +// CHECK: 65:7: MemberRefExpr=first:2:23 SingleRefName=[65:7 - 65:12] RefName=[65:7 - 65:12] Extent=[7:10 - 65:12] +// CHECK: 64:7: MemberRefExpr=first:2:23 SingleRefName=[64:7 - 64:12] RefName=[64:7 - 64:12] Extent=[7:10 - 64:12] +// CHECK: 63:7: MemberRefExpr=first:2:23 SingleRefName=[63:7 - 63:12] RefName=[63:7 - 63:12] Extent=[7:10 - 63:12] +// CHECK: 62:7: MemberRefExpr=first:2:23 SingleRefName=[62:7 - 62:12] RefName=[62:7 - 62:12] Extent=[7:10 - 62:12] +// CHECK: 61:7: MemberRefExpr=first:2:23 SingleRefName=[61:7 - 61:12] RefName=[61:7 - 61:12] Extent=[7:10 - 61:12] +// CHECK: 60:7: MemberRefExpr=first:2:23 SingleRefName=[60:7 - 60:12] RefName=[60:7 - 60:12] Extent=[7:10 - 60:12] +// CHECK: 59:7: MemberRefExpr=first:2:23 SingleRefName=[59:7 - 59:12] RefName=[59:7 - 59:12] Extent=[7:10 - 59:12] +// CHECK: 58:7: MemberRefExpr=first:2:23 SingleRefName=[58:7 - 58:12] RefName=[58:7 - 58:12] Extent=[7:10 - 58:12] +// CHECK: 57:7: MemberRefExpr=first:2:23 SingleRefName=[57:7 - 57:12] RefName=[57:7 - 57:12] Extent=[7:10 - 57:12] +// CHECK: 56:7: MemberRefExpr=first:2:23 SingleRefName=[56:7 - 56:12] RefName=[56:7 - 56:12] Extent=[7:10 - 56:12] +// CHECK: 55:7: MemberRefExpr=first:2:23 SingleRefName=[55:7 - 55:12] RefName=[55:7 - 55:12] Extent=[7:10 - 55:12] +// CHECK: 54:7: MemberRefExpr=first:2:23 SingleRefName=[54:7 - 54:12] RefName=[54:7 - 54:12] Extent=[7:10 - 54:12] +// CHECK: 53:7: MemberRefExpr=first:2:23 SingleRefName=[53:7 - 53:12] RefName=[53:7 - 53:12] Extent=[7:10 - 53:12] +// CHECK: 52:7: MemberRefExpr=first:2:23 SingleRefName=[52:7 - 52:12] RefName=[52:7 - 52:12] Extent=[7:10 - 52:12] +// CHECK: 51:7: MemberRefExpr=first:2:23 SingleRefName=[51:7 - 51:12] RefName=[51:7 - 51:12] Extent=[7:10 - 51:12] +// CHECK: 50:7: MemberRefExpr=first:2:23 SingleRefName=[50:7 - 50:12] RefName=[50:7 - 50:12] Extent=[7:10 - 50:12] +// CHECK: 49:7: MemberRefExpr=first:2:23 SingleRefName=[49:7 - 49:12] RefName=[49:7 - 49:12] Extent=[7:10 - 49:12] +// CHECK: 48:7: MemberRefExpr=first:2:23 SingleRefName=[48:7 - 48:12] RefName=[48:7 - 48:12] Extent=[7:10 - 48:12] +// CHECK: 47:7: MemberRefExpr=first:2:23 SingleRefName=[47:7 - 47:12] RefName=[47:7 - 47:12] Extent=[7:10 - 47:12] +// CHECK: 46:7: MemberRefExpr=first:2:23 SingleRefName=[46:7 - 46:12] RefName=[46:7 - 46:12] Extent=[7:10 - 46:12] +// CHECK: 45:7: MemberRefExpr=first:2:23 SingleRefName=[45:7 - 45:12] RefName=[45:7 - 45:12] Extent=[7:10 - 45:12] +// CHECK: 44:7: MemberRefExpr=first:2:23 SingleRefName=[44:7 - 44:12] RefName=[44:7 - 44:12] Extent=[7:10 - 44:12] +// CHECK: 43:7: MemberRefExpr=first:2:23 SingleRefName=[43:7 - 43:12] RefName=[43:7 - 43:12] Extent=[7:10 - 43:12] +// CHECK: 42:7: MemberRefExpr=first:2:23 SingleRefName=[42:7 - 42:12] RefName=[42:7 - 42:12] Extent=[7:10 - 42:12] +// CHECK: 41:7: MemberRefExpr=first:2:23 SingleRefName=[41:7 - 41:12] RefName=[41:7 - 41:12] Extent=[7:10 - 41:12] +// CHECK: 40:7: MemberRefExpr=first:2:23 SingleRefName=[40:7 - 40:12] RefName=[40:7 - 40:12] Extent=[7:10 - 40:12] +// CHECK: 39:7: MemberRefExpr=first:2:23 SingleRefName=[39:7 - 39:12] RefName=[39:7 - 39:12] Extent=[7:10 - 39:12] +// CHECK: 38:7: MemberRefExpr=first:2:23 SingleRefName=[38:7 - 38:12] RefName=[38:7 - 38:12] Extent=[7:10 - 38:12] +// CHECK: 37:7: MemberRefExpr=first:2:23 SingleRefName=[37:7 - 37:12] RefName=[37:7 - 37:12] Extent=[7:10 - 37:12] +// CHECK: 36:7: MemberRefExpr=first:2:23 SingleRefName=[36:7 - 36:12] RefName=[36:7 - 36:12] Extent=[7:10 - 36:12] +// CHECK: 35:7: MemberRefExpr=first:2:23 SingleRefName=[35:7 - 35:12] RefName=[35:7 - 35:12] Extent=[7:10 - 35:12] +// CHECK: 34:7: MemberRefExpr=first:2:23 SingleRefName=[34:7 - 34:12] RefName=[34:7 - 34:12] Extent=[7:10 - 34:12] +// CHECK: 33:7: MemberRefExpr=first:2:23 SingleRefName=[33:7 - 33:12] RefName=[33:7 - 33:12] Extent=[7:10 - 33:12] +// CHECK: 32:7: MemberRefExpr=first:2:23 SingleRefName=[32:7 - 32:12] RefName=[32:7 - 32:12] Extent=[7:10 - 32:12] +// CHECK: 31:7: MemberRefExpr=first:2:23 SingleRefName=[31:7 - 31:12] RefName=[31:7 - 31:12] Extent=[7:10 - 31:12] +// CHECK: 30:7: MemberRefExpr=first:2:23 SingleRefName=[30:7 - 30:12] RefName=[30:7 - 30:12] Extent=[7:10 - 30:12] +// CHECK: 29:7: MemberRefExpr=first:2:23 SingleRefName=[29:7 - 29:12] RefName=[29:7 - 29:12] Extent=[7:10 - 29:12] +// CHECK: 28:7: MemberRefExpr=first:2:23 SingleRefName=[28:7 - 28:12] RefName=[28:7 - 28:12] Extent=[7:10 - 28:12] +// CHECK: 27:7: MemberRefExpr=first:2:23 SingleRefName=[27:7 - 27:12] RefName=[27:7 - 27:12] Extent=[7:10 - 27:12] +// CHECK: 26:7: MemberRefExpr=first:2:23 SingleRefName=[26:7 - 26:12] RefName=[26:7 - 26:12] Extent=[7:10 - 26:12] +// CHECK: 25:7: MemberRefExpr=first:2:23 SingleRefName=[25:7 - 25:12] RefName=[25:7 - 25:12] Extent=[7:10 - 25:12] +// CHECK: 24:7: MemberRefExpr=first:2:23 SingleRefName=[24:7 - 24:12] RefName=[24:7 - 24:12] Extent=[7:10 - 24:12] +// CHECK: 23:7: MemberRefExpr=first:2:23 SingleRefName=[23:7 - 23:12] RefName=[23:7 - 23:12] Extent=[7:10 - 23:12] +// CHECK: 22:7: MemberRefExpr=first:2:23 SingleRefName=[22:7 - 22:12] RefName=[22:7 - 22:12] Extent=[7:10 - 22:12] +// CHECK: 21:7: MemberRefExpr=first:2:23 SingleRefName=[21:7 - 21:12] RefName=[21:7 - 21:12] Extent=[7:10 - 21:12] +// CHECK: 20:7: MemberRefExpr=first:2:23 SingleRefName=[20:7 - 20:12] RefName=[20:7 - 20:12] Extent=[7:10 - 20:12] +// CHECK: 19:7: MemberRefExpr=first:2:23 SingleRefName=[19:7 - 19:12] RefName=[19:7 - 19:12] Extent=[7:10 - 19:12] +// CHECK: 18:7: MemberRefExpr=first:2:23 SingleRefName=[18:7 - 18:12] RefName=[18:7 - 18:12] Extent=[7:10 - 18:12] +// CHECK: 17:7: MemberRefExpr=first:2:23 SingleRefName=[17:7 - 17:12] RefName=[17:7 - 17:12] Extent=[7:10 - 17:12] +// CHECK: 16:7: MemberRefExpr=first:2:23 SingleRefName=[16:7 - 16:12] RefName=[16:7 - 16:12] Extent=[7:10 - 16:12] +// CHECK: 15:7: MemberRefExpr=first:2:23 SingleRefName=[15:7 - 15:12] RefName=[15:7 - 15:12] Extent=[7:10 - 15:12] +// CHECK: 14:7: MemberRefExpr=first:2:23 SingleRefName=[14:7 - 14:12] RefName=[14:7 - 14:12] Extent=[7:10 - 14:12] +// CHECK: 13:7: MemberRefExpr=first:2:23 SingleRefName=[13:7 - 13:12] RefName=[13:7 - 13:12] Extent=[7:10 - 13:12] +// CHECK: 12:7: MemberRefExpr=first:2:23 SingleRefName=[12:7 - 12:12] RefName=[12:7 - 12:12] Extent=[7:10 - 12:12] +// CHECK: 11:7: MemberRefExpr=first:2:23 SingleRefName=[11:7 - 11:12] RefName=[11:7 - 11:12] Extent=[7:11 - 11:12] +// CHECK: 10:7: MemberRefExpr=first:2:23 SingleRefName=[10:7 - 10:12] RefName=[10:7 - 10:12] Extent=[7:12 - 10:12] +// CHECK: 9:7: MemberRefExpr=first:2:23 SingleRefName=[9:7 - 9:12] RefName=[9:7 - 9:12] Extent=[7:13 - 9:12] +// CHECK: 8:7: MemberRefExpr=first:2:23 SingleRefName=[8:7 - 8:12] RefName=[8:7 - 8:12] Extent=[7:14 - 8:12] +// CHECK: 7:27: MemberRefExpr=first:2:23 SingleRefName=[7:27 - 7:32] RefName=[7:27 - 7:32] Extent=[7:15 - 7:32] +// CHECK: 7:19: MemberRefExpr=first:2:23 SingleRefName=[7:19 - 7:24] RefName=[7:19 - 7:24] Extent=[7:16 - 7:24] +// CHECK: 7:16: DeclRefExpr=s:6:42 Extent=[7:16 - 7:17] + +// RUN: c-index-test -test-annotate-tokens=%s:1:1:124:1 %s | FileCheck -check-prefix=CHECK-tokens %s +// CHECK-tokens: Keyword: "struct" [1:1 - 1:7] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Identifier: "rdar8650865" [1:8 - 1:19] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Punctuation: "{" [1:20 - 1:21] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Keyword: "struct" [2:3 - 2:9] FieldDecl=first:2:23 (Definition) +// CHECK-tokens: Identifier: "rdar8650865" [2:10 - 2:21] TypeRef=struct rdar8650865:1:8 +// CHECK-tokens: Punctuation: "*" [2:22 - 2:23] FieldDecl=first:2:23 (Definition) +// CHECK-tokens: Identifier: "first" [2:23 - 2:28] FieldDecl=first:2:23 (Definition) +// CHECK-tokens: Punctuation: ";" [2:28 - 2:29] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Keyword: "int" [3:3 - 3:6] FieldDecl=x:3:7 (Definition) +// CHECK-tokens: Identifier: "x" [3:7 - 3:8] FieldDecl=x:3:7 (Definition) +// CHECK-tokens: Punctuation: ";" [3:8 - 3:9] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Punctuation: "}" [4:1 - 4:2] StructDecl=rdar8650865:1:8 (Definition) +// CHECK-tokens: Punctuation: ";" [4:2 - 4:3] +// CHECK-tokens: Keyword: "int" [6:1 - 6:4] FunctionDecl=test_rdar8650865:6:5 (Definition) +// CHECK-tokens: Identifier: "test_rdar8650865" [6:5 - 6:21] FunctionDecl=test_rdar8650865:6:5 (Definition) +// CHECK-tokens: Punctuation: "(" [6:21 - 6:22] FunctionDecl=test_rdar8650865:6:5 (Definition) +// CHECK-tokens: Keyword: "struct" [6:22 - 6:28] ParmDecl=s:6:42 (Definition) +// CHECK-tokens: Identifier: "rdar8650865" [6:29 - 6:40] TypeRef=struct rdar8650865:1:8 +// CHECK-tokens: Punctuation: "*" [6:41 - 6:42] ParmDecl=s:6:42 (Definition) +// CHECK-tokens: Identifier: "s" [6:42 - 6:43] ParmDecl=s:6:42 (Definition) +// CHECK-tokens: Punctuation: ")" [6:43 - 6:44] FunctionDecl=test_rdar8650865:6:5 (Definition) +// CHECK-tokens: Punctuation: "{" [6:45 - 6:46] CompoundStmt= +// CHECK-tokens: Keyword: "return" [7:3 - 7:9] ReturnStmt= +// CHECK-tokens: Punctuation: "(" [7:10 - 7:11] ParenExpr= +// CHECK-tokens: Punctuation: "(" [7:11 - 7:12] ParenExpr= +// CHECK-tokens: Punctuation: "(" [7:12 - 7:13] ParenExpr= +// CHECK-tokens: Punctuation: "(" [7:13 - 7:14] ParenExpr= +// CHECK-tokens: Punctuation: "(" [7:14 - 7:15] ParenExpr= +// CHECK-tokens: Punctuation: "(" [7:15 - 7:16] ParenExpr= +// CHECK-tokens: Identifier: "s" [7:16 - 7:17] DeclRefExpr=s:6:42 +// CHECK-tokens: Punctuation: "->" [7:17 - 7:19] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [7:19 - 7:24] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [7:24 - 7:25] ParenExpr= +// CHECK-tokens: Punctuation: "->" [7:25 - 7:27] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [7:27 - 7:32] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [7:32 - 7:33] ParenExpr= +// CHECK-tokens: Punctuation: "->" [8:5 - 8:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [8:7 - 8:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [8:12 - 8:13] ParenExpr= +// CHECK-tokens: Punctuation: "->" [9:5 - 9:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [9:7 - 9:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [9:12 - 9:13] ParenExpr= +// CHECK-tokens: Punctuation: "->" [10:5 - 10:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [10:7 - 10:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [10:12 - 10:13] ParenExpr= +// CHECK-tokens: Punctuation: "->" [11:5 - 11:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [11:7 - 11:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: ")" [11:12 - 11:13] ParenExpr= +// CHECK-tokens: Punctuation: "->" [12:5 - 12:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [12:7 - 12:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [13:5 - 13:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [13:7 - 13:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [14:5 - 14:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [14:7 - 14:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [15:5 - 15:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [15:7 - 15:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [16:5 - 16:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [16:7 - 16:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [17:5 - 17:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [17:7 - 17:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [18:5 - 18:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [18:7 - 18:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [19:5 - 19:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [19:7 - 19:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [20:5 - 20:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [20:7 - 20:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [21:5 - 21:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [21:7 - 21:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [22:5 - 22:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [22:7 - 22:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [23:5 - 23:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [23:7 - 23:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [24:5 - 24:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [24:7 - 24:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [25:5 - 25:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [25:7 - 25:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [26:5 - 26:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [26:7 - 26:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [27:5 - 27:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [27:7 - 27:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [28:5 - 28:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [28:7 - 28:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [29:5 - 29:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [29:7 - 29:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [30:5 - 30:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [30:7 - 30:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [31:5 - 31:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [31:7 - 31:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [32:5 - 32:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [32:7 - 32:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [33:5 - 33:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [33:7 - 33:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [34:5 - 34:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [34:7 - 34:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [35:5 - 35:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [35:7 - 35:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [36:5 - 36:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [36:7 - 36:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [37:5 - 37:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [37:7 - 37:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [38:5 - 38:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [38:7 - 38:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [39:5 - 39:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [39:7 - 39:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [40:5 - 40:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [40:7 - 40:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [41:5 - 41:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [41:7 - 41:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [42:5 - 42:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [42:7 - 42:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [43:5 - 43:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [43:7 - 43:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [44:5 - 44:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [44:7 - 44:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [45:5 - 45:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [45:7 - 45:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [46:5 - 46:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [46:7 - 46:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [47:5 - 47:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [47:7 - 47:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [48:5 - 48:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [48:7 - 48:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [49:5 - 49:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [49:7 - 49:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [50:5 - 50:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [50:7 - 50:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [51:5 - 51:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [51:7 - 51:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [52:5 - 52:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [52:7 - 52:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [53:5 - 53:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [53:7 - 53:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [54:5 - 54:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [54:7 - 54:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [55:5 - 55:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [55:7 - 55:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [56:5 - 56:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [56:7 - 56:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [57:5 - 57:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [57:7 - 57:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [58:5 - 58:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [58:7 - 58:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [59:5 - 59:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [59:7 - 59:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [60:5 - 60:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [60:7 - 60:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [61:5 - 61:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [61:7 - 61:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [62:5 - 62:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [62:7 - 62:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [63:5 - 63:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [63:7 - 63:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [64:5 - 64:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [64:7 - 64:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [65:5 - 65:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [65:7 - 65:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [66:5 - 66:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [66:7 - 66:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [67:5 - 67:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [67:7 - 67:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [68:5 - 68:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [68:7 - 68:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [69:5 - 69:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [69:7 - 69:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [70:5 - 70:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [70:7 - 70:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [71:5 - 71:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [71:7 - 71:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [72:5 - 72:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [72:7 - 72:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [73:5 - 73:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [73:7 - 73:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [74:5 - 74:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [74:7 - 74:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [75:5 - 75:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [75:7 - 75:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [76:5 - 76:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [76:7 - 76:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [77:5 - 77:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [77:7 - 77:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [78:5 - 78:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [78:7 - 78:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [79:5 - 79:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [79:7 - 79:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [80:5 - 80:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [80:7 - 80:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [81:5 - 81:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [81:7 - 81:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [82:5 - 82:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [82:7 - 82:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [83:5 - 83:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [83:7 - 83:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [84:5 - 84:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [84:7 - 84:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [85:5 - 85:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [85:7 - 85:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [86:5 - 86:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [86:7 - 86:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [87:5 - 87:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [87:7 - 87:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [88:5 - 88:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [88:7 - 88:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [89:5 - 89:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [89:7 - 89:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [90:5 - 90:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [90:7 - 90:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [91:5 - 91:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [91:7 - 91:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [92:5 - 92:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [92:7 - 92:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [93:5 - 93:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [93:7 - 93:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [94:5 - 94:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [94:7 - 94:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [95:5 - 95:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [95:7 - 95:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [96:5 - 96:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [96:7 - 96:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [97:5 - 97:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [97:7 - 97:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [98:5 - 98:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [98:7 - 98:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [99:5 - 99:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [99:7 - 99:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [100:5 - 100:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [100:7 - 100:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [101:5 - 101:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [101:7 - 101:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [102:5 - 102:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [102:7 - 102:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [103:5 - 103:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [103:7 - 103:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [104:5 - 104:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [104:7 - 104:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [105:5 - 105:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [105:7 - 105:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [106:5 - 106:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [106:7 - 106:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [107:5 - 107:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [107:7 - 107:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [108:5 - 108:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [108:7 - 108:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [109:5 - 109:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [109:7 - 109:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [110:5 - 110:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [110:7 - 110:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [111:5 - 111:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [111:7 - 111:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [112:5 - 112:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [112:7 - 112:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [113:5 - 113:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [113:7 - 113:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [114:5 - 114:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [114:7 - 114:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [115:5 - 115:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [115:7 - 115:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [116:5 - 116:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [116:7 - 116:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [117:5 - 117:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [117:7 - 117:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [118:5 - 118:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [118:7 - 118:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [119:5 - 119:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [119:7 - 119:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [120:5 - 120:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [120:7 - 120:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [121:5 - 121:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [121:7 - 121:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [122:5 - 122:7] MemberRefExpr=first:2:23 +// CHECK-tokens: Identifier: "first" [122:7 - 122:12] MemberRefExpr=first:2:23 +// CHECK-tokens: Punctuation: "->" [123:5 - 123:7] MemberRefExpr=x:3:7 +// CHECK-tokens: Identifier: "x" [123:7 - 123:8] MemberRefExpr=x:3:7 +// CHECK-tokens: Punctuation: ";" [123:8 - 123:9] CompoundStmt= +// CHECK-tokens: Punctuation: "}" [124:1 - 124:2] CompoundStmt= + + diff --git a/clang/test/Index/redeclarations.cpp b/clang/test/Index/redeclarations.cpp new file mode 100644 index 0000000..11dc932 --- /dev/null +++ b/clang/test/Index/redeclarations.cpp @@ -0,0 +1,21 @@ +#include "redeclarations.h" + +class A +{ +}; + +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 2 all -I%S/Inputs -fno-delayed-template-parsing -fno-ms-compatibility -fno-ms-extensions %s | FileCheck %s + +// CHECK: redeclarations.h:1:7: ClassDecl=X:1:7 (Definition) Extent=[1:1 - 4:2] +// CHECK: redeclarations.h:8:7: ClassTemplate=B:8:7 (Definition) Extent=[7:1 - 10:2] +// CHECK: redeclarations.h:7:20: TemplateTypeParameter=T1:7:20 (Definition) Extent=[7:11 - 7:22] +// CHECK: redeclarations.h:7:33: TemplateTypeParameter=T2:7:33 (Definition) Extent=[7:24 - 7:35] +// CHECK: redeclarations.h:13:8: ClassTemplate=C:13:8 (Definition) Extent=[12:1 - 15:2] +// CHECK: redeclarations.h:12:17: TemplateTypeParameter=T:12:17 (Definition) Extent=[12:11 - 12:18] +// CHECK: redeclarations.h:17:7: ClassDecl=D:17:7 (Definition) Extent=[17:1 - 21:2] +// CHECK: redeclarations.h:19:16: ClassDecl=A:19:16 Extent=[19:10 - 19:17] +// CHECK: redeclarations.h:19:19: FieldDecl=x:19:19 (Definition) Extent=[19:5 - 19:20] +// CHECK: redeclarations.h:19:5: TemplateRef=B:8:7 Extent=[19:5 - 19:6] +// CHECK: redeclarations.h:19:7: TypeRef=class D:17:7 Extent=[19:7 - 19:8] +// CHECK: redeclarations.h:19:16: TypeRef=class A:3:7 Extent=[19:16 - 19:17] +// CHECK: redeclarations.cpp:3:7: ClassDecl=A:3:7 (Definition) Extent=[3:1 - 5:2] diff --git a/clang/test/Index/remap-complete.c b/clang/test/Index/remap-complete.c new file mode 100644 index 0000000..93fb623 --- /dev/null +++ b/clang/test/Index/remap-complete.c @@ -0,0 +1,4 @@ +// RUN: c-index-test -code-completion-at=%s:6:2 -remap-file="%s;%S/Inputs/remap-complete-to.c" %s | FileCheck %s + +// CHECK: FunctionDecl:{ResultType int}{TypedText f0}{LeftParen (} +void f() { } diff --git a/clang/test/Index/remap-cursor-at.c b/clang/test/Index/remap-cursor-at.c new file mode 100644 index 0000000..c2bed0e --- /dev/null +++ b/clang/test/Index/remap-cursor-at.c @@ -0,0 +1,4 @@ +// RUN: c-index-test -cursor-at=%s:1:15 -cursor-at=%s:2:21 -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck %s + +// CHECK: ParmDecl=parm1:1:13 (Definition) +// CHECK: DeclRefExpr=parm2:1:26 diff --git a/clang/test/Index/remap-load.c b/clang/test/Index/remap-load.c new file mode 100644 index 0000000..2608874 --- /dev/null +++ b/clang/test/Index/remap-load.c @@ -0,0 +1,10 @@ +// RUN: c-index-test -test-load-source all -remap-file="%s;%S/Inputs/remap-load-to.c" %s | FileCheck -check-prefix=CHECK %s + +// CHECK: remap-load.c:1:5: FunctionDecl=foo:1:5 (Definition) Extent=[1:1 - 3:2] +// CHECK: remap-load.c:1:13: ParmDecl=parm1:1:13 (Definition) Extent=[1:9 - 1:18] +// CHECK: remap-load.c:1:26: ParmDecl=parm2:1:26 (Definition) Extent=[1:20 - 1:31] +// CHECK: remap-load.c:2:10: UnexposedExpr= Extent=[2:10 - 2:23] +// CHECK: remap-load.c:2:10: BinaryOperator= Extent=[2:10 - 2:23] +// CHECK: remap-load.c:2:10: UnexposedExpr=parm1:1:13 Extent=[2:10 - 2:15] +// CHECK: remap-load.c:2:10: DeclRefExpr=parm1:1:13 Extent=[2:10 - 2:15] +// CHECK: remap-load.c:2:18: DeclRefExpr=parm2:1:26 Extent=[2:18 - 2:23] diff --git a/clang/test/Index/reparse-instantiate.cpp b/clang/test/Index/reparse-instantiate.cpp new file mode 100644 index 0000000..84e5860 --- /dev/null +++ b/clang/test/Index/reparse-instantiate.cpp @@ -0,0 +1,7 @@ +int main() +{ + return 0; +} + +// RUN: c-index-test -write-pch %t.pch -fno-delayed-template-parsing -x c++-header %S/Inputs/reparse-instantiate.h +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -fno-delayed-template-parsing -I %S/Inputs -include %t %s diff --git a/clang/test/Index/retain-target-options.c b/clang/test/Index/retain-target-options.c new file mode 100644 index 0000000..2fba476 --- /dev/null +++ b/clang/test/Index/retain-target-options.c @@ -0,0 +1,8 @@ +// RUN: c-index-test -test-load-source all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s +// RUN: c-index-test -test-load-source-reparse 1 all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s +// RUN: c-index-test -test-load-source-reparse 5 all -target x86_64-apple-darwin10.0.0 -msse4.1 %s 2>&1 | FileCheck %s + +// CHECK: error: SSE4_1 used +#if defined(__SSE4_1__) +#error SSE4_1 used +#endif diff --git a/clang/test/Index/targeted-annotation.c b/clang/test/Index/targeted-annotation.c new file mode 100644 index 0000000..cfa1046 --- /dev/null +++ b/clang/test/Index/targeted-annotation.c @@ -0,0 +1,99 @@ + +#include "targeted-top.h" +#include "targeted-preamble.h" + +int LocalVar1; +int LocalVar2; + +// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%s:1:1:7:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -test-annotate-tokens=%s:1:1:7:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL + +// LOCAL: Punctuation: "#" [2:1 - 2:2] inclusion directive=targeted-top.h +// LOCAL: Identifier: "include" [2:2 - 2:9] inclusion directive=targeted-top.h +// LOCAL: Literal: ""targeted-top.h"" [2:10 - 2:26] inclusion directive=targeted-top.h +// LOCAL: Punctuation: "#" [3:1 - 3:2] inclusion directive=targeted-preamble.h +// LOCAL: Identifier: "include" [3:2 - 3:9] inclusion directive=targeted-preamble.h +// LOCAL: Literal: ""targeted-preamble.h"" [3:10 - 3:31] inclusion directive=targeted-preamble.h +// LOCAL: Keyword: "int" [5:1 - 5:4] VarDecl=LocalVar1:5:5 +// LOCAL: Identifier: "LocalVar1" [5:5 - 5:14] VarDecl=LocalVar1:5:5 +// LOCAL: Punctuation: ";" [5:14 - 5:15] +// LOCAL: Keyword: "int" [6:1 - 6:4] VarDecl=LocalVar2:6:5 +// LOCAL: Identifier: "LocalVar2" [6:5 - 6:14] VarDecl=LocalVar2:6:5 +// LOCAL: Punctuation: ";" [6:14 - 6:15] + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-fields.h:1:1:4:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=FIELD + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -test-annotate-tokens=%S/targeted-fields.h:1:1:4:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=FIELD + +// FIELD: Keyword: "int" [2:3 - 2:6] FieldDecl=z:2:7 (Definition) +// FIELD: Identifier: "z" [2:7 - 2:8] FieldDecl=z:2:7 (Definition) +// FIELD: Punctuation: ";" [2:8 - 2:9] StructDecl=:13:9 (Definition) +// FIELD: Keyword: "int" [3:3 - 3:6] FieldDecl=w:3:7 (Definition) +// FIELD: Identifier: "w" [3:7 - 3:8] FieldDecl=w:3:7 (Definition) +// FIELD: Punctuation: ";" [3:8 - 3:9] StructDecl=:13:9 (Definition) + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-nested1.h:1:1:3:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -test-annotate-tokens=%S/targeted-nested1.h:1:1:3:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED + +// NESTED: Keyword: "extern" [2:1 - 2:7] +// NESTED: Keyword: "int" [2:8 - 2:11] VarDecl=NestedVar1:2:12 +// NESTED: Identifier: "NestedVar1" [2:12 - 2:22] VarDecl=NestedVar1:2:12 +// NESTED: Punctuation: ";" [2:22 - 2:23] + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -test-annotate-tokens=%S/targeted-top.h:1:1:12:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ +// RUN: | FileCheck %s -check-prefix=TOP + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -test-annotate-tokens=%S/targeted-top.h:1:1:12:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ +// RUN: | FileCheck %s -check-prefix=TOP + +// TOP: Punctuation: "#" [2:1 - 2:2] preprocessing directive= +// TOP: Identifier: "ifndef" [2:2 - 2:8] preprocessing directive= +// TOP: Identifier: "TARGETED_TOP_H" [2:9 - 2:23] preprocessing directive= +// TOP: Punctuation: "#" [3:1 - 3:2] preprocessing directive= +// TOP: Identifier: "define" [3:2 - 3:8] preprocessing directive= +// TOP: Identifier: "TARGETED_TOP_H" [3:9 - 3:23] preprocessing directive= +// TOP: Punctuation: "#" [5:1 - 5:2] preprocessing directive= +// TOP: Identifier: "include" [5:2 - 5:9] preprocessing directive= +// TOP: Literal: ""targeted-nested1.h"" [5:10 - 5:30] preprocessing directive= +// TOP: Keyword: "enum" [7:1 - 7:5] EnumDecl=:7:1 (Definition) +// TOP: Punctuation: "{" [7:6 - 7:7] EnumDecl=:7:1 (Definition) +// TOP: Identifier: "VALUE" [8:3 - 8:8] EnumConstantDecl=VALUE:8:3 (Definition) +// TOP: Punctuation: "=" [8:9 - 8:10] EnumConstantDecl=VALUE:8:3 (Definition) +// TOP: Literal: "3" [8:11 - 8:12] IntegerLiteral= +// TOP: Punctuation: "}" [9:1 - 9:2] EnumDecl=:7:1 (Definition) +// TOP: Punctuation: ";" [9:2 - 9:3] +// TOP: Keyword: "extern" [11:1 - 11:7] +// TOP: Keyword: "int" [11:8 - 11:11] VarDecl=TopVar:11:12 +// TOP: Identifier: "TopVar" [11:12 - 11:18] VarDecl=TopVar:11:12 +// TOP: Punctuation: ";" [11:18 - 11:19] diff --git a/clang/test/Index/targeted-cursor.c b/clang/test/Index/targeted-cursor.c new file mode 100644 index 0000000..7efc07f --- /dev/null +++ b/clang/test/Index/targeted-cursor.c @@ -0,0 +1,65 @@ + +#include "targeted-top.h" +#include "targeted-preamble.h" + +int LocalVar1; +int LocalVar2; + +// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%s:5:10 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ +// RUN: | FileCheck %s -check-prefix=TOP-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-fields.h:2:7 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=FIELD-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -cursor-at=%S/targeted-fields.h:1:1 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=FIELD-CURSOR2 + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -cursor-at=%s:5:10 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -cursor-at=%S/targeted-top.h:11:15 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=vector_get_x \ +// RUN: | FileCheck %s -check-prefix=TOP-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -cursor-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED-CURSOR1 + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -cursor-at=%S/targeted-preamble.h:2:15 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=PREAMBLE-CURSOR1 + +// LOCAL-CURSOR1: VarDecl=LocalVar1:5:5 +// TOP-CURSOR1: VarDecl=TopVar:11:12 +// NESTED-CURSOR1: VarDecl=NestedVar1:2:12 +// PREAMBLE-CURSOR1: VarDecl=PreambleVar:2:12 + +// FIELD-CURSOR1: FieldDecl=z:2:7 (Definition) +// FIELD-CURSOR2: StructDecl=:13:9 (Definition) diff --git a/clang/test/Index/targeted-cursor.m b/clang/test/Index/targeted-cursor.m new file mode 100644 index 0000000..a53ebf6 --- /dev/null +++ b/clang/test/Index/targeted-cursor.m @@ -0,0 +1,6 @@ + +// rdar://10920009 +// RUN: c-index-test -write-pch %t.h.pch -target x86_64-apple-macosx10.7 -x objective-c-header %S/targeted-cursor.m.h -Xclang -detailed-preprocessing-record +// RUN: c-index-test -cursor-at=%S/targeted-cursor.m.h:5:13 %s -target x86_64-apple-macosx10.7 -include %t.h | FileCheck %s + +// CHECK: ObjCClassRef=I:2:12 diff --git a/clang/test/Index/targeted-cursor.m.h b/clang/test/Index/targeted-cursor.m.h new file mode 100644 index 0000000..735c7bd --- /dev/null +++ b/clang/test/Index/targeted-cursor.m.h @@ -0,0 +1,7 @@ + +@interface I + +-(void)mm:(void (^)(I*))block; +-(void)mm2:(I*)i; + +@end diff --git a/clang/test/Index/targeted-fields.h b/clang/test/Index/targeted-fields.h new file mode 100644 index 0000000..7da57f3 --- /dev/null +++ b/clang/test/Index/targeted-fields.h @@ -0,0 +1,3 @@ + + int z; + int w; diff --git a/clang/test/Index/targeted-file-refs.c b/clang/test/Index/targeted-file-refs.c new file mode 100644 index 0000000..195cd86 --- /dev/null +++ b/clang/test/Index/targeted-file-refs.c @@ -0,0 +1,59 @@ + +#include "targeted-top.h" +#include "targeted-preamble.h" + +extern int LocalVar; +int LocalVar; + +// RUN: c-index-test -write-pch %t.h.pch %S/targeted-top.h -Xclang -detailed-preprocessing-record +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -file-refs-at=%s:5:17 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -file-refs-at=%s:5:17 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=LOCAL + +// LOCAL: VarDecl=LocalVar:5:12 +// LOCAL: VarDecl=LocalVar:5:12 =[5:12 - 5:20] +// LOCAL: VarDecl=LocalVar:6:5 =[6:5 - 6:13] + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -file-refs-at=%S/targeted-top.h:14:7 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: | FileCheck %s -check-prefix=TOP + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -file-refs-at=%S/targeted-top.h:14:7 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: | FileCheck %s -check-prefix=TOP + +// TOP: FieldDecl=x:14:7 (Definition) +// TOP: FieldDecl=x:14:7 (Definition) =[14:7 - 14:8] +// TOP: MemberRefExpr=x:14:7 SingleRefName=[20:13 - 20:14] RefName=[20:13 - 20:14] =[20:13 - 20:14] + +// RUN: env CINDEXTEST_FAILONERROR=1 c-index-test -file-refs-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -file-refs-at=%S/targeted-nested1.h:2:16 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=PreambleVar \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=NESTED + +// NESTED: VarDecl=NestedVar1:2:12 +// NESTED: VarDecl=NestedVar1:2:12 =[2:12 - 2:22] + +// RUN: env CINDEXTEST_FAILONERROR=1 CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_NO_CACHING=1 \ +// RUN: c-index-test -file-refs-at=%S/targeted-preamble.h:2:15 %s -include %t.h \ +// RUN: -Xclang -error-on-deserialized-decl=NestedVar1 \ +// RUN: -Xclang -error-on-deserialized-decl=TopVar \ +// RUN: | FileCheck %s -check-prefix=PREAMBLE + +// PREAMBLE: VarDecl=PreambleVar:2:12 +// PREAMBLE: VarDecl=PreambleVar:2:12 =[2:12 - 2:23] diff --git a/clang/test/Index/targeted-nested1.h b/clang/test/Index/targeted-nested1.h new file mode 100644 index 0000000..d5a019b --- /dev/null +++ b/clang/test/Index/targeted-nested1.h @@ -0,0 +1,2 @@ + +extern int NestedVar1; diff --git a/clang/test/Index/targeted-preamble.h b/clang/test/Index/targeted-preamble.h new file mode 100644 index 0000000..19b9539 --- /dev/null +++ b/clang/test/Index/targeted-preamble.h @@ -0,0 +1,2 @@ + +extern int PreambleVar; diff --git a/clang/test/Index/targeted-top.h b/clang/test/Index/targeted-top.h new file mode 100644 index 0000000..0f3c975 --- /dev/null +++ b/clang/test/Index/targeted-top.h @@ -0,0 +1,24 @@ + +#ifndef TARGETED_TOP_H +#define TARGETED_TOP_H + +#include "targeted-nested1.h" + +enum { + VALUE = 3 +}; + +extern int TopVar; + +typedef struct { + int x; + int y; +#include "targeted-fields.h" +} Vector; + +static inline int vector_get_x(Vector v) { + int x = v.x; + return x; +} + +#endif diff --git a/clang/test/Index/unmatched-braces.c b/clang/test/Index/unmatched-braces.c new file mode 100644 index 0000000..b994605 --- /dev/null +++ b/clang/test/Index/unmatched-braces.c @@ -0,0 +1,9 @@ +void foo() { + int x; + if (x) { +} + +// RUN: c-index-test -cursor-at=%s:2:7 %s > %t +// RUN: FileCheck %s -input-file %t + +// CHECK: VarDecl=x:2:7 diff --git a/clang/test/Index/unmatched-braces.m b/clang/test/Index/unmatched-braces.m new file mode 100644 index 0000000..84fe82a --- /dev/null +++ b/clang/test/Index/unmatched-braces.m @@ -0,0 +1,11 @@ +@implementation I +-(void)meth { + int x; + if (x) { +} +@end + +// RUN: c-index-test -cursor-at=%s:3:7 %s > %t +// RUN: FileCheck %s -input-file %t + +// CHECK: VarDecl=x:3:7 diff --git a/clang/test/Index/usrs-cxx0x.cpp b/clang/test/Index/usrs-cxx0x.cpp new file mode 100644 index 0000000..a48b446 --- /dev/null +++ b/clang/test/Index/usrs-cxx0x.cpp @@ -0,0 +1,8 @@ +template<typename ...Types> +struct tuple { }; + +void f(tuple<int, float, double>); + +// RUN: c-index-test -test-load-source-usrs all -std=c++11 %s | FileCheck %s +// CHECK: usrs-cxx0x.cpp c:@ST>1#pT@tuple Extent=[1:1 - 2:17] +// CHECK: usrs-cxx0x.cpp c:@F@f#$@S@tuple>#p3Ifd# Extent=[4:1 - 4:34] diff --git a/clang/test/Index/usrs.cpp b/clang/test/Index/usrs.cpp new file mode 100644 index 0000000..023818c --- /dev/null +++ b/clang/test/Index/usrs.cpp @@ -0,0 +1,146 @@ +namespace foo { + int x; + void bar(int z); +} +namespace bar { + typedef int QType; + void bar(QType z); +} + +class ClsA { +public: + int a, b; + ClsA(int A, int B) : a(A), b(B) {} +}; + +namespace foo { + class ClsB : public ClsA { + public: + ClsB() : ClsA(1, 2) {} + int result() const; + }; +} + +int foo::ClsB::result() const { + return a + b; +} + +namespace { + class ClsC : public foo::ClsB {}; + int w; +} + +int z; + +namespace foo { namespace taz { + int x; + static inline int add(int a, int b) { return a + b; } + void sub(int a, int b); +} +} + +namespace foo { namespace taz { + class ClsD : public foo::ClsB { + public: + ClsD& operator=(int x) { a = x; return *this; } + ClsD& operator=(double x) { a = (int) x; return *this; } + ClsD& operator=(const ClsD &x) { a = x.a; return *this; } + static int qux(); + static int uz(int z, ...); + bool operator==(const ClsD &x) const { return a == x.a; } + }; +}} + +extern "C" { + void rez(int a, int b); +} + +namespace foo_alias = foo; + +using namespace foo; + +namespace foo_alias2 = foo; + +using foo::ClsB; + +namespace foo_alias3 = foo; + +namespace { +class RDar9371763_Foo { +public: + void bar(); +}; +} + +void RDar9371763_Foo::bar() {} + +void rdar9371763() { + RDar9371763_Foo foo; + foo.bar(); +} + +// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s +// CHECK: usrs.cpp c:@N@foo Extent=[1:1 - 4:2] +// CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8] +// CHECK: usrs.cpp c:@N@foo@F@bar#I# Extent=[3:3 - 3:18] +// CHECK: usrs.cpp c:usrs.cpp@36@N@foo@F@bar#I#@z Extent=[3:12 - 3:17] +// CHECK: usrs.cpp c:@N@bar Extent=[5:1 - 8:2] +// CHECK: usrs.cpp c:usrs.cpp@64@N@bar@T@QType Extent=[6:3 - 6:20] +// CHECK: usrs.cpp c:@N@bar@F@bar#I# Extent=[7:3 - 7:20] +// CHECK: usrs.cpp c:usrs.cpp@94@N@bar@F@bar#I#@z Extent=[7:12 - 7:19] +// CHECK: usrs.cpp c:@C@ClsA Extent=[10:1 - 14:2] +// CHECK: usrs.cpp c: Extent=[11:1 - 11:8] +// CHECK: usrs.cpp c:@C@ClsA@FI@a Extent=[12:3 - 12:8] +// CHECK: usrs.cpp c:@C@ClsA@FI@b Extent=[12:3 - 12:11] +// CHECK: usrs.cpp c:@C@ClsA@F@ClsA#I#I# Extent=[13:3 - 13:37] +// CHECK: usrs.cpp c:usrs.cpp@147@C@ClsA@F@ClsA#I#I#@A Extent=[13:8 - 13:13] +// CHECK: usrs.cpp c:usrs.cpp@154@C@ClsA@F@ClsA#I#I#@B Extent=[13:15 - 13:20] +// CHECK: usrs.cpp c:@N@foo Extent=[16:1 - 22:2] +// CHECK: usrs.cpp c:@N@foo@C@ClsB Extent=[17:3 - 21:4] +// CHECK: usrs.cpp c: Extent=[18:3 - 18:10] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@ClsB# Extent=[19:5 - 19:27] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[20:5 - 20:23] +// CHECK: usrs.cpp c:@N@foo@C@ClsB@F@result#1 Extent=[24:1 - 26:2] +// CHECK: usrs.cpp c:@aN@C@ClsC Extent=[29:3 - 29:35] +// CHECK: usrs.cpp c:@aN@w Extent=[30:3 - 30:8] +// CHECK: usrs.cpp c:@z Extent=[33:1 - 33:6] +// CHECK: usrs.cpp c:@N@foo Extent=[35:1 - 40:2] +// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[35:17 - 39:2] +// CHECK: usrs.cpp c:@N@foo@N@taz@x Extent=[36:3 - 36:8] +// CHECK: usrs.cpp c:usrs.cpp@457@N@foo@N@taz@F@add#I#I# Extent=[37:3 - 37:56] +// CHECK: usrs.cpp c:usrs.cpp@479@N@foo@N@taz@F@add#I#I#@a Extent=[37:25 - 37:30] +// CHECK: usrs.cpp c:usrs.cpp@486@N@foo@N@taz@F@add#I#I#@b Extent=[37:32 - 37:37] +// CHECK: usrs.cpp c:@N@foo@N@taz@F@sub#I#I# Extent=[38:3 - 38:25] +// CHECK: usrs.cpp c:usrs.cpp@522@N@foo@N@taz@F@sub#I#I#@a Extent=[38:12 - 38:17] +// CHECK: usrs.cpp c:usrs.cpp@529@N@foo@N@taz@F@sub#I#I#@b Extent=[38:19 - 38:24] +// CHECK: usrs.cpp c:@N@foo Extent=[42:1 - 52:3] +// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[42:17 - 52:2] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD Extent=[43:3 - 51:4] +// CHECK: usrs.cpp c: Extent=[44:3 - 44:10] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#I# Extent=[45:5 - 45:52] +// CHECK: usrs.cpp c:usrs.cpp@638@N@foo@N@taz@C@ClsD@F@operator=#I#@x Extent=[45:21 - 45:26] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#d# Extent=[46:5 - 46:61] +// CHECK: usrs.cpp c:usrs.cpp@690@N@foo@N@taz@C@ClsD@F@operator=#d#@x Extent=[46:21 - 46:29] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator=#&1$@N@foo@N@taz@C@ClsD# Extent=[47:5 - 47:62] +// CHECK: usrs.cpp c:usrs.cpp@751@N@foo@N@taz@C@ClsD@F@operator=#&1$@N@foo@N@taz@C@ClsD#@x Extent=[47:21 - 47:34] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@qux#S Extent=[48:5 - 48:21] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@uz#I.#S Extent=[49:5 - 49:30] +// CHECK: usrs.cpp c:usrs.cpp@833@N@foo@N@taz@C@ClsD@F@uz#I.#S@z Extent=[49:19 - 49:24] +// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator==#&1$@N@foo@N@taz@C@ClsD#1 Extent=[50:5 - 50:62] +// CHECK: usrs.cpp c:usrs.cpp@866@N@foo@N@taz@C@ClsD@F@operator==#&1$@N@foo@N@taz@C@ClsD#1@x Extent=[50:21 - 50:34] +// CHECK: usrs.cpp c:@F@rez Extent=[55:3 - 55:25] +// CHECK: usrs.cpp c:usrs.cpp@941@F@rez@a Extent=[55:12 - 55:17] +// CHECK: usrs.cpp c:usrs.cpp@948@F@rez@b Extent=[55:19 - 55:24] +// CHECK: usrs.cpp c:@NA@foo_alias +// CHECK-NOT: foo +// CHECK: usrs.cpp c:@NA@foo_alias2 +// CHECK-NOT: ClsB +// CHECK: usrs.cpp c:@NA@foo_alias3 +// CHECK: usrs.cpp c:@aN Extent=[68:1 - 73:2] +// CHECK: usrs.cpp c:@aN@C@RDar9371763_Foo Extent=[69:1 - 72:2] +// CHECK: usrs.cpp c: Extent=[70:1 - 70:8] +// CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[71:3 - 71:13] +// CHECK: usrs.cpp c:usrs.cpp@1131@aN@C@RDar9371763_Foo@F@bar# Extent=[75:1 - 75:31] +// CHECK: usrs.cpp c:@F@rdar9371763# Extent=[77:1 - 80:2] +// CHECK: usrs.cpp c:usrs.cpp@1204@F@rdar9371763#@foo Extent=[78:3 - 78:22] + diff --git a/clang/test/Index/usrs.m b/clang/test/Index/usrs.m new file mode 100644 index 0000000..95a5388 --- /dev/null +++ b/clang/test/Index/usrs.m @@ -0,0 +1,284 @@ + + +static inline int my_helper(int x, int y) { return x + y; } + +enum { + ABA, + CADABA +}; + +enum { + FOO, + BAR +}; + +typedef struct { + int wa; + int moo; +} MyStruct; + +enum Pizza { + CHEESE, + MUSHROOMS +}; + +@interface Foo { + id x; + id y; +} +- (id) godzilla; ++ (id) kingkong; +@property int d1; +@end + +@implementation Foo +- (id) godzilla { + static int a = 0; + extern int z; + return 0; +} ++ (id) kingkong { + int local_var; + return 0; +} +@synthesize d1; +@end + +int z; + +static int local_func(int x) { return x; } + +@interface CWithExt +- (id) meth1; +@end +@interface CWithExt () +- (id) meth2; +@end +@interface CWithExt () +- (id) meth3; +@end +@interface CWithExt (Bar) +- (id) meth4; +@end +@implementation CWithExt +- (id) meth1 { return 0; } +- (id) meth2 { return 0; } +- (id) meth3 { return 0; } +@end +@implementation CWithExt (Bar) +- (id) meth4 { return 0; } +@end + +void aux_1(int, int, int); +int test_multi_declaration(void) { + int foo = 1, bar = 2, baz = 3; + aux_1(foo, bar, baz); + return 0; +} + +@protocol P1 +- (void)method; +@end + +@interface CWithExt2 +@end +@interface CWithExt2 () { + id var_ext; +} +@property (assign) id pro_ext; +@end + +// RUN: c-index-test -test-load-source-usrs all -target x86_64-apple-macosx10.7 %s | FileCheck %s +// CHECK: usrs.m c:usrs.m@67@F@my_helper Extent=[3:1 - 3:60] +// CHECK: usrs.m c:usrs.m@95@F@my_helper@x Extent=[3:29 - 3:34] +// CHECK: usrs.m c:usrs.m@102@F@my_helper@y Extent=[3:36 - 3:41] +// CHECK: usrs.m c:usrs.m@128@Ea Extent=[5:1 - 8:2] +// CHECK: usrs.m c:usrs.m@128@Ea@ABA Extent=[6:3 - 6:6] +// CHECK: usrs.m c:usrs.m@128@Ea@CADABA Extent=[7:3 - 7:9] +// CHECK: usrs.m c:usrs.m@155@Ea Extent=[10:1 - 13:2] +// CHECK: usrs.m c:usrs.m@155@Ea@FOO Extent=[11:3 - 11:6] +// CHECK: usrs.m c:usrs.m@155@Ea@BAR Extent=[12:3 - 12:6] +// CHECK: usrs.m c:@SA@MyStruct Extent=[15:9 - 18:2] +// CHECK: usrs.m c:@SA@MyStruct@FI@wa Extent=[16:3 - 16:9] +// CHECK: usrs.m c:@SA@MyStruct@FI@moo Extent=[17:3 - 17:10] +// CHECK: usrs.m c:usrs.m@179@T@MyStruct Extent=[15:1 - 18:11] +// CHECK: usrs.m c:@E@Pizza Extent=[20:1 - 23:2] +// CHECK: usrs.m c:@E@Pizza@CHEESE Extent=[21:3 - 21:9] +// CHECK: usrs.m c:@E@Pizza@MUSHROOMS Extent=[22:3 - 22:12] +// CHECK: usrs.m c:objc(cs)Foo Extent=[25:1 - 32:5] +// CHECK: usrs.m c:objc(cs)Foo@x Extent=[26:3 - 26:7] +// CHECK: usrs.m c:objc(cs)Foo@y Extent=[27:3 - 27:7] +// CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[29:1 - 29:17] +// CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[30:1 - 30:17] +// CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[31:1 - 31:17] +// CHECK: usrs.m c:objc(cs)Foo(im)d1 Extent=[31:15 - 31:17] +// CHECK: usrs.m c:objc(cs)Foo(im)setD1: Extent=[31:15 - 31:17] +// CHECK: usrs.m c:usrs.m@352objc(cs)Foo(im)setD1:@d1 Extent=[31:15 - 31:17] +// CHECK: usrs.m c:objc(cs)Foo Extent=[34:1 - 45:2] +// CHECK: usrs.m c:objc(cs)Foo(im)godzilla Extent=[35:1 - 39:2] +// CHECK: usrs.m c:usrs.m@402objc(cs)Foo(im)godzilla@a Extent=[36:3 - 36:19] +// CHECK: usrs.m c:objc(cs)Foo(im)godzilla@z Extent=[37:3 - 37:15] +// CHECK: usrs.m c:objc(cs)Foo(cm)kingkong Extent=[40:1 - 43:2] +// CHECK: usrs.m c:usrs.m@470objc(cs)Foo(cm)kingkong@local_var Extent=[41:3 - 41:16] +// CHECK: usrs.m c:objc(cs)Foo@d1 Extent=[44:13 - 44:15] +// CHECK: usrs.m c:objc(cs)Foo(py)d1 Extent=[44:1 - 44:15] +// CHECK: usrs.m c:@z Extent=[47:1 - 47:6] +// CHECK: usrs.m c:usrs.m@529@F@local_func Extent=[49:1 - 49:43] +// CHECK: usrs.m c:usrs.m@551@F@local_func@x Extent=[49:23 - 49:28] +// CHECK: usrs.m c:objc(cs)CWithExt Extent=[51:1 - 53:5] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth1 Extent=[52:1 - 52:14] +// CHECK: usrs.m c:objc(ext)CWithExt@usrs.m@612 Extent=[54:1 - 56:5] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth2 Extent=[55:1 - 55:14] +// CHECK: usrs.m c:objc(ext)CWithExt@usrs.m@654 Extent=[57:1 - 59:5] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth3 Extent=[58:1 - 58:14] +// CHECK: usrs.m c:objc(cy)CWithExt@Bar Extent=[60:1 - 62:5] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth4 Extent=[61:1 - 61:14] +// CHECK: usrs.m c:objc(cs)CWithExt Extent=[63:1 - 67:2] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth1 Extent=[64:1 - 64:27] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth2 Extent=[65:1 - 65:27] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth3 Extent=[66:1 - 66:27] +// CHECK: usrs.m c:objc(cy)CWithExt@Bar Extent=[68:1 - 70:2] +// CHECK: usrs.m c:objc(cs)CWithExt(im)meth4 Extent=[69:1 - 69:27] +// CHECK: usrs.m c:@F@aux_1 Extent=[72:1 - 72:26] +// CHECK: usrs.m c:@F@test_multi_declaration Extent=[73:1 - 77:2] +// CHECK: usrs.m c:usrs.m@980@F@test_multi_declaration@foo Extent=[74:3 - 74:14] +// CHECK: usrs.m c:usrs.m@980@F@test_multi_declaration@bar Extent=[74:16 - 74:23] +// CHECK: usrs.m c:usrs.m@980@F@test_multi_declaration@baz Extent=[74:25 - 74:32] +// CHECK: usrs.m c:objc(pl)P1 Extent=[79:1 - 81:5] +// CHECK: usrs.m c:objc(pl)P1(im)method Extent=[80:1 - 80:16] +// CHECK: usrs.m c:objc(cs)CWithExt2 Extent=[83:1 - 84:5] +// CHECK: usrs.m c:objc(ext)CWithExt2@usrs.m@1111 Extent=[85:1 - 89:5] +// CHECK: usrs.m c:objc(cs)CWithExt2@var_ext Extent=[86:3 - 86:13] +// CHECK: usrs.m c:objc(cs)CWithExt2(py)pro_ext Extent=[88:1 - 88:30] +// CHECK: usrs.m c:objc(cs)CWithExt2(im)pro_ext Extent=[88:23 - 88:30] +// CHECK: usrs.m c:objc(cs)CWithExt2(im)setPro_ext: Extent=[88:23 - 88:30] + +// RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-source %s +// CHECK-source: usrs.m:3:19: FunctionDecl=my_helper:3:19 (Definition) Extent=[3:1 - 3:60] +// CHECK-source: usrs.m:3:33: ParmDecl=x:3:33 (Definition) Extent=[3:29 - 3:34] +// CHECK-source: usrs.m:3:40: ParmDecl=y:3:40 (Definition) Extent=[3:36 - 3:41] +// CHECK-source: usrs.m:3:43: CompoundStmt= Extent=[3:43 - 3:60] +// CHECK-source: usrs.m:3:45: ReturnStmt= Extent=[3:45 - 3:57] +// CHECK-source: usrs.m:3:52: BinaryOperator= Extent=[3:52 - 3:57] +// CHECK-source: usrs.m:3:52: DeclRefExpr=x:3:33 Extent=[3:52 - 3:53] +// CHECK-source: usrs.m:3:56: DeclRefExpr=y:3:40 Extent=[3:56 - 3:57] +// CHECK-source: usrs.m:5:1: EnumDecl=:5:1 (Definition) Extent=[5:1 - 8:2] +// CHECK-source: usrs.m:6:3: EnumConstantDecl=ABA:6:3 (Definition) Extent=[6:3 - 6:6] +// CHECK-source: usrs.m:7:3: EnumConstantDecl=CADABA:7:3 (Definition) Extent=[7:3 - 7:9] +// CHECK-source: usrs.m:10:1: EnumDecl=:10:1 (Definition) Extent=[10:1 - 13:2] +// CHECK-source: usrs.m:11:3: EnumConstantDecl=FOO:11:3 (Definition) Extent=[11:3 - 11:6] +// CHECK-source: usrs.m:12:3: EnumConstantDecl=BAR:12:3 (Definition) Extent=[12:3 - 12:6] +// CHECK-source: usrs.m:18:3: TypedefDecl=MyStruct:18:3 (Definition) Extent=[15:1 - 18:11] +// CHECK-source: usrs.m:15:9: StructDecl=:15:9 (Definition) Extent=[15:9 - 18:2] +// CHECK-source: usrs.m:16:7: FieldDecl=wa:16:7 (Definition) Extent=[16:3 - 16:9] +// CHECK-source: usrs.m:17:7: FieldDecl=moo:17:7 (Definition) Extent=[17:3 - 17:10] +// CHECK-source: usrs.m:20:6: EnumDecl=Pizza:20:6 (Definition) Extent=[20:1 - 23:2] +// CHECK-source: usrs.m:21:3: EnumConstantDecl=CHEESE:21:3 (Definition) Extent=[21:3 - 21:9] +// CHECK-source: usrs.m:22:3: EnumConstantDecl=MUSHROOMS:22:3 (Definition) Extent=[22:3 - 22:12] +// CHECK-source: usrs.m:25:12: ObjCInterfaceDecl=Foo:25:12 Extent=[25:1 - 32:5] +// CHECK-source: usrs.m:26:6: ObjCIvarDecl=x:26:6 (Definition) Extent=[26:3 - 26:7] +// CHECK-source: usrs.m:26:3: TypeRef=id:0:0 Extent=[26:3 - 26:5] +// CHECK-source: usrs.m:27:6: ObjCIvarDecl=y:27:6 (Definition) Extent=[27:3 - 27:7] +// CHECK-source: usrs.m:27:3: TypeRef=id:0:0 Extent=[27:3 - 27:5] +// CHECK-source: usrs.m:29:8: ObjCInstanceMethodDecl=godzilla:29:8 Extent=[29:1 - 29:17] +// CHECK-source: usrs.m:29:4: TypeRef=id:0:0 Extent=[29:4 - 29:6] +// CHECK-source: usrs.m:30:8: ObjCClassMethodDecl=kingkong:30:8 Extent=[30:1 - 30:17] +// CHECK-source: usrs.m:30:4: TypeRef=id:0:0 Extent=[30:4 - 30:6] +// CHECK-source: usrs.m:31:15: ObjCPropertyDecl=d1:31:15 Extent=[31:1 - 31:17] +// CHECK-source: usrs.m:31:15: ObjCInstanceMethodDecl=d1:31:15 Extent=[31:15 - 31:17] +// CHECK-source: usrs.m:31:15: ObjCInstanceMethodDecl=setD1::31:15 Extent=[31:15 - 31:17] +// CHECK-source: usrs.m:31:15: ParmDecl=d1:31:15 (Definition) Extent=[31:15 - 31:17] +// CHECK-source: usrs.m:34:17: ObjCImplementationDecl=Foo:34:17 (Definition) Extent=[34:1 - 45:2] +// CHECK-source: usrs.m:35:8: ObjCInstanceMethodDecl=godzilla:35:8 (Definition) Extent=[35:1 - 39:2] +// CHECK-source: usrs.m:35:4: TypeRef=id:0:0 Extent=[35:4 - 35:6] +// CHECK-source: usrs.m:35:17: CompoundStmt= Extent=[35:17 - 39:2] +// CHECK-source: usrs.m:36:3: DeclStmt= Extent=[36:3 - 36:20] +// CHECK-source: usrs.m:36:14: VarDecl=a:36:14 (Definition) Extent=[36:3 - 36:19] +// CHECK-source: usrs.m:36:18: IntegerLiteral= Extent=[36:18 - 36:19] +// CHECK-source: usrs.m:37:3: DeclStmt= Extent=[37:3 - 37:16] +// CHECK-source: usrs.m:37:14: VarDecl=z:37:14 Extent=[37:3 - 37:15] +// CHECK-source: usrs.m:38:3: ReturnStmt= Extent=[38:3 - 38:11] +// CHECK-source: usrs.m:38:10: UnexposedExpr= Extent=[38:10 - 38:11] +// CHECK-source: usrs.m:38:10: IntegerLiteral= Extent=[38:10 - 38:11] +// CHECK-source: usrs.m:40:8: ObjCClassMethodDecl=kingkong:40:8 (Definition) Extent=[40:1 - 43:2] +// CHECK-source: usrs.m:40:4: TypeRef=id:0:0 Extent=[40:4 - 40:6] +// CHECK-source: usrs.m:40:17: CompoundStmt= Extent=[40:17 - 43:2] +// CHECK-source: usrs.m:41:3: DeclStmt= Extent=[41:3 - 41:17] +// CHECK-source: usrs.m:41:7: VarDecl=local_var:41:7 (Definition) Extent=[41:3 - 41:16] +// CHECK-source: usrs.m:42:3: ReturnStmt= Extent=[42:3 - 42:11] +// CHECK-source: usrs.m:42:10: UnexposedExpr= Extent=[42:10 - 42:11] +// CHECK-source: usrs.m:42:10: IntegerLiteral= Extent=[42:10 - 42:11] +// CHECK-source: usrs.m:44:13: ObjCIvarDecl=d1:44:13 (Definition) Extent=[44:13 - 44:15] +// CHECK-source: usrs.m:44:13: ObjCSynthesizeDecl=d1:31:15 (Definition) Extent=[44:1 - 44:15] +// CHECK-source: usrs.m:47:5: VarDecl=z:47:5 Extent=[47:1 - 47:6] +// CHECK-source: usrs.m:49:12: FunctionDecl=local_func:49:12 (Definition) Extent=[49:1 - 49:43] +// CHECK-source: usrs.m:49:27: ParmDecl=x:49:27 (Definition) Extent=[49:23 - 49:28] +// CHECK-source: usrs.m:49:30: CompoundStmt= Extent=[49:30 - 49:43] +// CHECK-source: usrs.m:49:32: ReturnStmt= Extent=[49:32 - 49:40] +// CHECK-source: usrs.m:49:39: DeclRefExpr=x:49:27 Extent=[49:39 - 49:40] +// CHECK-source: usrs.m:51:12: ObjCInterfaceDecl=CWithExt:51:12 Extent=[51:1 - 53:5] +// CHECK-source: usrs.m:52:8: ObjCInstanceMethodDecl=meth1:52:8 Extent=[52:1 - 52:14] +// CHECK-source: usrs.m:52:4: TypeRef=id:0:0 Extent=[52:4 - 52:6] +// CHECK-source: usrs.m:54:12: ObjCCategoryDecl=:54:12 Extent=[54:1 - 56:5] +// CHECK-source: usrs.m:54:12: ObjCClassRef=CWithExt:51:12 Extent=[54:12 - 54:20] +// CHECK-source: usrs.m:55:8: ObjCInstanceMethodDecl=meth2:55:8 Extent=[55:1 - 55:14] +// CHECK-source: usrs.m:55:4: TypeRef=id:0:0 Extent=[55:4 - 55:6] +// CHECK-source: usrs.m:57:12: ObjCCategoryDecl=:57:12 Extent=[57:1 - 59:5] +// CHECK-source: usrs.m:57:12: ObjCClassRef=CWithExt:51:12 Extent=[57:12 - 57:20] +// CHECK-source: usrs.m:58:8: ObjCInstanceMethodDecl=meth3:58:8 Extent=[58:1 - 58:14] +// CHECK-source: usrs.m:58:4: TypeRef=id:0:0 Extent=[58:4 - 58:6] +// CHECK-source: usrs.m:60:12: ObjCCategoryDecl=Bar:60:12 Extent=[60:1 - 62:5] +// CHECK-source: usrs.m:60:12: ObjCClassRef=CWithExt:51:12 Extent=[60:12 - 60:20] +// CHECK-source: usrs.m:61:8: ObjCInstanceMethodDecl=meth4:61:8 Extent=[61:1 - 61:14] +// CHECK-source: usrs.m:61:4: TypeRef=id:0:0 Extent=[61:4 - 61:6] +// CHECK-source: usrs.m:63:17: ObjCImplementationDecl=CWithExt:63:17 (Definition) Extent=[63:1 - 67:2] +// CHECK-source: usrs.m:64:8: ObjCInstanceMethodDecl=meth1:64:8 (Definition) Extent=[64:1 - 64:27] +// CHECK-source: usrs.m:64:4: TypeRef=id:0:0 Extent=[64:4 - 64:6] +// CHECK-source: usrs.m:64:14: CompoundStmt= Extent=[64:14 - 64:27] +// CHECK-source: usrs.m:64:16: ReturnStmt= Extent=[64:16 - 64:24] +// CHECK-source: usrs.m:64:23: UnexposedExpr= Extent=[64:23 - 64:24] +// CHECK-source: usrs.m:64:23: IntegerLiteral= Extent=[64:23 - 64:24] +// CHECK-source: usrs.m:65:8: ObjCInstanceMethodDecl=meth2:65:8 (Definition) Extent=[65:1 - 65:27] +// CHECK-source: usrs.m:65:4: TypeRef=id:0:0 Extent=[65:4 - 65:6] +// CHECK-source: usrs.m:65:14: CompoundStmt= Extent=[65:14 - 65:27] +// CHECK-source: usrs.m:65:16: ReturnStmt= Extent=[65:16 - 65:24] +// CHECK-source: usrs.m:65:23: UnexposedExpr= Extent=[65:23 - 65:24] +// CHECK-source: usrs.m:65:23: IntegerLiteral= Extent=[65:23 - 65:24] +// CHECK-source: usrs.m:66:8: ObjCInstanceMethodDecl=meth3:66:8 (Definition) Extent=[66:1 - 66:27] +// CHECK-source: usrs.m:66:4: TypeRef=id:0:0 Extent=[66:4 - 66:6] +// CHECK-source: usrs.m:66:14: CompoundStmt= Extent=[66:14 - 66:27] +// CHECK-source: usrs.m:66:16: ReturnStmt= Extent=[66:16 - 66:24] +// CHECK-source: usrs.m:66:23: UnexposedExpr= Extent=[66:23 - 66:24] +// CHECK-source: usrs.m:66:23: IntegerLiteral= Extent=[66:23 - 66:24] +// CHECK-source: usrs.m:68:17: ObjCCategoryImplDecl=Bar:68:17 (Definition) Extent=[68:1 - 70:2] +// CHECK-source: usrs.m:68:17: ObjCClassRef=CWithExt:51:12 Extent=[68:17 - 68:25] +// CHECK-source: usrs.m:69:8: ObjCInstanceMethodDecl=meth4:69:8 (Definition) Extent=[69:1 - 69:27] +// CHECK-source: usrs.m:69:4: TypeRef=id:0:0 Extent=[69:4 - 69:6] +// CHECK-source: usrs.m:69:14: CompoundStmt= Extent=[69:14 - 69:27] +// CHECK-source: usrs.m:69:16: ReturnStmt= Extent=[69:16 - 69:24] +// CHECK-source: usrs.m:69:23: UnexposedExpr= Extent=[69:23 - 69:24] +// CHECK-source: usrs.m:69:23: IntegerLiteral= Extent=[69:23 - 69:24] +// CHECK-source: usrs.m:72:6: FunctionDecl=aux_1:72:6 Extent=[72:1 - 72:26] +// CHECK-source: usrs.m:72:15: ParmDecl=:72:15 (Definition) Extent=[72:12 - 72:16] +// CHECK-source: usrs.m:72:20: ParmDecl=:72:20 (Definition) Extent=[72:17 - 72:21] +// CHECK-source: usrs.m:72:25: ParmDecl=:72:25 (Definition) Extent=[72:22 - 72:26] +// CHECK-source: usrs.m:73:5: FunctionDecl=test_multi_declaration:73:5 (Definition) Extent=[73:1 - 77:2] +// CHECK-source: usrs.m:73:34: CompoundStmt= Extent=[73:34 - 77:2] +// CHECK-source: usrs.m:74:3: DeclStmt= Extent=[74:3 - 74:33] +// CHECK-source: usrs.m:74:7: VarDecl=foo:74:7 (Definition) Extent=[74:3 - 74:14] +// CHECK-source: usrs.m:74:13: IntegerLiteral= Extent=[74:13 - 74:14] +// CHECK-source: usrs.m:74:16: VarDecl=bar:74:16 Extent=[74:16 - 74:23] +// CHECK-source: usrs.m:74:22: IntegerLiteral= Extent=[74:22 - 74:23] +// CHECK-source: usrs.m:74:25: VarDecl=baz:74:25 Extent=[74:25 - 74:32] +// CHECK-source: usrs.m:74:31: IntegerLiteral= Extent=[74:31 - 74:32] +// CHECK-source: usrs.m:75:3: CallExpr=aux_1:72:6 Extent=[75:3 - 75:23] +// CHECK-source: usrs.m:75:3: UnexposedExpr=aux_1:72:6 Extent=[75:3 - 75:8] +// CHECK-source: usrs.m:75:3: DeclRefExpr=aux_1:72:6 Extent=[75:3 - 75:8] +// CHECK-source: usrs.m:75:9: DeclRefExpr=foo:74:7 Extent=[75:9 - 75:12] +// CHECK-source: usrs.m:75:14: DeclRefExpr=bar:74:16 Extent=[75:14 - 75:17] +// CHECK-source: usrs.m:75:19: DeclRefExpr=baz:74:25 Extent=[75:19 - 75:22] +// CHECK-source: usrs.m:76:3: ReturnStmt= Extent=[76:3 - 76:11] +// CHECK-source: usrs.m:76:10: IntegerLiteral= Extent=[76:10 - 76:11] +// CHECK-source: usrs.m:79:11: ObjCProtocolDecl=P1:79:11 (Definition) Extent=[79:1 - 81:5] +// CHECK-source: usrs.m:80:9: ObjCInstanceMethodDecl=method:80:9 Extent=[80:1 - 80:16] + diff --git a/clang/test/Index/vector-types.c b/clang/test/Index/vector-types.c new file mode 100644 index 0000000..404e4a5 --- /dev/null +++ b/clang/test/Index/vector-types.c @@ -0,0 +1,6 @@ +int __attribute__((vector_size(16))) x; +typedef int __attribute__((vector_size(16))) int4_t; + +// RUN: c-index-test -test-print-typekind %s | FileCheck %s +// CHECK: VarDecl=x:1:38 typekind=Vector [isPOD=1] +// CHECK: TypedefDecl=int4_t:2:46 (Definition) typekind=Typedef [canonical=Vector] [isPOD=1] diff --git a/clang/test/Index/warning-flags.c b/clang/test/Index/warning-flags.c new file mode 100644 index 0000000..b76662e --- /dev/null +++ b/clang/test/Index/warning-flags.c @@ -0,0 +1,16 @@ +int foo() { } +int *bar(float *f) { return f; } + +// RUN: c-index-test -test-load-source all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s +// RUN: c-index-test -test-load-source-reparse 5 all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s +// RUN: c-index-test -test-load-source all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s +// RUN: c-index-test -test-load-source-reparse 5 all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s +// RUN: c-index-test -test-load-source all -w %s 2>&1|not grep warning: +// RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1|not grep warning: + +// CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function +// CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float *' from a function with result type 'int *' + +// CHECK-SECOND-WARNING-NOT:control reaches end of non-void +// CHECK-SECOND-WARNING: warning: incompatible pointer types returning 'float *' from a function with result type 'int *' + diff --git a/clang/test/Index/werror.c b/clang/test/Index/werror.c new file mode 100644 index 0000000..98b602a --- /dev/null +++ b/clang/test/Index/werror.c @@ -0,0 +1,12 @@ +inline int *get_int_ptr(float *fp) { + return fp; +} + +#ifdef FATAL +void fatal(int); +void fatal(float); +#endif + +// RUN: c-index-test -write-pch %t.pch -Werror %s +// RUN: c-index-test -write-pch %t.pch -DFATAL -Werror %s + |