aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-05-07 01:04:23 +0000
committerTed Kremenek <kremenek@apple.com>2010-05-07 01:04:23 +0000
commitd5d90fedcc07222acde24dce357266161836b302 (patch)
tree069036dc6cd85677c331b04f405db0361c5e2fdd
parent3e5d00c2c727e54d96ce984edfc5cca4710eae10 (diff)
Add USR test case for C++ operator methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103223 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Index/usrs.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Index/usrs.cpp b/test/Index/usrs.cpp
index a0d910d9a8..a8b42690e2 100644
--- a/test/Index/usrs.cpp
+++ b/test/Index/usrs.cpp
@@ -39,6 +39,14 @@ namespace foo { namespace taz {
}
}
+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; }
+ };
+}}
+
// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s
// CHECK: usrs.cpp c:@N@foo Extent=[1:11 - 4:2]
// CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8]
@@ -71,3 +79,13 @@ namespace foo { namespace taz {
// CHECK: usrs.cpp c:@N@foo@N@taz@F@sub Extent=[38:8 - 38:25]
// CHECK: usrs.cpp c:usrs.cpp@38:12@N@foo@N@taz@F@sub@a Extent=[38:12 - 38:17]
// CHECK: usrs.cpp c:usrs.cpp@38:19@N@foo@N@taz@F@sub@b Extent=[38:19 - 38:24]
+// CHECK: usrs.cpp c:@N@foo Extent=[42:11 - 48:3]
+// CHECK: usrs.cpp c:@N@foo@N@taz Extent=[42:27 - 48:2]
+// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD Extent=[43:3 - 47:4]
+// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator= Extent=[45:11 - 45:52]
+// CHECK: usrs.cpp c:usrs.cpp@45:21@N@foo@N@taz@C@ClsD@F@operator=@x Extent=[45:21 - 45:26]
+// CHECK: usrs.cpp c:@N@foo@N@taz@C@ClsD@F@operator= Extent=[46:11 - 46:61]
+// CHECK: usrs.cpp c:usrs.cpp@46:21@N@foo@N@taz@C@ClsD@F@operator=@x Extent=[46:21 - 46:29]
+
+
+