From: Argyrios Kyrtzidis Date: Tue, 14 Jul 2009 03:19:46 +0000 (+0000) Subject: Add a C++ indexing test case, where we show the references of overloaded '+' plus... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba4b8bd33206f695923d117f2711c486873da86d;p=clang Add a C++ indexing test case, where we show the references of overloaded '+' plus signs. Ok, this is a bit out of place since C++ support is way way off, but it was just too cool to not show it off :-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75601 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Index/cxx-operator-overload-input.cpp b/test/Index/cxx-operator-overload-input.cpp new file mode 100644 index 0000000000..f0503ae68b --- /dev/null +++ b/test/Index/cxx-operator-overload-input.cpp @@ -0,0 +1,12 @@ +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) { +} diff --git a/test/Index/cxx-operator-overload.cpp b/test/Index/cxx-operator-overload.cpp new file mode 100644 index 0000000000..54d6896f32 --- /dev/null +++ b/test/Index/cxx-operator-overload.cpp @@ -0,0 +1,9 @@ +// RUN: clang-cc -emit-pch %S/cxx-operator-overload-input.cpp -o %t.ast && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | count 2 && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | grep ':3:9,' && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | grep ':11:10,' && + +// Yep, we can show references of '+' plus signs that are overloaded, w00t! +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | count 2 && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | grep ':8:17,' && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | grep ':8:22,'