diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-01 18:25:24 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-01 18:25:24 +0000 |
commit | a6227fd896256bff069ddd9f11df9affb81e1a05 (patch) | |
tree | 1af8f3499853744c9257813b55908429441a0526 /clang/test/CodeGenObjC/objc2-weak-import-attribute.m | |
parent | 0a2c0bcb149a87d682c154a5a61e90f23fcc323e (diff) | |
download | bcm5719-llvm-a6227fd896256bff069ddd9f11df9affb81e1a05.tar.gz bcm5719-llvm-a6227fd896256bff069ddd9f11df9affb81e1a05.zip |
(objc2 nonfragile-abi specific). If the translation unit includes an implementation
of a subclass (direct or indirect) of a weak_import root class, emit a weak reference
for the root class's metaclass (should complete radar 6815425).
llvm-svn: 90249
Diffstat (limited to 'clang/test/CodeGenObjC/objc2-weak-import-attribute.m')
-rw-r--r-- | clang/test/CodeGenObjC/objc2-weak-import-attribute.m | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/CodeGenObjC/objc2-weak-import-attribute.m b/clang/test/CodeGenObjC/objc2-weak-import-attribute.m index 4a5f14e2e0f..fbdffbf84a8 100644 --- a/clang/test/CodeGenObjC/objc2-weak-import-attribute.m +++ b/clang/test/CodeGenObjC/objc2-weak-import-attribute.m @@ -1,6 +1,8 @@ // RUN: clang-cc -fobjc-nonfragile-abi -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-X86-64 %s -__attribute__((weak_import)) @interface WeakClass +__attribute__((weak_import)) @interface WeakRootClass @end + +__attribute__((weak_import)) @interface WeakClass : WeakRootClass @end @interface MySubclass : WeakClass @end @@ -26,9 +28,21 @@ int main() { [WeakClass3 message]; } +// CHECK-X86-64: OBJC_METACLASS_$_WeakRootClass" = extern_weak global // CHECK-X86-64: OBJC_METACLASS_$_WeakClass" = extern_weak global // CHECK-X86-64: OBJC_CLASS_$_WeakClass" = extern_weak global // CHECK-X86-64: OBJC_CLASS_$_WeakClass1" = extern_weak global // CHECK-X86-64: OBJC_CLASS_$_WeakClass3" = extern_weak global +// Root is being implemented here. No extern_weak. +__attribute__((weak_import)) @interface Root @end + +@interface Super : Root @end + +@interface Sub : Super @end + +@implementation Sub @end + +@implementation Root @end +// CHECK-NOT-X86-64: OBJC_METACLASS_$_Root" = extern_weak global |