| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 1 | // Test is line- and column-sensitive; see below. | 
|  | 2 |  | 
|  | 3 | struct X { | 
|  | 4 | X(int value); | 
|  | 5 | X(const X& x); | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 6 | protected: | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 7 | ~X(); | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 8 | private: | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 9 | operator X*(); | 
| Dmitri Gribenko | e570ede | 2014-04-07 14:59:13 +0000 | [diff] [blame] | 10 |  | 
|  | 11 | void constMemberFunction() const; | 
|  | 12 | template<typename T> | 
|  | 13 | void constMemberFunctionTemplate() const; | 
|  | 14 |  | 
|  | 15 | static void staticMemberFunction(); | 
|  | 16 | template<typename T> | 
|  | 17 | static void staticMemberFunctionTemplate(); | 
|  | 18 |  | 
|  | 19 | virtual void virtualMemberFunction(); | 
|  | 20 | virtual void pureVirtualMemberFunction() = 0; | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 21 | }; | 
|  | 22 |  | 
| Douglas Gregor | 3335f48 | 2010-09-02 17:35:32 +0000 | [diff] [blame] | 23 | X::X(int value) { | 
|  | 24 | } | 
|  | 25 |  | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 26 | // RUN: c-index-test -test-load-source all %s | FileCheck %s | 
| Dmitri Gribenko | e570ede | 2014-04-07 14:59:13 +0000 | [diff] [blame] | 27 | // CHECK: load-classes.cpp:3:8: StructDecl=X:3:8 (Definition) Extent=[3:1 - 21:2] | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 28 | // CHECK: load-classes.cpp:4:3: CXXConstructor=X:4:3 Extent=[4:3 - 4:15] [access=public] | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 29 | // FIXME: missing TypeRef in the constructor name | 
|  | 30 | // CHECK: load-classes.cpp:4:9: ParmDecl=value:4:9 (Definition) Extent=[4:5 - 4:14] | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 31 | // CHECK: load-classes.cpp:5:3: CXXConstructor=X:5:3 Extent=[5:3 - 5:16] [access=public] | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 32 | // FIXME: missing TypeRef in the constructor name | 
| Abramo Bagnara | dff1930 | 2011-03-08 08:55:46 +0000 | [diff] [blame] | 33 | // CHECK: load-classes.cpp:5:14: ParmDecl=x:5:14 (Definition) Extent=[5:5 - 5:15] | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 34 | // CHECK: load-classes.cpp:5:11: TypeRef=struct X:3:8 Extent=[5:11 - 5:12] | 
| Dmitri Gribenko | e570ede | 2014-04-07 14:59:13 +0000 | [diff] [blame] | 35 | // CHECK: load-classes.cpp:6:1: CXXAccessSpecifier=:6:1 (Definition) Extent=[6:1 - 6:11] [access=protected] | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 36 | // CHECK: load-classes.cpp:7:3: CXXDestructor=~X:7:3 Extent=[7:3 - 7:7] [access=protected] | 
| Douglas Gregor | 12bca22 | 2010-08-31 14:41:23 +0000 | [diff] [blame] | 37 | // FIXME: missing TypeRef in the destructor name | 
| Dmitri Gribenko | e570ede | 2014-04-07 14:59:13 +0000 | [diff] [blame] | 38 | // CHECK: load-classes.cpp:8:1: CXXAccessSpecifier=:8:1 (Definition) Extent=[8:1 - 8:9] [access=private] | 
| Richard Smith | e81daee | 2014-01-22 00:27:42 +0000 | [diff] [blame] | 39 | // CHECK: load-classes.cpp:9:3: CXXConversion=operator X *:9:3 Extent=[9:3 - 9:16] [access=private] | 
| Argyrios Kyrtzidis | 1ab09cc | 2013-04-11 17:02:10 +0000 | [diff] [blame] | 40 | // CHECK: load-classes.cpp:9:12: TypeRef=struct X:3:8 Extent=[9:12 - 9:13] | 
| Dmitri Gribenko | e570ede | 2014-04-07 14:59:13 +0000 | [diff] [blame] | 41 | // CHECK: load-classes.cpp:11:8: CXXMethod=constMemberFunction:11:8 (const) Extent=[11:3 - 11:35] [access=private] | 
|  | 42 | // CHECK: load-classes.cpp:13:8: FunctionTemplate=constMemberFunctionTemplate:13:8 (const) Extent=[12:3 - 13:43] [access=private] | 
|  | 43 | // CHECK: load-classes.cpp:12:21: TemplateTypeParameter=T:12:21 (Definition) Extent=[12:12 - 12:22] [access=public] | 
|  | 44 | // CHECK: load-classes.cpp:15:15: CXXMethod=staticMemberFunction:15:15 (static) Extent=[15:3 - 15:37] [access=private] | 
|  | 45 | // CHECK: load-classes.cpp:17:15: FunctionTemplate=staticMemberFunctionTemplate:17:15 (static) Extent=[16:3 - 17:45] [access=private] | 
|  | 46 | // CHECK: load-classes.cpp:16:21: TemplateTypeParameter=T:16:21 (Definition) Extent=[16:12 - 16:22] [access=public] | 
|  | 47 | // CHECK: load-classes.cpp:19:16: CXXMethod=virtualMemberFunction:19:16 (virtual) Extent=[19:3 - 19:39] [access=private] | 
|  | 48 | // CHECK: load-classes.cpp:20:16: CXXMethod=pureVirtualMemberFunction:20:16 (virtual) (pure) Extent=[20:3 - 20:47] [access=private] | 
|  | 49 | // CHECK: load-classes.cpp:23:4: CXXConstructor=X:23:4 (Definition) Extent=[23:1 - 24:2] [access=public] | 
|  | 50 | // CHECK: load-classes.cpp:23:1: TypeRef=struct X:3:8 Extent=[23:1 - 23:2] | 
|  | 51 | // CHECK: load-classes.cpp:23:10: ParmDecl=value:23:10 (Definition) Extent=[23:6 - 23:15] | 
|  | 52 | // CHECK: load-classes.cpp:23:17: CompoundStmt= Extent=[23:17 - 24:2] |