mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-27 23:38:59 -04:00

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
35 lines
728 B
Objective-C
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.
|
|
}
|
|
}
|