8 objc\[\d+\]: Method cache corrupted.*
13 objc\[\d+\]: Method cache corrupted.*
21 // Test objc_msgSend's detection of infinite loops during cache scan.
27 testwarn("objc_msgSend on arm doesn't detect infinite loops");
28 fprintf(stderr, "arm\n");
37 typedef uint32_t mask_t;
39 typedef uint16_t mask_t;
59 @interface Subclass : TestRoot @end
60 @implementation Subclass @end
64 Class cls = [TestRoot class];
68 struct cache_t *cache = &((__bridge struct class_t *)cls)->cache;
70 // Figure out which cache mask scheme is in use by examining the existing bits.
77 if (cache->buckets & 0xf) {
80 } else if ((cache->buckets & (0xffffULL << 48))) {
88 # define COUNTSHIFT 14
89 struct bucket_t *buckets = (struct bucket_t *)calloc(sizeof(struct bucket_t), COUNT+1);
90 for (int i = 0; i < COUNT; i++) {
94 buckets[COUNT].sel = 1;
95 buckets[COUNT].imp = (uintptr_t)buckets;
98 cache->buckets = (uintptr_t)buckets | COUNTSHIFT;
101 cache->buckets = ((uintptr_t)(COUNT - 1) << 48) | (uintptr_t)buckets;
103 } else if (outlined) {
104 cache->mask = COUNT-1;
105 cache->buckets = (uintptr_t)buckets;
110 fprintf(stderr, "crash now\n");
113 fail("should have crashed");