tests/lint: add tests for messages 8, 9 and 10

This commit is contained in:
rillig 2021-08-14 14:25:51 +00:00
parent fae32f15bd
commit e9a30eaa0d
6 changed files with 40 additions and 6 deletions

View File

@ -0,0 +1 @@
func returns value which is always ignored

View File

@ -1,6 +1,16 @@
# $NetBSD: msg_008.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
# $NetBSD: msg_008.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
#
# Test data for message 8 of lint2:
# %s returns value which is always ignored
#
# TODO: add actual test data
0smsg_008.c
Smsg_008.c
# 100: bool func(void) { return true }
100 d 0.100 drs 4func F0 B
# 110: func();
110 c 0.110 i 4func f0 B
# 111: func();
111 c 0.111 i 4func f0 B

View File

@ -0,0 +1 @@
func returns value which is sometimes ignored

View File

@ -1,6 +1,16 @@
# $NetBSD: msg_009.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
# $NetBSD: msg_009.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
#
# Test data for message 9 of lint2:
# %s returns value which is sometimes ignored
#
# TODO: add actual test data
0smsg_009.c
Smsg_009.c
# 100: bool func(void) { return true }
100 d 0.100 drs 4func F0 B
# 110: var = func();
110 c 0.110 u 4func f0 B
# 111: func();
111 c 0.111 i 4func f0 B

View File

@ -0,0 +1 @@
func value is used( msg_010.c?(30) ), but none returned

View File

@ -1,6 +1,17 @@
# $NetBSD: msg_010.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
# $NetBSD: msg_010.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
#
# Test data for message 10 of lint2:
# %s value is used( %s ), but none returned
#
# TODO: add actual test data
0 s msg_010.c
S msg_010.c
1 s msg_010_use.c
# msg_010.c:10: func() {}
10 d 0.10 d o 4func f0I
# msg_010_use.c:20: func();
20 d 1.20 e 4func F I
# msg_010_use.c:30: use() { return func(); }
30 c 1.30 u 4func f 0 I