This adds a simple testcase for MainThreadCheckerRuntime. The tool (Main Thread Checker) is only available on Darwin, so the test also detects the presence of libMainThreadChecker.dylib and is skipped if the tool is not available. llvm-svn: 307170
16 lines
368 B
Objective-C
16 lines
368 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#import <AppKit/AppKit.h>
|
|
|
|
int main() {
|
|
NSView *view = [[NSView alloc] init];
|
|
dispatch_group_t g = dispatch_group_create();
|
|
dispatch_group_enter(g);
|
|
[NSThread detachNewThreadWithBlock:^{
|
|
@autoreleasepool {
|
|
[view superview];
|
|
}
|
|
dispatch_group_leave(g);
|
|
}];
|
|
dispatch_group_wait(g, DISPATCH_TIME_FOREVER);
|
|
}
|