summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/mangle.cpp22
-rw-r--r--clang/test/CodeGenCXX/member-functions.cpp2
2 files changed, 21 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp
index 090a3f17eef..88465cf9d98 100644
--- a/clang/test/CodeGenCXX/mangle.cpp
+++ b/clang/test/CodeGenCXX/mangle.cpp
@@ -141,7 +141,7 @@ int f(struct a *x) {
// PR5017
extern "C" {
struct Debug {
- const Debug& operator<< (unsigned a) const { }
+ const Debug& operator<< (unsigned a) const { return *this; }
};
Debug dbg;
// CHECK: @_ZNK5DebuglsEj
@@ -270,5 +270,23 @@ template void f4<1>(int (*)[4]);
// CHECK: define void @_ZN11Expressions2f4ILb1EEEvPAquT_Li1ELi2E_i
template <bool b> void f4(int (*)[b ? 1 : 2]) { };
template void f4<true>(int (*)[1]);
-
}
+
+struct Ops {
+ Ops& operator+(const Ops&);
+ Ops& operator-(const Ops&);
+ Ops& operator&(const Ops&);
+ Ops& operator*(const Ops&);
+
+ void *v;
+};
+
+// CHECK: define %struct.Ops* @_ZN3OpsplERKS_
+Ops& Ops::operator+(const Ops&) { return *this; }
+// CHECK: define %struct.Ops* @_ZN3OpsmiERKS_
+Ops& Ops::operator-(const Ops&) { return *this; }
+// CHECK: define %struct.Ops* @_ZN3OpsanERKS_
+Ops& Ops::operator&(const Ops&) { return *this; }
+// CHECK: define %struct.Ops* @_ZN3OpsmlERKS_
+Ops& Ops::operator*(const Ops&) { return *this; }
+
diff --git a/clang/test/CodeGenCXX/member-functions.cpp b/clang/test/CodeGenCXX/member-functions.cpp
index ebc9ed758be..087e62c5bb3 100644
--- a/clang/test/CodeGenCXX/member-functions.cpp
+++ b/clang/test/CodeGenCXX/member-functions.cpp
@@ -58,6 +58,6 @@ struct T {
void test3() {
T t1, t2;
- // RUN: grep "call i64 @_ZN1TpsERKS_" %t
+ // RUN: grep "call i64 @_ZN1TplERKS_" %t
T result = t1 + t2;
}
OpenPOWER on IntegriCloud