summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-18 19:18:59 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-18 19:18:59 +0000
commit78fbb61ed7864a206db10d811fdc5886e5f8bd02 (patch)
tree8b0baa488f65cc7b1467cb9e2037d65351f2fd86 /clang/test/CodeGenCXX/mangle.cpp
parent5b4cb08471a639400ba2bf671a3147870815c1b9 (diff)
downloadbcm5719-llvm-78fbb61ed7864a206db10d811fdc5886e5f8bd02.tar.gz
bcm5719-llvm-78fbb61ed7864a206db10d811fdc5886e5f8bd02.zip
Contextual arity is a feature of mangling expressions; kill off
mangleCallExpression. Also, operator names with unknown arity should be mangled as binary operators; this is actually covered by an oddly- positioned sentence in the ABI document. Fixes PR7891. llvm-svn: 111395
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp
index 6636c926ae4..c7a6e0096bd 100644
--- a/clang/test/CodeGenCXX/mangle.cpp
+++ b/clang/test/CodeGenCXX/mangle.cpp
@@ -557,3 +557,31 @@ namespace test17 {
func<B>(); // { dg-error "sorry, unimplemented" }
}
}
+
+// PR7891
+namespace test18 {
+ struct A {
+ int operator+();
+ int operator-();
+ int operator*();
+ int operator&();
+ };
+ template <int (A::*)()> struct S {};
+
+ template <typename T> void f(S<&T::operator+>) {}
+ template void f<A>(S<&A::operator+>);
+
+ template <typename T> void f(S<&T::operator- >) {}
+ template void f<A>(S<&A::operator- >);
+
+ template <typename T> void f(S<&T::operator*>) {}
+ template void f<A>(S<&A::operator*>);
+
+ template <typename T> void f(S<&T::operator&>) {}
+ template void f<A>(S<&A::operator&>);
+
+ // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_plEEE
+ // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_miEEE
+ // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_mlEEE
+ // CHECK: define weak_odr void @_ZN6test181fINS_1AEEEvNS_1SIXadsrT_anEEE
+}
OpenPOWER on IntegriCloud