[cfe-commits] r75601 - in /cfe/trunk/test/Index: cxx-operator-overload-input.cpp cxx-operator-overload.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Mon Jul 13 20:19:46 PDT 2009


Author: akirtzidis
Date: Mon Jul 13 22:19:46 2009
New Revision: 75601

URL: http://llvm.org/viewvc/llvm-project?rev=75601&view=rev
Log:
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 :-)

Added:
    cfe/trunk/test/Index/cxx-operator-overload-input.cpp
    cfe/trunk/test/Index/cxx-operator-overload.cpp

Added: cfe/trunk/test/Index/cxx-operator-overload-input.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cxx-operator-overload-input.cpp?rev=75601&view=auto

==============================================================================
--- cfe/trunk/test/Index/cxx-operator-overload-input.cpp (added)
+++ cfe/trunk/test/Index/cxx-operator-overload-input.cpp Mon Jul 13 22:19:46 2009
@@ -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) {
+}

Added: cfe/trunk/test/Index/cxx-operator-overload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cxx-operator-overload.cpp?rev=75601&view=auto

==============================================================================
--- cfe/trunk/test/Index/cxx-operator-overload.cpp (added)
+++ cfe/trunk/test/Index/cxx-operator-overload.cpp Mon Jul 13 22:19:46 2009
@@ -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,'





More information about the cfe-commits mailing list