diff options
author | John McCall <rjmccall@apple.com> | 2013-04-10 06:08:21 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-04-10 06:08:21 +0000 |
commit | 924046f1ec3d0669acdd3d5842901664f23b56b8 (patch) | |
tree | 0b95092db22ea3623bff82168f2f05e610d687b1 /clang/test/CodeGenObjCXX/mangle.mm | |
parent | f6ce26fb027d2bad5a07076f04f1b2e9cc924dec (diff) | |
download | bcm5719-llvm-924046f1ec3d0669acdd3d5842901664f23b56b8.tar.gz bcm5719-llvm-924046f1ec3d0669acdd3d5842901664f23b56b8.zip |
Don't crash when mangling types defined in ObjC class extensions.
The original test case here was mangling a type name for TBAA,
but we can provoke this in C++11 easily enough.
rdar://13434937
llvm-svn: 179153
Diffstat (limited to 'clang/test/CodeGenObjCXX/mangle.mm')
-rw-r--r-- | clang/test/CodeGenObjCXX/mangle.mm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/clang/test/CodeGenObjCXX/mangle.mm b/clang/test/CodeGenObjCXX/mangle.mm index 2521c6076a8..45a93a196dc 100644 --- a/clang/test/CodeGenObjCXX/mangle.mm +++ b/clang/test/CodeGenObjCXX/mangle.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -std=c++11 -emit-llvm -o - | FileCheck %s // CHECK: @"_ZZ11+[A shared]E1a" = internal global // CHECK: @"_ZZ11-[A(Foo) f]E1a" = internal global @@ -54,3 +54,27 @@ uiIsVisible(); } @end + +// rdar://13434937 +// +// Don't crash when mangling an enum whose semantic context +// is a class extension (which looks anonymous in the AST). +// The other tests here are just for coverage. +@interface Test2 @end +@interface Test2 () +@property (assign) enum { T2x, T2y, T2z } axis; +@end +@interface Test2 (a) +@property (assign) enum { T2i, T2j, T2k } dimension; +@end +@implementation Test2 { +@public + enum { T2a, T2b, T2c } alt_axis; +} +@end +template <class T> struct Test2Template { Test2Template() {} }; // must have a member that we'll instantiate and mangle +void test2(Test2 *t) { + Test2Template<decltype(t.axis)> t0; + Test2Template<decltype(t.dimension)> t1; + Test2Template<decltype(t->alt_axis)> t2; +} |