teak-llvm/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
Greg Clayton 8f61811789 Fix i386 being able to show member variables correctly by not returning empty objective C types from the runtime.
We don't parse ObjC v1 types from the runtime metadata like we do for ObjC v2, but doing so by creating empty types was ruining the i386 v1 debugging experience.

<rdar://problem/24093343>

llvm-svn: 289233
2016-12-09 17:54:59 +00:00

35 lines
728 B
Objective-C

#import <Foundation/Foundation.h>
struct things_to_sum {
int a;
int b;
int c;
};
@interface ThingSummer : NSObject {
};
-(int)sumThings:(struct things_to_sum)tts;
@end
@implementation ThingSummer
-(int)sumThings:(struct things_to_sum)tts
{
return tts.a + tts.b + tts.c;
}
@end
int main()
{
@autoreleasepool
{
ThingSummer *summer = [ThingSummer alloc];
struct things_to_sum tts = { 2, 3, 4 };
int ret = [summer sumThings:tts];
NSRect rect = {{0, 0}, {10, 20}};
// The Objective C V1 runtime won't read types from metadata so we need
// NSValue in our debug info to use it in our test.
NSValue *v = [NSValue valueWithRect:rect];
return rect.origin.x; // Set breakpoint here.
}
}