Skip to content

Commit

Permalink
validation: inline switch statement
Browse files Browse the repository at this point in the history
This bug is reported by Randy. Al provides the simplify
version of the test case.

It generate error message on the current sparse:

warning: unreplaced symbol 'val'

This is some bug in the switch inline code.

Signed-off-by: Christopher Li <sparse@chrisli.org>
  • Loading branch information
sparsecli committed Aug 14, 2011
1 parent 064f61f commit 5b57cb8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions validation/bug_inline_switch.c
@@ -0,0 +1,25 @@

#define __u16 unsigned short
int foo(__u16 n);
static inline __u16 f(__u16 val)
{
return val;
}

static inline unsigned int bar(__u16 n)
{
switch (n) {
case (1 ? 1 : f(1)):
return 4;
}
}

int foo(__u16 n)
{
bar(n);
bar(n);
return 0;
}
/*
* check-name: inlining switch statement
*/

0 comments on commit 5b57cb8

Please sign in to comment.