summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-28 16:49:23 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-28 16:49:23 +0000
commit15547bbdd141f1dfde6147d18b2a4e84800bfaa4 (patch)
treee06ad834a03f26d5febe542b52b54a57212632a2 /clang/test/CodeGenCXX/mangle.cpp
parent4426f5b388a02406d2fec8cb98ac19ae310284a4 (diff)
downloadbcm5719-llvm-15547bbdd141f1dfde6147d18b2a4e84800bfaa4.tar.gz
bcm5719-llvm-15547bbdd141f1dfde6147d18b2a4e84800bfaa4.zip
Be more thorough about mangling unresolved types.
llvm-svn: 134011
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp
index e39b348a8ea..d3978bc8012 100644
--- a/clang/test/CodeGenCXX/mangle.cpp
+++ b/clang/test/CodeGenCXX/mangle.cpp
@@ -711,3 +711,45 @@ namespace test27 {
b<A>(f);
}
}
+
+// An injected class name type in a unresolved-name.
+namespace test28 {
+ template <class T> struct A {
+ enum { bit };
+ };
+
+ template <class T> void foo(decltype(A<T>::A::bit) x);
+
+ void test() {
+ foo<char>(A<char>::bit);
+ // CHECK: call void @_ZN6test283fooIcEEvDtsr1AIT_E1AE3bitE(
+ }
+}
+
+// An enclosing template type parameter in an unresolved-name.
+namespace test29 {
+ template <class T> struct A {
+ template <class U> static void foo(decltype(T::fn(U())) x);
+ };
+ struct B { static int fn(int); static long fn(long); };
+
+ void test() {
+ A<B>::foo<int>(0);
+ // CHECK: call void @_ZN6test291AINS_1BEE3fooIiEEvDTclsrS1_2fncvT__EEE(
+ }
+}
+
+// An enclosing template template parameter in an unresolved-name.
+namespace test30 {
+ template <template <class> class T> struct A {
+ template <class U> static void foo(decltype(T<U>::fn()) x);
+ };
+ template <class T> struct B { static T fn(); };
+
+ void test() {
+ A<B>::foo<int>(0);
+ // FIXME: it's not clear what this mangling should be; maybe this?
+ // call void @_ZN6test301AINS_1BEE3fooIiEEvDTclsrS1_IT_EE2fnEE(
+ // Currently it's 1B instead of S1_.
+ }
+}
OpenPOWER on IntegriCloud