Files
clang-p2996/clang/test/CodeGen/avr/objc-property.m
Matt Jacobson dd9f7963e4 [ObjC] avoid crashing when emitting synthesized getter/setter and ptrdiff_t is smaller than long
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
2022-11-10 02:10:30 -05:00

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