diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-15 22:42:15 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-15 22:42:15 +0000 |
| commit | 3b71b17753f0b2360e7c4b4c31643f23fdb25f8d (patch) | |
| tree | c5fde5892a04038a48854b00f74e93244ef43a1e /clang/test | |
| parent | 9c76d24f9c562045aea28198ab0dcd0e81f37380 (diff) | |
| download | bcm5719-llvm-3b71b17753f0b2360e7c4b4c31643f23fdb25f8d.tar.gz bcm5719-llvm-3b71b17753f0b2360e7c4b4c31643f23fdb25f8d.zip | |
modern objective-c translator: writing @try/@finally statement.
llvm-svn: 152867
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Rewriter/rewrite-modern-try-finally.m | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/Rewriter/rewrite-modern-try-finally.m b/clang/test/Rewriter/rewrite-modern-try-finally.m new file mode 100644 index 00000000000..cf342d746de --- /dev/null +++ b/clang/test/Rewriter/rewrite-modern-try-finally.m @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -x objective-c -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp + +void FINALLY(); +void TRY(); +void INNER_FINALLY(); +void INNER_TRY(); +void CHECK(); + +@interface Foo +@end + +@implementation Foo +- (void)bar { + @try { + TRY(); + } + @finally { + FINALLY(); + } + CHECK(); + @try { + TRY(); + } + @finally { + @try { + INNER_TRY(); + } + @finally { + INNER_FINALLY(); + } + FINALLY(); + } +} +@end |

