about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make-fulldeps/issue-19371/foo.rs2
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks7
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.with_frame_pointers.checks7
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.without_frame_pointers.checks (renamed from tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks)0
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh8
-rw-r--r--tests/ui-fulldeps/mod_dir_path_canonicalized.rs8
-rw-r--r--tests/ui-fulldeps/pprust-expr-roundtrip.rs10
7 files changed, 26 insertions, 16 deletions
diff --git a/tests/run-make-fulldeps/issue-19371/foo.rs b/tests/run-make-fulldeps/issue-19371/foo.rs
index a0bbe3851e8..327c99a02c6 100644
--- a/tests/run-make-fulldeps/issue-19371/foo.rs
+++ b/tests/run-make-fulldeps/issue-19371/foo.rs
@@ -56,7 +56,7 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
         file_loader: None,
         locale_resources: &[],
         lint_caps: Default::default(),
-        parse_sess_created: None,
+        psess_created: None,
         hash_untracked_state: None,
         register_lints: None,
         override_queries: None,
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks
index d4a3d447901..1d8fc96ad50 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/cmake_plus_one_cxx_global_asm.checks
@@ -1,2 +1,7 @@
 CHECK: cmake_plus_one_cxx_global_asm
-CHECK: lfence
+CHECK-NEXT: movl
+CHECK-NEXT: lfence
+CHECK-NEXT: incl
+CHECK-NEXT: shlq    $0x0, (%rsp)
+CHECK-NEXT: lfence
+CHECK-NEXT: retq
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.with_frame_pointers.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.with_frame_pointers.checks
new file mode 100644
index 00000000000..485e20e3111
--- /dev/null
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.with_frame_pointers.checks
@@ -0,0 +1,7 @@
+CHECK: print
+CHECK:      lfence
+CHECK:      popq
+CHECK:      popq
+CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
+CHECK-NEXT: lfence
+CHECK-NEXT: jmpq *[[REGISTER]]
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.without_frame_pointers.checks
index e02fe094889..e02fe094889 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.without_frame_pointers.checks
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
index 04a34724518..a36ad916beb 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
@@ -34,8 +34,9 @@ function check {
       ${enclave} > ${asm}
     ${filecheck} --input-file ${asm} ${checks}
 
-    if [ "${func_re}" != "rust_plus_one_global_asm" &&
-         "${func_re}" != "cmake_plus_one_c_global_asm" ]; then
+    if [ "${func_re}" != "rust_plus_one_global_asm" ] &&
+         [ "${func_re}" != "cmake_plus_one_c_global_asm" ] &&
+         [ "${func_re}" != "cmake_plus_one_cxx_global_asm" ]; then
         # The assembler cannot avoid explicit `ret` instructions. Sequences
         # of `shlq $0x0, (%rsp); lfence; retq` are used instead.
         # https://www.intel.com/content/www/us/en/developer/articles/technical/
@@ -48,7 +49,8 @@ build
 
 check "unw_getcontext" unw_getcontext.checks
 check "__libunwind_Registers_x86_64_jumpto" jumpto.checks
-check 'std::io::stdio::_print::[[:alnum:]]+' print.checks
+check 'std::io::stdio::_print::[[:alnum:]]+' print.with_frame_pointers.checks ||
+    check 'std::io::stdio::_print::[[:alnum:]]+' print.without_frame_pointers.checks
 check rust_plus_one_global_asm rust_plus_one_global_asm.checks
 
 check cc_plus_one_c cc_plus_one_c.checks
diff --git a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
index 8ffc4669ee2..ef70e64ed7e 100644
--- a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
+++ b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
@@ -18,7 +18,6 @@ extern crate rustc_driver;
 
 use rustc_parse::new_parser_from_file;
 use rustc_session::parse::ParseSess;
-use rustc_span::source_map::FilePathMapping;
 use std::path::Path;
 
 #[path = "mod_dir_simple/test.rs"]
@@ -31,13 +30,10 @@ pub fn main() {
 }
 
 fn parse() {
-    let parse_session = ParseSess::new(
-        vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
-        FilePathMapping::empty()
-    );
+    let psess = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]);
 
     let path = Path::new(file!());
     let path = path.canonicalize().unwrap();
-    let mut parser = new_parser_from_file(&parse_session, &path, None);
+    let mut parser = new_parser_from_file(&psess, &path, None);
     let _ = parser.parse_crate_mod();
 }
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index e1c326c6a91..475a69f4ad0 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -38,16 +38,16 @@ use rustc_ast::*;
 use rustc_ast_pretty::pprust;
 use rustc_parse::new_parser_from_source_str;
 use rustc_session::parse::ParseSess;
-use rustc_span::source_map::{FilePathMapping, Spanned};
+use rustc_span::source_map::Spanned;
 use rustc_span::symbol::Ident;
 use rustc_span::{FileName, DUMMY_SP};
 use thin_vec::{thin_vec, ThinVec};
 
-fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> {
+fn parse_expr(psess: &ParseSess, src: &str) -> Option<P<Expr>> {
     let src_as_string = src.to_string();
 
     let mut p =
-        new_parser_from_source_str(ps, FileName::Custom(src_as_string.clone()), src_as_string);
+        new_parser_from_source_str(psess, FileName::Custom(src_as_string.clone()), src_as_string);
     p.parse_expr().map_err(|e| e.cancel()).ok()
 }
 
@@ -225,7 +225,7 @@ fn main() {
 }
 
 fn run() {
-    let ps = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty());
+    let psess = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]);
 
     iter_exprs(2, &mut |mut e| {
         // If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,
@@ -234,7 +234,7 @@ fn run() {
         println!("printed: {}", printed);
 
         // Ignore expressions with chained comparisons that fail to parse
-        if let Some(mut parsed) = parse_expr(&ps, &printed) {
+        if let Some(mut parsed) = parse_expr(&psess, &printed) {
             // We want to know if `parsed` is structurally identical to `e`, ignoring trivial
             // differences like placement of `Paren`s or the exact ranges of node spans.
             // Unfortunately, there is no easy way to make this comparison. Instead, we add `Paren`s