31 lines · plain
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 %s3// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -fblocks -triple x86_64-apple-darwin -O -o - %s | FileCheck %s4 5@interface I6@end7 8@implementation I9 10- (int)method {11}12 13@end14 15enum Enum {16 a17};18 19int (^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 undefined27// behaviour optimization.28 29// CHECK-NOT: call void @llvm.trap30// CHECK-NOT: unreachable31