linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Another code snippet that Sparse has problems with
@ 2017-09-06 23:05 Dibyendu Majumdar
  2017-09-07  1:31 ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Dibyendu Majumdar @ 2017-09-06 23:05 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

I recently found another test case that fails:

static int test_do(void) {
    int a = 0;
    int count = 27;
    switch (count % 8) {
    case 0: do {  a++;
    case 7:       a++;
    case 6:       a++;
    case 5:       a++;
    case 4:       a++;
    case 3:       a++;
    case 2:       a++;
    case 1:       a++;
            } while ((count -= 8) > 0);
    }
    if (27 != a) return 1;
    return 0;
}

This is a test snippet from 8cc (https://github.com/rui314/8cc) project.


Regards
Dibyendu

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-07 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-06 23:05 Another code snippet that Sparse has problems with Dibyendu Majumdar
2017-09-07  1:31 ` Luc Van Oostenryck
2017-09-07 10:18   ` Dibyendu Majumdar
2017-09-07 20:22     ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).