testsuite: grep the expected output only when needed
[smatch.git] / validation / bool-cast-bad.c
bloba0b091e1c6b7aacae06db2afd52ef42a2346b2bc
1 typedef unsigned short __attribute__((bitwise)) le16;
2 struct s {
3 int a:2;
4 int b:2;
5 int c:2;
6 };
8 static _Bool fresi(le16 a) { return a; }
9 static _Bool frese(le16 a) { return (_Bool)a; }
10 static _Bool fstsi(struct s a) { return a; }
11 static _Bool fstse(struct s a) { return (_Bool)a; }
14 * check-name: bool-cast-bad.c
15 * check-command: sparse $file
17 * check-error-start
18 bool-cast-bad.c:9:42: warning: cast from restricted le16
19 bool-cast-bad.c:10:41: warning: incorrect type in return expression (different base types)
20 bool-cast-bad.c:10:41: expected bool
21 bool-cast-bad.c:10:41: got struct s a
22 bool-cast-bad.c:11:42: warning: cast from non-scalar
23 * check-error-end