1static void foo(int x)
2{
3	__context__(0);		// OK
4	__context__(x, 0);	// OK
5	__context__ (x, 1);	// OK
6
7	__context__(x);		// KO: no const expr
8	__context__(1,x);	// KO: no const expr
9
10	__context__;		// KO: no expression at all
11	__context__(;		// KO: no expression at all
12
13	__context__ 0;		// KO: need parens
14	__context__ x, 0;	// KO: need parens
15	__context__(x, 0;	// KO: unmatched parens
16	__context__ x, 0);	// KO: unmatched parens
17	__context__(0;		// KO: unmatched parens
18	__context__ 0);		// KO: unmatched parens
19
20	__context__();		// KO: no expression at all
21	__context__(,0);	// KO: no expression at all
22	__context__(x,);	// KO: no expression at all
23	__context__(,);		// KO: no expression at all
24}
25
26/*
27 * check-name: context-stmt
28 * check-command: sparse -Wno-context $file
29 *
30 * check-error-start
31context-stmt.c:10:20: error: Expected ( after __context__ statement
32context-stmt.c:10:20: error: got ;
33context-stmt.c:11:21: error: expression expected after '('
34context-stmt.c:11:21: error: got ;
35context-stmt.c:11:21: error: Expected ) at end of __context__ statement
36context-stmt.c:11:21: error: got ;
37context-stmt.c:13:21: error: Expected ( after __context__ statement
38context-stmt.c:13:21: error: got 0
39context-stmt.c:14:21: error: Expected ( after __context__ statement
40context-stmt.c:14:21: error: got x
41context-stmt.c:15:25: error: Expected ) at end of __context__ statement
42context-stmt.c:15:25: error: got ;
43context-stmt.c:16:21: error: Expected ( after __context__ statement
44context-stmt.c:16:21: error: got x
45context-stmt.c:17:22: error: Expected ) at end of __context__ statement
46context-stmt.c:17:22: error: got ;
47context-stmt.c:18:21: error: Expected ( after __context__ statement
48context-stmt.c:18:21: error: got 0
49context-stmt.c:20:21: error: expression expected after '('
50context-stmt.c:20:21: error: got )
51context-stmt.c:21:21: error: expression expected after '('
52context-stmt.c:21:21: error: got ,
53context-stmt.c:22:23: error: expression expected after ','
54context-stmt.c:22:23: error: got )
55context-stmt.c:23:21: error: expression expected after '('
56context-stmt.c:23:21: error: got ,
57context-stmt.c:23:22: error: expression expected after ','
58context-stmt.c:23:22: error: got )
59context-stmt.c:7:21: error: bad constant expression
60context-stmt.c:8:23: error: bad constant expression
61 * check-error-end
62 */
63