123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #include "test.h"
- #include <objc/objc-exception.h>
- uintptr_t Token;
- void handler(id unused __unused, void *context __unused)
- {
- }
- int main()
- {
- #if __clang__ && __cplusplus
-
-
- @try {
- testwarn("rdar://9183014 clang uses wrong exception personality");
- } @catch (id e __unused) {
- }
- #endif
- @try {
-
- uintptr_t t1, t2, t3, t4;
- t1 = objc_addExceptionHandler(&handler, NULL);
- t2 = objc_addExceptionHandler(&handler, NULL);
- t3 = objc_addExceptionHandler(&handler, NULL);
- t4 = objc_addExceptionHandler(&handler, NULL);
-
- objc_removeExceptionHandler(t1);
- objc_removeExceptionHandler(t2);
- objc_removeExceptionHandler(t3);
-
-
-
- testonthread(^{
- @try {
- Token = objc_addExceptionHandler(&handler, NULL);
- } @catch (...) {
- }
- });
-
-
- objc_removeExceptionHandler(Token);
-
- objc_removeExceptionHandler(t4);
-
-
-
-
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- objc_addExceptionHandler(&handler, NULL);
- } @catch (...) {
- }
-
- fail(__FILE__);
- }
|