Dave Lee 75fdf7fd15 [lldb] Test direct ivar access in objc++ (NFC)
Add an Objective-C++ specific test for direct ivar access. This adds to the existing C++ and ObjC tests, and tests against regression for future refactoring.

Differential Revision: https://reviews.llvm.org/D146320
2023-03-21 10:14:42 -07:00

36 lines
447 B
Plaintext

#import <objc/NSObject.h>
#include <stdio.h>
struct Structure {
int m_field;
void fun() {
puts("check this\n");
}
};
@interface Classic : NSObject {
@public
int _ivar;
}
@end
@implementation Classic
- (void)fun {
puts("check self\n");
}
@end
int main() {
Structure s;
s.m_field = 41;
s.fun();
Classic *c = [Classic new];
c->_ivar = 30;
[c fun];
Classic *self = c;
puts("check explicit self\n");
(void)self;
}