aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-03-28 23:00:00 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-03-28 23:34:18 -0400
commit5dc4fcae34ee3a5a3d47021f8ea8b2c5d3b14ea9 (patch)
tree296fce680e19e23979f657f6a3db49626b401e95 /test cases
parent81c3c3808e611adeda204891f7f14228fc51efee (diff)
downloadmeson-5dc4fcae34ee3a5a3d47021f8ea8b2c5d3b14ea9.zip
meson-5dc4fcae34ee3a5a3d47021f8ea8b2c5d3b14ea9.tar.gz
meson-5dc4fcae34ee3a5a3d47021f8ea8b2c5d3b14ea9.tar.bz2
test cases: make various things werror-safe
Allows getting closer to `./run_project_tests.py -- -Dwerror=true`. - when argc and argv are not *both* used, there's a standard, compliant mechanism to mark the variable as unused - generated code should not build as -Werror - more thoroughly comment out some commented code
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/117 shared module/meson.build1
-rw-r--r--test cases/common/147 simd/simd_mmx.c6
-rw-r--r--test cases/common/148 shared module resolving symbol in executable/prog.c2
-rw-r--r--test cases/common/245 custom target index source/main.c4
-rw-r--r--test cases/rust/12 bindgen/dependencies/meson.build2
5 files changed, 11 insertions, 4 deletions
diff --git a/test cases/common/117 shared module/meson.build b/test cases/common/117 shared module/meson.build
index 936c839..94d17a7 100644
--- a/test cases/common/117 shared module/meson.build
+++ b/test cases/common/117 shared module/meson.build
@@ -36,5 +36,6 @@ test('import test 2', e, args : m2)
# Shared module that does not export any symbols
shared_module('nosyms', 'nosyms.c',
+ override_options: ['werror=false'],
install : true,
install_dir : join_paths(get_option('libdir'), 'modules'))
diff --git a/test cases/common/147 simd/simd_mmx.c b/test cases/common/147 simd/simd_mmx.c
index 7605442..443deaf 100644
--- a/test cases/common/147 simd/simd_mmx.c
+++ b/test cases/common/147 simd/simd_mmx.c
@@ -45,14 +45,16 @@ void increment_mmx(float arr[4]) {
* enough to fit in int16;
*/
int i;
+ /* This is unused due to below comment about GCC 8.
__m64 packed = _mm_set_pi16(arr[3], arr[2], arr[1], arr[0]);
__m64 incr = _mm_set1_pi16(1);
__m64 result = _mm_add_pi16(packed, incr);
- /* Should be
+ int64_t unpacker = (int64_t)(result);
+ */
+ /* The above should be
* int64_t unpacker = _m_to_int64(result);
* but it does not exist on 32 bit platforms for some reason.
*/
- int64_t unpacker = (int64_t)(result);
_mm_empty();
for(i=0; i<4; i++) {
/* This fails on GCC 8 when optimizations are enabled.
diff --git a/test cases/common/148 shared module resolving symbol in executable/prog.c b/test cases/common/148 shared module resolving symbol in executable/prog.c
index b2abcdb..55ffee0 100644
--- a/test cases/common/148 shared module resolving symbol in executable/prog.c
+++ b/test cases/common/148 shared module resolving symbol in executable/prog.c
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
int expected, actual;
fptr importedfunc;
- if (argc=0) {}; // noop
+ (void)argc; // noop
#ifdef _WIN32
HMODULE h = LoadLibraryA(argv[1]);
diff --git a/test cases/common/245 custom target index source/main.c b/test cases/common/245 custom target index source/main.c
index 48af141..248ab20 100644
--- a/test cases/common/245 custom target index source/main.c
+++ b/test cases/common/245 custom target index source/main.c
@@ -1,8 +1,10 @@
#include <assert.h>
#include "gen.h"
-int main(int argc)
+int main(int argc, char **argv)
{
+ (void)argv;
+
assert(argc == 3);
return genfunc();
}
diff --git a/test cases/rust/12 bindgen/dependencies/meson.build b/test cases/rust/12 bindgen/dependencies/meson.build
index 37e5a42..998bd32 100644
--- a/test cases/rust/12 bindgen/dependencies/meson.build
+++ b/test cases/rust/12 bindgen/dependencies/meson.build
@@ -12,6 +12,8 @@ external_dep_rs = rust.bindgen(
external_dep = static_library(
'external_dep',
[external_dep_rs],
+ # for generated code, do not lint
+ rust_args: ['-A', 'warnings'],
dependencies : dep_zlib.partial_dependency(links : true),
)