Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: fix a few ilp32 tests
details: https://anonhg.NetBSD.org/src/rev/c6c1ce3efc6b
branches: trunk
changeset: 377347:c6c1ce3efc6b
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 08 11:03:00 2023 +0000
description:
tests/lint: fix a few ilp32 tests
diffstat:
tests/usr.bin/xlint/lint1/check-expect.lua | 8 ++++----
tests/usr.bin/xlint/lint1/msg_218.c | 19 +++++++++++++++----
tests/usr.bin/xlint/lint1/msg_230_uchar.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_247_ilp32_ldbl64.c | 4 ++--
4 files changed, 23 insertions(+), 12 deletions(-)
diffs (110 lines):
diff -r 14c73ea2ddf2 -r c6c1ce3efc6b tests/usr.bin/xlint/lint1/check-expect.lua
--- a/tests/usr.bin/xlint/lint1/check-expect.lua Sat Jul 08 10:59:38 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/check-expect.lua Sat Jul 08 11:03:00 2023 +0000
@@ -1,5 +1,5 @@
#! /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.6 2023/07/08 10:01:17 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.7 2023/07/08 11:03:00 rillig Exp $
--[[
@@ -37,8 +37,8 @@ end
local function load_lines(fname)
local lines = {}
- local f = io.open(fname, "r")
- if f == nil then return nil end
+ local f, err, errno = io.open(fname, "r")
+ if f == nil then return nil, err, errno end
for line in f:lines() do
table.insert(lines, line)
@@ -194,7 +194,7 @@ end)
local function insert_missing(missing)
for fname, items in pairs(missing) do
table.sort(items, function(a, b) return a.lineno > b.lineno end)
- local lines = load_lines(fname)
+ local lines = assert(load_lines(fname))
for _, item in ipairs(items) do
local lineno, message = item.lineno, item.message
local indent = (lines[lineno] or ""):match("^([ \t]*)")
diff -r 14c73ea2ddf2 -r c6c1ce3efc6b tests/usr.bin/xlint/lint1/msg_218.c
--- a/tests/usr.bin/xlint/lint1/msg_218.c Sat Jul 08 10:59:38 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_218.c Sat Jul 08 11:03:00 2023 +0000
@@ -1,15 +1,17 @@
-/* $NetBSD: msg_218.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */
+/* $NetBSD: msg_218.c,v 1.8 2023/07/08 11:03:00 rillig Exp $ */
# 3 "msg_218.c"
-// Test for message: ANSI C treats constant as unsigned, op '%s' [218]
+/* Test for message: ANSI C treats constant as unsigned, op '%s' [218] */
/* lint1-only-if: ilp32 */
-/* lint1-extra-flags: -X 351 */
+/* lint1-flags: -w -X 351 */
-_Bool cond;
+int cond;
signed int s32;
unsigned int u32;
+/* expect+1: warning: C90 does not support 'long long' [265] */
signed long long s64;
+/* expect+1: warning: C90 does not support 'long long' [265] */
unsigned long long u64;
void sink_int(int);
@@ -18,6 +20,7 @@ void sink_int(int);
void
test_signed_int(void)
{
+ /* expect+2: warning: ANSI C treats constant as unsigned, op '-' [218] */
/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
sink_int(-2147483648);
}
@@ -37,12 +40,20 @@ test_signed_int(void)
void
compare_large_constant(void)
{
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = s32 < 3000000000L;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = 3000000000L < s32;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = u32 < 3000000000L;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = 3000000000L < u32;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = s64 < 3000000000L;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = 3000000000L < s64;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = u64 < 3000000000L;
+ /* expect+1: warning: ANSI C treats constant as unsigned, op '<' [218] */
cond = 3000000000L < u64;
}
diff -r 14c73ea2ddf2 -r c6c1ce3efc6b tests/usr.bin/xlint/lint1/msg_230_uchar.c
--- a/tests/usr.bin/xlint/lint1/msg_230_uchar.c Sat Jul 08 10:59:38 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_230_uchar.c Sat Jul 08 11:03:00 2023 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_230_uchar.c,v 1.12 2023/06/24 17:50:31 rillig Exp $ */
+/* $NetBSD: msg_230_uchar.c,v 1.13 2023/07/08 11:03:00 rillig Exp $ */
# 3 "msg_230_uchar.c"
// Test for message: nonportable character comparison '%s' [230]
-/* lint1-flags: -S -g -p -w */
+/* lint1-flags: -S -g -p -w -X 351 */
/* lint1-only-if: uchar */
/*
diff -r 14c73ea2ddf2 -r c6c1ce3efc6b tests/usr.bin/xlint/lint1/msg_247_ilp32_ldbl64.c
--- a/tests/usr.bin/xlint/lint1/msg_247_ilp32_ldbl64.c Sat Jul 08 10:59:38 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_247_ilp32_ldbl64.c Sat Jul 08 11:03:00 2023 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: msg_247_ilp32_ldbl64.c,v 1.2 2023/07/05 11:42:14 rillig Exp $ */
-# 3 "msg_247_ilp32.c"
+/* $NetBSD: msg_247_ilp32_ldbl64.c,v 1.3 2023/07/08 11:03:00 rillig Exp $ */
+# 3 "msg_247_ilp32_ldbl64.c"
// Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
Home |
Main Index |
Thread Index |
Old Index