summaryrefslogtreecommitdiffstats
path: root/vendor/cc/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /vendor/cc/tests
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/cc/tests')
-rw-r--r--vendor/cc/tests/test.rs42
1 files changed, 37 insertions, 5 deletions
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");
@@ -53,10 +53,25 @@ fn gnu_opt_level_s() {
}
#[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");
+}