1*1f5207b7SJohn Levon /*
2*1f5207b7SJohn Levon  * Sparse used to get this wrong.
3*1f5207b7SJohn Levon  *
4*1f5207b7SJohn Levon  * When evaluating the argument to the inline function for the array, Sparse
5*1f5207b7SJohn Levon  * didn't properly demote the "char []" to a "char *", but instead it would
6*1f5207b7SJohn Levon  * follow the dereference and get a "struct hello".
7*1f5207b7SJohn Levon  *
8*1f5207b7SJohn Levon  * Which made no sense at all.
9*1f5207b7SJohn Levon  */
10*1f5207b7SJohn Levon 
deref(const char * s)11*1f5207b7SJohn Levon static inline int deref(const char *s)
12*1f5207b7SJohn Levon {
13*1f5207b7SJohn Levon 	return *s;
14*1f5207b7SJohn Levon }
15*1f5207b7SJohn Levon 
16*1f5207b7SJohn Levon struct hello {
17*1f5207b7SJohn Levon 	char array[10];
18*1f5207b7SJohn Levon };
19*1f5207b7SJohn Levon 
test(struct hello * arg)20*1f5207b7SJohn Levon static int test(struct hello *arg)
21*1f5207b7SJohn Levon {
22*1f5207b7SJohn Levon 	return deref(arg->array);
23*1f5207b7SJohn Levon }
24*1f5207b7SJohn Levon 
25*1f5207b7SJohn Levon /*
26*1f5207b7SJohn Levon  * check-name: "char []" to "char *" demotion
27*1f5207b7SJohn Levon  */
28