1193323Sedunion U 2193323Sed{ 3193323Sed const int a; 4193323Sed unsigned b : 24; 5193323Sed}; 6193323Sed 7193323Sedstatic union U u = { 0x12345678 }; 8193323Sed 9193323Sed/* Constant folding used to fail to account for endianness when folding a 10193323Sed union. */ 11193323Sed 12193323Sedint 13193323Sedmain (void) 14193323Sed{ 15193323Sed#ifdef __BYTE_ORDER__ 16193323Sed#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 17193323Sed return u.b - 0x345678; 18193323Sed#else 19193323Sed return u.b - 0x123456; 20193323Sed#endif 21193323Sed#endif 22193323Sed return 0; 23239462Sdim} 24193323Sed