1f08c3bdfSopenharmony_ciunsigned int fn1(unsigned int a) { return a >> -1; } 2f08c3bdfSopenharmony_ciunsigned int fn2(unsigned int a) { return a >> ~0; } 3f08c3bdfSopenharmony_ci 4f08c3bdfSopenharmony_ciunsigned int fo1(unsigned int a) { return a >> ((a & 0) | -1); } 5f08c3bdfSopenharmony_ciunsigned int fo2(unsigned int a) { return a >> ((a & 0) ^ ~0); } 6f08c3bdfSopenharmony_ci 7f08c3bdfSopenharmony_ci/* 8f08c3bdfSopenharmony_ci * check-name: shift-negative 9f08c3bdfSopenharmony_ci * check-command: sparse -Wno-decl $file 10f08c3bdfSopenharmony_ci * 11f08c3bdfSopenharmony_ci * check-error-start 12f08c3bdfSopenharmony_cishift-negative.c:1:48: warning: shift count is negative (-1) 13f08c3bdfSopenharmony_cishift-negative.c:2:48: warning: shift count is negative (-1) 14f08c3bdfSopenharmony_cishift-negative.c:4:59: warning: shift count is negative (-1) 15f08c3bdfSopenharmony_cishift-negative.c:5:59: warning: shift count is negative (-1) 16f08c3bdfSopenharmony_ci * check-error-end 17f08c3bdfSopenharmony_ci */ 18