This should always be signed chars, so use int8_t. This fixes a miscompile when
[llvm/stm8.git] / test / FrontendC++ / 2007-05-16-ReverseBitFieldCrash.cpp
blob42342fc9486c1bf28951817952036d7953e33c38
1 // RUN: %llvmgxx %s -S -o -
3 #pragma reverse_bitfields on
4 typedef unsigned long UINT32;
6 extern void abort(void);
8 typedef struct TestStruct
10 long first: 15,
11 second: 17;
12 } TestStruct;
14 int main (int argc, char * const argv[]) {
16 TestStruct testStruct = {1, 0};
18 UINT32 dw = *(UINT32 *)(&testStruct);
20 if(!(dw & 0xFFFF))
21 abort ();
23 return 0;