Add some test-suite metadata for various tests
PATCH 1/1 Add some test-suite metadata for various tests
Signed-off-by Ramsay Jones <[email protected]>
---
Note that while re-basing this patch, git told me that it introduced some trailing whitespace to validation/cond_expr.c; in particular to the second line of the error message. If you look at show-parse.c:256, you will see that sparse does indeed introduce tailing whitespace.
Also note that preprocessor13.c crashes gcc 4.1.2 (ubuntu) but not gcc 3.4.4 (cygwin). Furthermore, preprocessor14.c produces different output from gcc and sparse (and I think both are wrong!). However, since the precedence and associativity of the # and ## operators are undefined, then the answer is probably implementation defined.
ATB,
Ramsay Jones
validation/check_byte_count-ice.c | 8 ++++++++ validation/cond_expr.c | 8 ++++++++ validation/double-semicolon.c | 3 +++ validation/preprocessor/preprocessor11.c | 21 +++++++++++++++++++++ validation/preprocessor/preprocessor12.c | 11 +++++++++++ validation/preprocessor/preprocessor15.c | 9 +++++++++ validation/preprocessor/preprocessor16.c | 9 +++++++++ validation/preprocessor/preprocessor7.c | 9 +++++++++ validation/preprocessor/preprocessor8.c | 22 ++++++++++++++++++++++ 9 files changed, 100 insertions(+), 0 deletions(-)
validation/check_byte_count-ice.c +8 -0
@@ -4,3 +4,11 @@ static void foo(void *a) { memset(foo, + ', 20); } +/* +* check-name: Byte Count ICE +* +* check-error-start +check_byte_count-ice.c:5:18: error: Bad character constant +check_byte_count-ice.c:5:8: error: not enough arguments for function memset +* check-error-end +*/
validation/cond_expr.c +8 -0
@@ -9,3 +9,11 @@ int a(void) {return ~(y ? : x);/* should warn */ } +/* +* check-name: type of conditional +* +* check-error-start +cond_expr.c:10:9: error: incompatible types for operation (~) +cond_expr.c:10:9: argument has type double +* check-error-end +*/
validation/double-semicolon.c +3 -0
@@ -4,3 +4,6 @@ static void test(void) struct { int foo;; } val;memset (&val,0 ,sizeof (val)); } +/* +* check-name: Empty struct field declaration +*/
validation/preprocessor/preprocessor11.c +21 -0
@@ -8,3 +8,24 @@ #define H(x...,y) #define I(...+#define J (x,y) +/* +* check-name: Preprocessor #11 +* check-command: sparse -E $file +* +* check-output-start + + +* check-output-end +* +* check-error-start +preprocessor/preprocessor11.c:1:11: error: "1" may not appear in macro parameter list +preprocessor/preprocessor11.c:2:11: error: missing ')' in macro parameter list +preprocessor/preprocessor11.c:3:12: error: missing ')' in macro parameter list +preprocessor/preprocessor11.c:4:11: error: parameter name missing +preprocessor/preprocessor11.c:5:11: error: __VA_ARGS__ can only appear in the expansion of a C99 variadic macro +preprocessor/preprocessor11.c:6:12: error: "+" may not appear in macro parameter list +preprocessor/preprocessor11.c:7:12: error: missing ')' in macro parameter list +preprocessor/preprocessor11.c:8:12: error: missing ')' in macro parameter list +preprocessor/preprocessor11.c:9:11: error: missing ')' in macro parameter list +* check-error-end +*/
validation/preprocessor/preprocessor12.c +11 -0
@@ -5,3 +5,14 @@ A(1) A(1,2)A (1 ,2 ,3 ) +/* +* check-name: Preprocessor #12 +* check-command: sparse -E $file +* +* check-output-start + +1 +1,2 +1,2,3 +* check-output-end +*/
validation/preprocessor/preprocessor15.c +9 -0
@@ -5,3 +5,12 @@ #if D(A,B) BD (1 ,2 )#endif +/* +* check-name: Preprocessor #15 +* check-command: sparse -E $file +* +* check-output-start + +12 +* check-output-end +*/
validation/preprocessor/preprocessor16.c +9 -0
@@ -19,3 +19,12 @@ they hit before we get to the level of groups.#bullshit #endif +/* +* check-name: Preprocessor #16 +* check-command: sparse -E $file +* +* check-output-start + + +* check-output-end +*/
validation/preprocessor/preprocessor7.c +9 -0
@@ -3,3 +3,12 @@#define C (x,y) E(y)#define E (y) #y A(2)) +/* +* check-name: Preprocessor #7 +* check-command: sparse -E $file +* +* check-output-start + +"\"D\"" +* check-output-end +*/
validation/preprocessor/preprocessor8.c +22 -0
@@ -14,3 +14,25 @@ "x#y" : E "ab GH \"G\" 12" : F(G,H) "a ## b" : I(a,##,b) +/* +* check-name: Preprocessor #8 +* check-command: sparse -E $file +* +* check-output-start + +"A(x)" : A(x) +"B(x)" : B(x) +"C(x)" : C(x) +"D(x)" : D(x) +"x#y" : x#y +"ab GH \"G\" 12" : ab GH "G" 12 +"a ## b" : a ## b +* check-output-end +* +* check-error-start +preprocessor/preprocessor8.c:1:14: error: '##' cannot appear at the ends of macro expansion +preprocessor/preprocessor8.c:2:16: error: '##' cannot appear at the ends of macro expansion +preprocessor/preprocessor8.c:3:22: error: '##' cannot appear at the ends of macro expansion +preprocessor/preprocessor8.c:4:15: error: '#' is not followed by a macro parameter +* check-error-end +*/
Signature · 1 line
1.5.2