>From bc070830dcb1c931472ed38c2b0faa0606a4682d Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Fri, 30 Oct 2020 02:46:44 +0100 Subject: [PATCH] test-verify.c: avoid -Wmissing-declarations warnings * tests/test-verify.c (test_assume_expressions): Add declaration. (test_assume_optimization): Likewise. (test_assume_noreturn): Likewise. (main): Move down after all other definitions. While at it, also call test_assume_expressions and test_assume_optimization as a runtime check. --- ChangeLog | 10 ++++++++++ tests/test-verify.c | 20 ++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4eb5bcb1d..847b1b62c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2020-10-30 Bernhard Voelker + + test-verify.c: avoid -Wmissing-declarations warnings + * tests/test-verify.c (test_assume_expressions): Add declaration. + (test_assume_optimization): Likewise. + (test_assume_noreturn): Likewise. + (main): Move down after all other definitions. While at it, also + call test_assume_expressions and test_assume_optimization as a + runtime check. + 2020-10-26 Paul Eggert sys_stat: update comments for S_IRWXUGO, S_IXUGO diff --git a/tests/test-verify.c b/tests/test-verify.c index 05e113c0a..1ed78c930 100644 --- a/tests/test-verify.c +++ b/tests/test-verify.c @@ -64,12 +64,6 @@ function (int n) return 0; } -int -main (void) -{ - return !(function (0) == 0 && function (1) == 8); -} - /* ============================== Test assume ============================== */ static int @@ -80,6 +74,10 @@ f (int a) typedef struct { unsigned int context : 4; unsigned int halt : 1; } state; +void test_assume_expressions (state *s); +int test_assume_optimization (int x); +void test_assume_noreturn (void); + void test_assume_expressions (state *s) { @@ -109,3 +107,13 @@ test_assume_noreturn (void) This function should not elicit a warning. */ assume (0); } + +/* ============================== Main ===================================== */ +int +main (void) +{ + state s; + test_assume_expressions (&s); + test_assume_optimization (5); + return !(function (0) == 0 && function (1) == 8); +} -- 2.29.0