about summary refs log tree commit diff
path: root/src/test/incremental
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2016-09-26 17:14:31 -0400
committerMichael Woerister <michaelwoerister@posteo.net>2016-09-26 17:14:31 -0400
commit1e5c253aa1b0a9f6c753773e3efb7142cfc81638 (patch)
tree7f4e22137fd1aa27de1c64827392c099e9778233 /src/test/incremental
parent76f76ae1d82fda88e5cf3e5900885496425722f8 (diff)
downloadrust-1e5c253aa1b0a9f6c753773e3efb7142cfc81638.tar.gz
rust-1e5c253aa1b0a9f6c753773e3efb7142cfc81638.zip
incr.comp.: Add test case for cache artifact file headers.
Diffstat (limited to 'src/test/incremental')
-rw-r--r--src/test/incremental/cache_file_headers.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/incremental/cache_file_headers.rs b/src/test/incremental/cache_file_headers.rs
new file mode 100644
index 00000000000..274a3920be8
--- /dev/null
+++ b/src/test/incremental/cache_file_headers.rs
@@ -0,0 +1,29 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// This test case makes sure that the compiler does not try to re-use anything
+// from the incremental compilation cache if the cache was produced by a
+// different compiler version. This is tested by artificially forcing the
+// emission of a different compiler version in the header of rpass1 artifacts,
+// and then making sure that the only object file of the test program gets
+// re-translated although the program stays unchanged.
+
+// The `l33t haxx0r` Rust compiler is known to produce incr. comp. artifacts
+// that are outrageously incompatible with just about anything, even itself:
+//[rpass1] rustc-env:RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="l33t haxx0r rustc 2.1 LTS"
+
+// revisions:rpass1 rpass2
+
+#![feature(rustc_attrs)]
+#![rustc_partition_translated(module="cache_file_headers", cfg="rpass2")]
+
+fn main() {
+    // empty
+}