xref: /aosp_15_r20/external/clang/test/CodeGenObjC/2010-03-17-StructRef.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -o - | FileCheck %s
2*67e74705SXin Li// Bitfield references must not touch memory outside of the enclosing
3*67e74705SXin Li// struct.   Radar 7639995
4*67e74705SXin Litypedef signed char BOOL;
5*67e74705SXin Li@protocol NSObject
6*67e74705SXin Li- (id)init;
7*67e74705SXin Li@end
8*67e74705SXin Li@interface NSObject <NSObject> {}
9*67e74705SXin Li@end
10*67e74705SXin Li@interface IMAVChatParticipant : NSObject {
11*67e74705SXin Li  int _ardRole;
12*67e74705SXin Li  int _state;
13*67e74705SXin Li  int _avRelayStatus;
14*67e74705SXin Li  int _chatEndedReason;
15*67e74705SXin Li  int _chatError;
16*67e74705SXin Li  unsigned _sendingAudio:1;
17*67e74705SXin Li  unsigned _sendingVideo:1;
18*67e74705SXin Li  unsigned _sendingAuxVideo:1;
19*67e74705SXin Li  unsigned _audioMuted:1;
20*67e74705SXin Li  unsigned _videoPaused:1;
21*67e74705SXin Li  unsigned _networkStalled:1;
22*67e74705SXin Li  unsigned _isInitiator:1;
23*67e74705SXin Li  unsigned _isAOLInterop:1;
24*67e74705SXin Li  unsigned _isRecording:1;
25*67e74705SXin Li  unsigned _isUsingICE:1;
26*67e74705SXin Li}
27*67e74705SXin Li@end
28*67e74705SXin Li@implementation IMAVChatParticipant
29*67e74705SXin Li- (id) init {
30*67e74705SXin Li  self = [super init];
31*67e74705SXin Li  if ( self ) {
32*67e74705SXin Li    BOOL blah = (BOOL)1;
33*67e74705SXin Li    // We're expecting these three bitfield assignments will generate i8 stores.
34*67e74705SXin Li    _sendingAudio = (BOOL)1;
35*67e74705SXin Li    _isUsingICE = (BOOL)1;
36*67e74705SXin Li    _isUsingICE = blah;
37*67e74705SXin Li    // CHECK: store i8
38*67e74705SXin Li    // CHECK: store i8
39*67e74705SXin Li    // CHECK: store i8
40*67e74705SXin Li  }
41*67e74705SXin Li  return self;
42*67e74705SXin Li}
43*67e74705SXin Li@end
44