[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / SemaObjC / return.m
blob116abd19e7e74fb53579ed2f8b9626bbb9f99838
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wmissing-noreturn
3 int test1() {
4   id a;
5   @throw a;
8 // PR5286
9 void test2(int a) {
10   while (1) {
11     if (a)
12       return;
13   }
16 // PR5286
17 void test3(int a) {  // expected-warning {{function could be attribute 'noreturn'}}
18   while (1) {
19     if (a)
20       @throw (id)0;
21   }
24 // <rdar://problem/4289832> - This code always returns, we should not
25 //  issue a noreturn warning.
26 @class NSException;
27 @class NSString;
28 NSString *rdar_4289832() {  // no-warning
29     @try
30     {
31         return @"a";
32     }
33     @catch(NSException *exception)
34     {
35         return @"b";
36     }
37     @finally
38     {
39     }