From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/cc/tests/test.rs | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'vendor/cc/tests') diff --git a/vendor/cc/tests/test.rs b/vendor/cc/tests/test.rs index 35ef87577..161abd8ab 100644 --- a/vendor/cc/tests/test.rs +++ b/vendor/cc/tests/test.rs @@ -20,7 +20,7 @@ fn gnu_smoke() { test.cmd(0) .must_have("-O2") .must_have("foo.c") - .must_not_have("-g") + .must_not_have("-gdwarf-4") .must_have("-c") .must_have("-ffunction-sections") .must_have("-fdata-sections"); @@ -52,11 +52,26 @@ fn gnu_opt_level_s() { .must_not_have("-Oz"); } +#[test] +fn gnu_debug() { + let test = Test::gnu(); + test.gcc().debug(true).file("foo.c").compile("foo"); + test.cmd(0).must_have("-gdwarf-4"); + + let test = Test::gnu(); + test.gcc() + .target("x86_64-apple-darwin") + .debug(true) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-gdwarf-2"); +} + #[test] fn gnu_debug_fp_auto() { let test = Test::gnu(); test.gcc().debug(true).file("foo.c").compile("foo"); - test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-gdwarf-4"); test.cmd(0).must_have("-fno-omit-frame-pointer"); } @@ -64,7 +79,7 @@ fn gnu_debug_fp_auto() { fn gnu_debug_fp() { let test = Test::gnu(); test.gcc().debug(true).file("foo.c").compile("foo"); - test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-gdwarf-4"); test.cmd(0).must_have("-fno-omit-frame-pointer"); } @@ -78,7 +93,7 @@ fn gnu_debug_nofp() { .force_frame_pointer(false) .file("foo.c") .compile("foo"); - test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-gdwarf-4"); test.cmd(0).must_not_have("-fno-omit-frame-pointer"); let test = Test::gnu(); @@ -87,7 +102,7 @@ fn gnu_debug_nofp() { .debug(true) .file("foo.c") .compile("foo"); - test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-gdwarf-4"); test.cmd(0).must_not_have("-fno-omit-frame-pointer"); } @@ -427,3 +442,20 @@ fn msvc_no_dash_dash() { test.cmd(0).must_not_have("--"); } + +// Disable this test with the parallel feature because the execution +// order is not deterministic. +#[cfg(not(feature = "parallel"))] +#[test] +fn asm_flags() { + let test = Test::gnu(); + test.gcc() + .file("foo.c") + .file("x86_64.asm") + .file("x86_64.S") + .asm_flag("--abc") + .compile("foo"); + test.cmd(0).must_not_have("--abc"); + test.cmd(1).must_have("--abc"); + test.cmd(2).must_have("--abc"); +} -- cgit v1.2.3