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