llvm-project/clang/test/CodeGenObjC/debug-info-blocks.m
John McCall 9b0a7cea0f Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.

llvm-svn: 140957
2011-10-02 01:16:38 +00:00

56 lines
897 B
Objective-C

// REQUIRES: x86-64-registered-target
// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed %s -o - | FileCheck %s
//Radar 9279956
//CHECK: ## DW_OP_deref
//CHECK-NEXT: ## DW_OP_plus_uconst
typedef unsigned int NSUInteger;
@protocol NSObject
@end
@interface NSObject <NSObject>
- (id)init;
+ (id)alloc;
@end
@interface NSDictionary : NSObject
- (NSUInteger)count;
@end
@interface NSMutableDictionary : NSDictionary
@end
@interface A : NSObject {
@public
int ivar;
}
@end
static void run(void (^block)(void))
{
block();
}
@implementation A
- (id)init
{
if ((self = [super init])) {
run(^{
NSMutableDictionary *d = [[NSMutableDictionary alloc] init];
ivar = 42 + (int)[d count];
});
}
return self;
}
@end
int main()
{
A *a = [[A alloc] init];
return 0;
}