aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/synchronized.m
blob: c74a83edbe35dec542384ad248a4302efdaba3f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: clang -emit-llvm -triple=i686-apple-darwin8 -o %t %s
// RUNX: clang -emit-llvm -o %t %s

#include <stdio.h>

@interface MyClass
{
}
- (void)method;
@end

@implementation MyClass

- (void)method
{
	@synchronized(self)
	{
		NSLog(@"sync");
	}
}

@end

void foo(id a) {
  @synchronized(a) {
    printf("Swimming? No.");
    return;
  }
}