unload2.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "unload.h"
  2. #include "testroot.i"
  3. #import <objc/objc-api.h>
  4. @implementation SmallClass : TestRoot
  5. -(void)unload2_instance_method { }
  6. @end
  7. @implementation BigClass : TestRoot
  8. @end
  9. OBJC_ROOT_CLASS
  10. @interface UnusedClass { id isa; } @end
  11. @implementation UnusedClass @end
  12. @protocol SmallProtocol
  13. -(void)unload2_category_method;
  14. @end
  15. @interface SmallClass (Category) <SmallProtocol> @end
  16. @implementation SmallClass (Category)
  17. -(void)unload2_category_method { }
  18. @end
  19. // This isn't really weak-import: we link with `-undefined dynamic_lookup`
  20. // instead of providing a valid definition at link time.
  21. // But it looks the same to the runtime.
  22. __attribute__((weak_import))
  23. @interface ClassThatIsWeakImportAndMissing : TestRoot @end
  24. @interface SubclassOfMissingWeakImport : ClassThatIsWeakImportAndMissing <SmallProtocol> @end
  25. @implementation SubclassOfMissingWeakImport
  26. -(void)unload2_category_method { }
  27. @end
  28. @interface ClassThatIsWeakImportAndMissing (Category) <SmallProtocol> @end
  29. @implementation ClassThatIsWeakImportAndMissing (Category)
  30. -(void)unload2_category_method { }
  31. @end