diff options
Diffstat (limited to 'cc/tests/test.rs')
-rw-r--r-- | cc/tests/test.rs | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/cc/tests/test.rs b/cc/tests/test.rs index 74eca1e..def11f0 100644 --- a/cc/tests/test.rs +++ b/cc/tests/test.rs @@ -1,7 +1,4 @@ -extern crate cc; -extern crate tempdir; - -use support::Test; +use crate::support::Test; mod support; @@ -42,10 +39,40 @@ fn gnu_opt_level_s() { } #[test] -fn gnu_debug() { +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("-fno-omit-frame-pointer"); +} + +#[test] +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("-fno-omit-frame-pointer"); +} + +#[test] +fn gnu_debug_nofp() { + let test = Test::gnu(); + test.gcc() + .debug(true) + .force_frame_pointer(false) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_not_have("-fno-omit-frame-pointer"); + + let test = Test::gnu(); + test.gcc() + .force_frame_pointer(false) + .debug(true) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_not_have("-fno-omit-frame-pointer"); } #[test] |