Skip to content

Commit

Permalink
Update two failing incremental tests for the new behavior
Browse files Browse the repository at this point in the history
On the nopt builders, we disable optimization by default for all tests
which causes the new behavior to take effect and causes the tests to
fail when they should not. By passing the `-O` flag explicitly, we will
always run these tests with optimizations enabled.
  • Loading branch information
wesleywiser committed Dec 9, 2020
1 parent 3186267 commit aeb3061
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/test/incremental/hygiene/load_cached_hygiene.rs
@@ -1,5 +1,5 @@
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -O
// aux-build:cached_hygiene.rs

// This tests the folllowing scenario
Expand All @@ -19,7 +19,12 @@
// the metadata. Specifically, we were not resetting `orig_id`
// for an `EpxnData` generate in the current crate, which would cause
// us to serialize the `ExpnId` pointing to a garbage location in
// the metadata.
// the metadata.o

// NOTE: We're explicitly passing the `-O` optimization flag because if optimizations are not
// enabled, then rustc will ignore the `#[inline(always)]` attribute which means we do not load
// the optimized mir for the unmodified function to be loaded and so the CGU containing that
// function will be reused.

#![feature(rustc_attrs)]

Expand Down
9 changes: 8 additions & 1 deletion src/test/incremental/remapped_paths_cc/main.rs
@@ -1,11 +1,18 @@
// revisions:rpass1 rpass2 rpass3
// compile-flags: -Z query-dep-graph -g
// compile-flags: -Z query-dep-graph -g -O
// aux-build:extern_crate.rs

// ignore-asmjs wasm2js does not support source maps yet

// This test case makes sure that we detect if paths emitted into debuginfo
// are changed, even when the change happens in an external crate.

// NOTE: We're explicitly passing the `-O` optimization flag because if no optimizations are
// requested, rustc will ignore the `#[inline]` attribute. This is a performance optimization for
// non-optimized builds which causes us to generate fewer copies of inlined functions when
// runtime performance doesn't matter. Without this flag, the function will go into a different
// CGU which can be reused by this crate.

#![feature(rustc_attrs)]

#![rustc_partition_reused(module="main", cfg="rpass2")]
Expand Down

0 comments on commit aeb3061

Please sign in to comment.