imageorder3.m 556 B

123456789101112131415161718192021222324252627282930313233
  1. #include "test.h"
  2. #include "imageorder.h"
  3. static void c3(void) __attribute__((constructor));
  4. static void c3(void)
  5. {
  6. testassert(state == 3); // +load before C/C++
  7. testassert(cstate == 2);
  8. cstate = 3;
  9. }
  10. #if __clang__
  11. #pragma clang diagnostic push
  12. #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
  13. #endif
  14. @implementation Super (cat3)
  15. +(void) method {
  16. state = 3;
  17. }
  18. +(void) method3 {
  19. state = 3;
  20. }
  21. +(void) load {
  22. testassert(state == 2);
  23. state = 3;
  24. }
  25. @end
  26. #if __clang__
  27. #pragma clang diagnostic pop
  28. #endif