Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make tests/make: clean up variants that are tested



details:   https://anonhg.NetBSD.org/src/rev/64da1ee7936c
branches:  trunk
changeset: 359880:64da1ee7936c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 29 10:44:40 2022 +0000

description:
tests/make: clean up variants that are tested

Since main.c 1.373 from 2020-10-18, make does not use iovec anymore, so
remove that test variant.

Document the details of why generating the test coverage took so long on
NetBSD < 10.

Add another test variant with optimization for binary size (-Os), since
with that option, GCC 10 does not perform the same data flow analysis as
with -O2, in particular it gets confused about whether local variables
are correctly initialized across function calls.

diffstat:

 usr.bin/make/test-variants.sh |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (55 lines):

diff -r 1d3a3c26feb5 -r 64da1ee7936c usr.bin/make/test-variants.sh
--- a/usr.bin/make/test-variants.sh     Sat Jan 29 10:21:26 2022 +0000
+++ b/usr.bin/make/test-variants.sh     Sat Jan 29 10:44:40 2022 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: test-variants.sh,v 1.14 2021/12/09 20:47:33 rillig Exp $
+# $NetBSD: test-variants.sh,v 1.15 2022/01/29 10:44:40 rillig Exp $
 #
 # Build several variants of make and run the tests on them.
 #
@@ -108,6 +108,10 @@
 #
 testcase USER_CFLAGS="-O3"
 
+# When optimizing for small code size, GCC gets confused by the initialization
+# status of local variables in some cases.
+testcase USER_CFLAGS="-Os"
+
 testcase USER_CFLAGS="-O0 -ggdb"
 
 # The make source code is _intended_ to be compatible with C90.
@@ -142,9 +146,6 @@
 # Is expected to fail with "<stdbool.h> is included in pre-C99 mode".
 testcase USER_CFLAGS="-ansi" USER_CPPFLAGS="-Dinline="
 
-# config.h does not allow overriding these features
-#testcase USER_CPPFLAGS="-UUSE_IOVEC"
-
 # Ensure that there are only side-effect-free conditions in the assert
 # macro, or at least none that affect the outcome of the tests.
 #
@@ -156,18 +157,17 @@
 # -x and -v flags from echoing the commands from profile files.
 testcase USER_CPPFLAGS="-UMAKE_NATIVE -DHAVE_STRERROR -DHAVE_SETENV -DHAVE_VSNPRINTF"
 
-# Running the code coverage using gcov takes a long time.  Most of this
-# time is spent in gcov_read_unsigned because gcov_open sets the .gcda
-# file to unbuffered, which means that every single byte needs its own
-# system call to be read.
+# Running the code coverage using gcov took a long time on NetBSD < 10, due to
+# https://gnats.netbsd.org/55808.
 #
 # Combining USE_COVERAGE with USE_GCC10 or HAVE_LLVM does not work since
 # these fail to link with the coverage library.
 #
-# Turning the optimization off is required because of:
+# Turning the optimization off is required because gcov does not work on the
+# source code level but on the intermediate code after optimization:
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96622
 #
-#testcase USE_COVERAGE="yes" USER_CFLAGS="-O0 -ggdb"
+testcase USE_COVERAGE="yes" USER_CFLAGS="-O0 -ggdb"
 
 testcase USE_FORT="yes"
 



Home | Main Index | Thread Index | Old Index