2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple=i686-apple-darwin9 -o %t %s -O2
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep 'ret i32' %t | count 1
|
2009-02-24 09:43:46 +08:00
|
|
|
// RUN: grep 'ret i32 1' %t | count 1
|
2008-11-18 02:03:28 +08:00
|
|
|
|
2008-11-22 03:21:53 +08:00
|
|
|
@interface MyClass
|
|
|
|
{
|
|
|
|
}
|
|
|
|
- (void)method;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
|
|
|
|
- (void)method
|
|
|
|
{
|
|
|
|
@synchronized(self)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2008-11-18 02:03:28 +08:00
|
|
|
void foo(id a) {
|
|
|
|
@synchronized(a) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-24 09:43:46 +08:00
|
|
|
int f0(id a) {
|
|
|
|
int x = 0;
|
|
|
|
@synchronized((x++, a)) {
|
|
|
|
}
|
|
|
|
return x; // ret i32 1
|
|
|
|
}
|
2008-11-22 03:21:53 +08:00
|
|
|
|
2009-02-24 09:43:46 +08:00
|
|
|
void f1(id a) {
|
|
|
|
// The trick here is that the return shouldn't go through clean up,
|
|
|
|
// but there isn't a simple way to check this property.
|
|
|
|
@synchronized(({ return; }), a) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|