xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/rewrite-try-catch.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5  %s -o -
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface Foo @end
4*f4a2713aSLionel Sambuc@interface GARF @end
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambucvoid foo() {
7*f4a2713aSLionel Sambuc  @try  { TRY(); }
8*f4a2713aSLionel Sambuc  @catch (...) { SPLATCH(); @throw; }
9*f4a2713aSLionel Sambuc}
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambucint main()
12*f4a2713aSLionel Sambuc{
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc  @try  {
15*f4a2713aSLionel Sambuc     MYTRY();
16*f4a2713aSLionel Sambuc  }
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc  @catch (Foo* localException) {
19*f4a2713aSLionel Sambuc     MYCATCH();
20*f4a2713aSLionel Sambuc     @throw;
21*f4a2713aSLionel Sambuc  }
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc  // no catch clause
24*f4a2713aSLionel Sambuc  @try { }
25*f4a2713aSLionel Sambuc  @finally { }
26*f4a2713aSLionel Sambuc}
27*f4a2713aSLionel Sambuc
28