1f08c3bdfSopenharmony_citypedef unsigned short __attribute__((bitwise)) le16; 2f08c3bdfSopenharmony_cistruct s { 3f08c3bdfSopenharmony_ci int a:2; 4f08c3bdfSopenharmony_ci int b:2; 5f08c3bdfSopenharmony_ci int c:2; 6f08c3bdfSopenharmony_ci}; 7f08c3bdfSopenharmony_ci 8f08c3bdfSopenharmony_cistatic _Bool fresi(le16 a) { return a; } 9f08c3bdfSopenharmony_cistatic _Bool frese(le16 a) { return (_Bool)a; } 10f08c3bdfSopenharmony_cistatic _Bool fstsi(struct s a) { return a; } 11f08c3bdfSopenharmony_cistatic _Bool fstse(struct s a) { return (_Bool)a; } 12f08c3bdfSopenharmony_ci 13f08c3bdfSopenharmony_ci/* 14f08c3bdfSopenharmony_ci * check-name: bool-cast-bad.c 15f08c3bdfSopenharmony_ci * check-command: sparse $file 16f08c3bdfSopenharmony_ci * 17f08c3bdfSopenharmony_ci * check-error-start 18f08c3bdfSopenharmony_cibool-cast-bad.c:10:41: warning: incorrect type in return expression (different base types) 19f08c3bdfSopenharmony_cibool-cast-bad.c:10:41: expected bool 20f08c3bdfSopenharmony_cibool-cast-bad.c:10:41: got struct s a 21f08c3bdfSopenharmony_cibool-cast-bad.c:11:42: warning: cast from non-scalar 22f08c3bdfSopenharmony_ci * check-error-end 23f08c3bdfSopenharmony_ci */ 24