diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-07-09 11:15:06 +0200 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-07-10 09:47:49 -0700 |
| commit | 2dc4ddeccbb01b8e35bf378b1c447799124d188a (patch) | |
| tree | 37fa67001877a3a7ec23c218dd2c7ce256b1a6ec | |
| parent | 1c14c08aabfd4852451d194a6f5aee9568fe4455 (diff) | |
| download | meson-2dc4ddeccbb01b8e35bf378b1c447799124d188a.tar.gz | |
unittests: add test for c_link_args and CFLAGS interaction
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | unittests/linuxliketests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 376c3959e..c25449c98 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -446,6 +446,24 @@ class LinuxlikeTests(BasePlatformTests): libdir = self.installdir + os.path.join(self.prefix, self.libdir) self._test_soname_impl(libdir, True) + @skip_if_not_base_option('b_sanitize') + def test_c_link_args_and_env(self): + ''' + Test that the CFLAGS / CXXFLAGS environment variables are + included on the linker command line when c_link_args is + set but c_args is not. + ''' + if is_cygwin(): + raise SkipTest('asan not available on Cygwin') + if is_openbsd(): + raise SkipTest('-fsanitize=address is not supported on OpenBSD') + + testdir = os.path.join(self.common_test_dir, '1 trivial') + env = {'CFLAGS': '-fsanitize=address'} + self.init(testdir, extra_args=['-Dc_link_args="-L/usr/lib"'], + override_envvars=env) + self.build() + def test_compiler_check_flags_order(self): ''' Test that compiler check flags override all other flags. This can't be |
