diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-14 15:40:54 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-14 15:40:54 +0000 |
commit | e385112444b7202cc7869825eb66efb6fed70940 (patch) | |
tree | 68115f824cdaec5f4bdde01b260d57fc9adf1abd /test/CodeGenObjCXX/arc-cxx11-member-init.mm | |
parent | 4e317eca08ddcd18833d3b5670b4fff1811b9e17 (diff) |
Objective-C++ IRGen. Due to change to AST for initialization of c++11’s
data members by addition of CXXDefaultInitExpr node to the initializer expression,
it has broken treatment of arc code for such initializations. Reviewed by John McCall.
// rdar://16299964
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjCXX/arc-cxx11-member-init.mm')
-rw-r--r-- | test/CodeGenObjCXX/arc-cxx11-member-init.mm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGenObjCXX/arc-cxx11-member-init.mm b/test/CodeGenObjCXX/arc-cxx11-member-init.mm new file mode 100644 index 0000000000..213e7a1b7b --- /dev/null +++ b/test/CodeGenObjCXX/arc-cxx11-member-init.mm @@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -std=c++11 -emit-llvm -o - %s | FileCheck %s +// rdar://16299964 + +@interface NSObject ++ (id)new; +@end + +@interface NSMutableDictionary : NSObject +@end + +class XClipboardDataSet +{ + NSMutableDictionary* mClipData = [NSMutableDictionary new]; +}; + +@interface AppDelegate @end + +@implementation AppDelegate +- (void)applicationDidFinishLaunching +{ + XClipboardDataSet clip; +} +@end + +// CHECK: [[mClipData:%.*]] = getelementptr inbounds %class.XClipboardDataSet* +// CHECK: [[ZERO:%.*]] = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_" +// CHECK: [[ONE:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_" +// CHECK: [[TWO:%.*]] = bitcast %struct._class_t* [[ZERO]] to i8* +// CHECK: [[CALL:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[TWO]], i8* [[ONE]]) +// CHECK: [[THREE:%.*]] = bitcast i8* [[CALL]] to [[T:%.*]]* +// CHECK: store [[T]]* [[THREE]], [[T]]** [[mClipData]], align 8 + |