diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-03 00:35:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-03 00:35:38 +0000 |
commit | 40749ee585abc84fbb3c8fdbd8aaac062f153062 (patch) | |
tree | eff7f3f3a45a005227e3bb4e7108b27b1adc359f /test/Index/get-cursor.cpp | |
parent | 0582c897ec7261b4c6af0fe26dc2a0b6b54d266c (diff) |
Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/get-cursor.cpp')
-rw-r--r-- | test/Index/get-cursor.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Index/get-cursor.cpp b/test/Index/get-cursor.cpp new file mode 100644 index 0000000000..a1974b63a5 --- /dev/null +++ b/test/Index/get-cursor.cpp @@ -0,0 +1,30 @@ +// 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(); +} + +// 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 + +// FIXME: c-index-test -cursor-at=%s:12:18 %s | FileCheck -check-prefix=CHECK-TYPE-REF %s +// RUN: c-index-test -cursor-at=%s:13:18 %s | FileCheck -check-prefix=CHECK-TYPE-REF %s +// FIXME: c-index-test -cursor-at=%s:14:19 %s | FileCheck -check-prefix=CHECK-TYPE-REF %s +// RUN: c-index-test -cursor-at=%s:17:10 %s | FileCheck -check-prefix=CHECK-TYPE-REF %s +// CHECK-TYPE-REF: TypeRef=struct X:3:8 |