On targets where ptrdiff_t is smaller than long, clang crashes when emitting synthesized getters/setters that call objc_[gs]etProperty. Explicitly emit a zext/trunc of the ivar offset value (which is defined to long) to ptrdiff_t, which objc_[gs]etProperty takes. Add a test using the AVR target, where ptrdiff_t is smaller than long. Test failed previously and passes now. Differential Revision: https://reviews.llvm.org/D112049
15 lines
210 B
Objective-C
15 lines
210 B
Objective-C
// RUN: %clang_cc1 -triple avr -emit-llvm -fobjc-runtime=macosx %s -o /dev/null
|
|
|
|
__attribute__((objc_root_class))
|
|
@interface Foo
|
|
|
|
@property(strong) Foo *f;
|
|
|
|
@end
|
|
|
|
@implementation Foo
|
|
|
|
@synthesize f = _f;
|
|
|
|
@end
|