brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · c4fd4e5 Raw
44 lines · plain
1// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -o - | FileCheck %s2// Bitfield references must not touch memory outside of the enclosing3// struct.4typedef signed char BOOL;5@protocol NSObject6- (id)init;7@end8@interface NSObject <NSObject> {}9@end10@interface IMAVChatParticipant : NSObject {11  int _ardRole;12  int _state;13  int _avRelayStatus;14  int _chatEndedReason;15  int _chatError;16  unsigned _sendingAudio:1;17  unsigned _sendingVideo:1;18  unsigned _sendingAuxVideo:1;19  unsigned _audioMuted:1;20  unsigned _videoPaused:1;21  unsigned _networkStalled:1;22  unsigned _isInitiator:1;23  unsigned _isAOLInterop:1;24  unsigned _isRecording:1;25  unsigned _isUsingICE:1;26}27@end28@implementation IMAVChatParticipant29- (id) init {30  self = [super init];31  if ( self ) {32    BOOL blah = (BOOL)1;33    // We're expecting these three bitfield assignments will generate i8 stores.34    _sendingAudio = (BOOL)1;35    _isUsingICE = (BOOL)1;36    _isUsingICE = blah;37    // CHECK: store i838    // CHECK: store i839    // CHECK: store i840  }41  return self;42}43@end44