Skip to content

Commit 1811c9d

Browse files
---
yaml --- r: 104375 b: refs/heads/try c: 6656e5c h: refs/heads/master i: 104373: 17190b1 104371: 3f120cf 104367: a730272 v: v3
1 parent b183d0f commit 1811c9d

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: 3ce04dc71957d013b668f0b9cad9d40332daa1e8
5+
refs/heads/try: 6656e5cd45e00b1707badbfb188aafd03eb7ab72
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/runtest.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,12 @@ actual:\n\
258258
}
259259

260260
fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
261-
262-
// do not optimize debuginfo tests
263-
let mut config = match config.target_rustcflags {
264-
Some(ref flags) => config {
265-
target_rustcflags: Some(flags.replace("-O", "")),
266-
.. (*config).clone()
267-
},
268-
None => (*config).clone()
261+
let mut config = config {
262+
target_rustcflags: cleanup_debug_info_options(&config.target_rustcflags),
263+
host_rustcflags: cleanup_debug_info_options(&config.host_rustcflags),
264+
.. config.clone()
269265
};
266+
270267
let config = &mut config;
271268
let check_lines = &props.check_lines;
272269
let mut cmds = props.debugger_cmds.connect("\n");
@@ -436,6 +433,20 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
436433
check_lines[i]), &ProcRes);
437434
}
438435
}
436+
437+
fn cleanup_debug_info_options(options: &Option<~str>) -> Option<~str> {
438+
if options.is_none() {
439+
return None;
440+
}
441+
442+
// Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS.
443+
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
444+
let new_options = split_maybe_args(options).move_iter()
445+
.filter(|x| !options_to_remove.contains(x))
446+
.to_owned_vec()
447+
.connect(" ");
448+
Some(new_options)
449+
}
439450
}
440451

441452
fn check_error_patterns(props: &TestProps,

0 commit comments

Comments
 (0)