2008-11-18 04:45:14 +08:00
|
|
|
// RUN: clang -emit-llvm -triple=i686-apple-darwin8 -o %t %s
|
|
|
|
// RUNX: clang -emit-llvm -o %t %s
|
2008-11-18 02:03:28 +08:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2008-11-22 03:21:53 +08:00
|
|
|
@interface MyClass
|
|
|
|
{
|
|
|
|
}
|
|
|
|
- (void)method;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
|
|
|
|
- (void)method
|
|
|
|
{
|
|
|
|
@synchronized(self)
|
|
|
|
{
|
|
|
|
NSLog(@"sync");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2008-11-18 02:03:28 +08:00
|
|
|
void foo(id a) {
|
|
|
|
@synchronized(a) {
|
|
|
|
printf("Swimming? No.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-22 03:21:53 +08:00
|
|
|
|
|
|
|
|