aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-unnamed.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
commitbca07a4524feb4edec581062d631a13116320a24 (patch)
treea9243275843fbeaa590afc07ee888e006b8d54ea /test/CodeGenCXX/mangle-unnamed.cpp
parent998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff)
Notes
Diffstat (limited to 'test/CodeGenCXX/mangle-unnamed.cpp')
-rw-r--r--test/CodeGenCXX/mangle-unnamed.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-unnamed.cpp b/test/CodeGenCXX/mangle-unnamed.cpp
index 83b46d69454e..53f381c3a011 100644
--- a/test/CodeGenCXX/mangle-unnamed.cpp
+++ b/test/CodeGenCXX/mangle-unnamed.cpp
@@ -69,3 +69,24 @@ int f7() {
// CHECK: _ZZ2f7vE1a
return a.b;
}
+
+// This used to cause an assert because the typedef-for-anonymous-tag
+// code was trying to claim the enum for the template.
+enum { T8 };
+template <class T> struct Test8 {
+ typedef T type;
+ Test8(type t) {} // tested later
+};
+template <class T> void make_test8(T value) { Test8<T> t(value); }
+void test8() { make_test8(T8); }
+
+// CHECK: define internal void @"_ZNV3$_35test9Ev"(
+typedef volatile struct {
+ void test9() volatile {}
+} Test9;
+void test9() {
+ Test9 a;
+ a.test9();
+}
+
+// CHECK: define internal void @"_ZN5Test8I3$_2EC1ES0_"(