1f08c3bdfSopenharmony_ciint foo(void) 2f08c3bdfSopenharmony_ci{ 3f08c3bdfSopenharmony_ci struct { 4f08c3bdfSopenharmony_ci int a:8; 5f08c3bdfSopenharmony_ci int b:16; 6f08c3bdfSopenharmony_ci int c:8; 7f08c3bdfSopenharmony_ci } s = { 0xff, 0x0000, 0xff }; 8f08c3bdfSopenharmony_ci 9f08c3bdfSopenharmony_ci return s.b = 0x56781234; 10f08c3bdfSopenharmony_ci} 11f08c3bdfSopenharmony_ci 12f08c3bdfSopenharmony_ci/* 13f08c3bdfSopenharmony_ci * check-name: bitfield-store 14f08c3bdfSopenharmony_ci * check-command: test-linearize -Wno-decl $file 15f08c3bdfSopenharmony_ci * 16f08c3bdfSopenharmony_ci * check-output-ignore 17f08c3bdfSopenharmony_ci * check-output-contains: ret\\..*\\$0x1234 18f08c3bdfSopenharmony_ci * 19f08c3bdfSopenharmony_ci * check-error-start 20f08c3bdfSopenharmony_cilinear/bitfield-store.c:9:22: warning: cast truncates bits from constant value (56781234 becomes 1234) 21f08c3bdfSopenharmony_ci * check-error-end 22f08c3bdfSopenharmony_ci */ 23