]> git.saurik.com Git - apple/objc4.git/blob - test/taggedPointersDisabled.m
objc4-818.2.tar.gz
[apple/objc4.git] / test / taggedPointersDisabled.m
1 /*
2 TEST_ENV OBJC_DISABLE_TAGGED_POINTERS=YES
3 TEST_CRASHES
4
5 TEST_BUILD_OUTPUT
6 .*taggedPointersDisabled.m:\d+:\d+: warning: null passed to a callee that requires a non-null argument \[-Wnonnull\]
7 END
8
9 TEST_RUN_OUTPUT
10 objc\[\d+\]: tagged pointers are disabled
11 objc\[\d+\]: HALTED
12 OR
13 OK: taggedPointersDisabled.m
14 END
15 */
16
17 #include "test.h"
18 #include <objc/objc-internal.h>
19
20 #if !OBJC_HAVE_TAGGED_POINTERS
21
22 int main()
23 {
24 // provoke the same nullability warning as the real test
25 objc_getClass(nil);
26
27 succeed(__FILE__);
28 }
29
30 #else
31
32 int main()
33 {
34 testassert(!_objc_taggedPointersEnabled());
35 _objc_registerTaggedPointerClass((objc_tag_index_t)0, nil);
36 fail("should have crashed in _objc_registerTaggedPointerClass()");
37 }
38
39 #endif