John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -o - | FileCheck %s |
Eric Christopher | 89a179b | 2011-08-20 01:04:49 +0000 | [diff] [blame] | 2 | // Bitfield references must not touch memory outside of the enclosing |
| 3 | // struct. Radar 7639995 |
| 4 | typedef signed char BOOL; |
| 5 | @protocol NSObject |
| 6 | - (id)init; |
| 7 | @end |
| 8 | @interface NSObject <NSObject> {} |
| 9 | @end |
| 10 | @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 | @end |
| 28 | @implementation IMAVChatParticipant |
| 29 | - (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 i8 |
| 38 | // CHECK: store i8 |
| 39 | // CHECK: store i8 |
| 40 | } |
| 41 | return self; |
| 42 | } |
| 43 | @end |