xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/objc-synchronized-1.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5  %s -o -
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambucid SYNCH_EXPR();
4*f4a2713aSLionel Sambucvoid SYNCH_BODY();
5*f4a2713aSLionel Sambucvoid  SYNCH_BEFORE();
6*f4a2713aSLionel Sambucvoid  SYNC_AFTER();
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucvoid foo(id sem)
9*f4a2713aSLionel Sambuc{
10*f4a2713aSLionel Sambuc  SYNCH_BEFORE();
11*f4a2713aSLionel Sambuc  @synchronized (SYNCH_EXPR()) {
12*f4a2713aSLionel Sambuc    SYNCH_BODY();
13*f4a2713aSLionel Sambuc    return;
14*f4a2713aSLionel Sambuc  }
15*f4a2713aSLionel Sambuc SYNC_AFTER();
16*f4a2713aSLionel Sambuc @synchronized ([sem self]) {
17*f4a2713aSLionel Sambuc    SYNCH_BODY();
18*f4a2713aSLionel Sambuc    return;
19*f4a2713aSLionel Sambuc }
20*f4a2713aSLionel Sambuc}
21