bolt/deps/llvm-18.1.8/clang-tools-extra/test/clang-tidy/checkers/darwin/avoid-spinlock.m

20 lines
791 B
Mathematica
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %check_clang_tidy %s darwin-avoid-spinlock %t
typedef int OSSpinLock;
void OSSpinlockLock(OSSpinLock *l);
void OSSpinlockTry(OSSpinLock *l);
void OSSpinlockUnlock(OSSpinLock *l);
@implementation Foo
- (void)f {
int i = 1;
OSSpinlockLock(&i);
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use os_unfair_lock_lock() or dispatch queue APIs instead of the deprecated OSSpinLock [darwin-avoid-spinlock]
OSSpinlockTry(&i);
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use os_unfair_lock_lock() or dispatch queue APIs instead of the deprecated OSSpinLock [darwin-avoid-spinlock]
OSSpinlockUnlock(&i);
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use os_unfair_lock_lock() or dispatch queue APIs instead of the deprecated OSSpinLock [darwin-avoid-spinlock]
}
@end