| 1 |
/// -fstrict-return is the default. |
| 2 |
// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -fblocks -triple x86_64-apple-darwin -o - %s | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -fblocks -triple x86_64-apple-darwin -O -o - %s | FileCheck %s |
| 4 |
|
| 5 |
@interface I |
| 6 |
@end |
| 7 |
|
| 8 |
@implementation I |
| 9 |
|
| 10 |
- (int)method { |
| 11 |
} |
| 12 |
|
| 13 |
@end |
| 14 |
|
| 15 |
enum Enum { |
| 16 |
a |
| 17 |
}; |
| 18 |
|
| 19 |
int (^block)(Enum) = ^int(Enum e) { |
| 20 |
switch (e) { |
| 21 |
case a: |
| 22 |
return 1; |
| 23 |
} |
| 24 |
}; |
| 25 |
|
| 26 |
// Ensure that both methods and blocks don't use the -fstrict-return undefined |
| 27 |
// behaviour optimization. |
| 28 |
|
| 29 |
// CHECK-NOT: call void @llvm.trap |
| 30 |
// CHECK-NOT: unreachable |