summaryrefslogtreecommitdiff
path: root/test/CodeGenObjCXX/encode.mm
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjCXX/encode.mm')
-rw-r--r--test/CodeGenObjCXX/encode.mm23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/CodeGenObjCXX/encode.mm b/test/CodeGenObjCXX/encode.mm
index e0171efbed8a..5bb4a1ecfa9b 100644
--- a/test/CodeGenObjCXX/encode.mm
+++ b/test/CodeGenObjCXX/encode.mm
@@ -213,7 +213,7 @@ public:
dynamic_class dynamic_class_ivar;
}
@end
-// CHECK: private global [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00"
+// CHECK: private unnamed_addr constant [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00"
namespace PR17142 {
struct A { virtual ~A(); };
@@ -224,3 +224,24 @@ namespace PR17142 {
// CHECK: @_ZN7PR171421xE = constant [14 x i8] c"{E=^^?i^^?ii}\00"
extern const char x[] = @encode(E);
}
+
+// This test used to cause infinite recursion.
+template<typename T>
+struct S {
+ typedef T Ty;
+ Ty *t;
+};
+
+@interface N
+{
+ S<N> a;
+}
+@end
+
+@implementation N
+@end
+
+const char *expand_struct() {
+ // CHECK: @{{.*}} = private unnamed_addr constant [16 x i8] c"{N={S<N>=^{N}}}\00"
+ return @encode(N);
+}