ObjFW  Check-in [4461f85857]

Overview
Comment:RuntimeTests: Make certain versions of Clang happy
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tagged-pointers
Files: files | file ages | folders
SHA3-256: 4461f85857ff8c6b5037a8244f88d204c6f8fecc87f81548408f006adc6b4633
User & Date: js on 2020-07-04 13:09:21
Other Links: branch diff | manifest | tags
Context
2020-07-04
13:59
lookup-asm-sparc64-elf.S: Non-PIC optimization check-in: e0b1a90547 user: js tags: tagged-pointers
13:09
RuntimeTests: Make certain versions of Clang happy check-in: 4461f85857 user: js tags: tagged-pointers
13:00
Add tests for tagged pointers check-in: 6414fc9ca5 user: js tags: tagged-pointers
Changes

Modified tests/RuntimeTests.m from [51397f3854] to [33b8900615].

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
		value = 0xDEADBEEFDEADBEF;
	else if (sizeof(uintptr_t) == 4)
		value = 0xDEADBEF;
	else
		abort();

	TEST(@"Tagged pointers",
	    R(cid1 = objc_registerTaggedPointerClass([OFString class])) &&
	    R(cid2 = objc_registerTaggedPointerClass([OFNumber class])) &&
	    cid1 != -1 && cid2 != -1 &&
	    (object = objc_createTaggedPointer(cid2, (uintptr_t)value)) &&
	    object_getTaggedPointerClass(object) == [OFNumber class] &&
	    [object class] == [OFNumber class] &&
	    object_getTaggedPointerValue(object) == value &&
	    objc_createTaggedPointer(cid2, UINTPTR_MAX >> 4) != nil &&
	    objc_createTaggedPointer(cid2, (UINTPTR_MAX >> 4) + 1) == nil)
#endif

	objc_autoreleasePoolPop(pool);
}
@end







|
|
<











94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110
111
112
113
		value = 0xDEADBEEFDEADBEF;
	else if (sizeof(uintptr_t) == 4)
		value = 0xDEADBEF;
	else
		abort();

	TEST(@"Tagged pointers",
	    (cid1 = objc_registerTaggedPointerClass([OFString class])) != -1 &&
	    (cid2 = objc_registerTaggedPointerClass([OFNumber class])) != -1 &&

	    (object = objc_createTaggedPointer(cid2, (uintptr_t)value)) &&
	    object_getTaggedPointerClass(object) == [OFNumber class] &&
	    [object class] == [OFNumber class] &&
	    object_getTaggedPointerValue(object) == value &&
	    objc_createTaggedPointer(cid2, UINTPTR_MAX >> 4) != nil &&
	    objc_createTaggedPointer(cid2, (UINTPTR_MAX >> 4) + 1) == nil)
#endif

	objc_autoreleasePoolPop(pool);
}
@end