From c992fced6b7ef604b8e2e8a4a1cac4b0f20dd63a Mon Sep 17 00:00:00 2001 From: Denis Drakhnya Date: Sat, 1 May 2021 14:36:48 +0300 Subject: [PATCH] e2k impl --- compiler/rustc_llvm/build.rs | 3 +- compiler/rustc_llvm/src/lib.rs | 7 +++++ compiler/rustc_target/src/abi/call/mod.rs | 1 + .../src/spec/e2k64_unknown_linux_gnu.rs | 30 +++++++++++++++++++ compiler/rustc_target/src/spec/mod.rs | 2 ++ library/panic_unwind/src/gcc.rs | 3 ++ library/std/src/env.rs | 1 + library/std/src/os/linux/raw.rs | 2 +- library/std/src/sys/unix/args.rs | 5 ++-- library/std/src/sys_common/alloc.rs | 3 +- library/unwind/src/libunwind.rs | 3 ++ src/bootstrap/bootstrap.py | 1 + src/bootstrap/cc_detect.rs | 2 ++ src/bootstrap/compile.rs | 4 ++- src/bootstrap/test.rs | 5 ++++ src/test/ui/abi/stack-probes-lto.rs | 1 + src/test/ui/abi/stack-probes.rs | 1 + src/test/ui/asm/inline-syntax.rs | 1 + src/test/ui/asm/naked-invalid-attr.rs | 1 + src/test/ui/borrowck/borrowck-asm.rs | 1 + src/test/ui/cfg/conditional-compile-arch.rs | 3 ++ src/test/ui/debuginfo-lto.rs | 1 + ...llow-unwind-when-calling-panic-directly.rs | 1 + ...sue-64655-extern-rust-must-allow-unwind.rs | 1 + src/test/ui/fat-lto.rs | 1 + .../ui/llvm-asm/asm-src-loc-codegen-units.rs | 1 + src/test/ui/llvm-asm/asm-src-loc.rs | 1 + src/test/ui/llvm-asm/issue-69092.rs | 1 + src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs | 1 + .../ui/llvm-asm/llvm-asm-in-bad-modifier.rs | 1 + .../ui/llvm-asm/llvm-asm-misplaced-option.rs | 1 + .../ui/llvm-asm/llvm-asm-out-assign-imm.rs | 1 + .../ui/llvm-asm/llvm-asm-out-no-modifier.rs | 1 + .../ui/llvm-asm/llvm-asm-out-read-uninit.rs | 1 + src/test/ui/lto-duplicate-symbols.rs | 1 + src/test/ui/lto-many-codegen-units.rs | 1 + src/test/ui/lto-rustc-loads-linker-plugin.rs | 1 + src/test/ui/lto-still-runs-thread-dtors.rs | 1 + .../ui/lto-thin-rustc-loads-linker-plugin.rs | 1 + .../ui/macros/macro-expanded-include/test.rs | 1 + src/test/ui/panic-runtime/lto-abort.rs | 1 + src/test/ui/panic-runtime/lto-unwind.rs | 1 + src/test/ui/sepcomp/sepcomp-lib-lto.rs | 1 + src/test/ui/thinlto/all-crates.rs | 1 + src/test/ui/thinlto/msvc-imp-present.rs | 1 + src/test/ui/thinlto/thin-lto-inlines2.rs | 1 + src/tools/compiletest/src/util.rs | 3 +- 47 files changed, 101 insertions(+), 7 deletions(-) create mode 100644 compiler/rustc_target/src/spec/e2k64_unknown_linux_gnu.rs diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 621363bed80..da8ca6a7f52 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -86,6 +86,7 @@ fn main() { "nvptx", "hexagon", "riscv", + "elbrus", ]; let mut version_cmd = Command::new(&llvm_config); @@ -190,7 +191,7 @@ fn main() { let mut cmd = Command::new(&llvm_config); cmd.arg(llvm_link_arg).arg("--libs"); - if !is_crossed { + if !is_crossed || target.starts_with("e2k") { cmd.arg("--system-libs"); } else if target.contains("windows-gnu") { println!("cargo:rustc-link-lib=shell32"); diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs index 592010d78cf..fc04253db6a 100644 --- a/compiler/rustc_llvm/src/lib.rs +++ b/compiler/rustc_llvm/src/lib.rs @@ -170,4 +170,11 @@ pub fn initialize_available_targets() { LLVMInitializeWebAssemblyAsmPrinter, LLVMInitializeWebAssemblyAsmParser ); + init_target!( + llvm_component = "elbrus", + LLVMInitializeElbrusTargetInfo, + LLVMInitializeElbrusTarget, + LLVMInitializeElbrusTargetMC, + LLVMInitializeElbrusAsmPrinter + ); } diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 0deb1186b0f..e5d0617a5a6 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -649,6 +649,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { _ => wasm32_bindgen_compat::compute_abi_info(self), }, "asmjs" => wasm32::compute_abi_info(cx, self), + "e2k64" => (), // backend always C-abi, and ignores this attributes a => return Err(format!("unrecognized arch \"{}\" in target specification", a)), } diff --git a/compiler/rustc_target/src/spec/e2k64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/e2k64_unknown_linux_gnu.rs new file mode 100644 index 00000000000..1dab4f0ca6e --- /dev/null +++ b/compiler/rustc_target/src/spec/e2k64_unknown_linux_gnu.rs @@ -0,0 +1,30 @@ +// ignore-tidy-linelength + +use crate::spec::{LinkerFlavor, Target}; + +pub fn target() -> Target { + let mut base = super::linux_gnu_base::opts(); + base.max_atomic_width = Some(64); + base.position_independent_executables = false; + base.pre_link_args + .get_mut(&LinkerFlavor::Gcc) + .unwrap() + .push("-fPIC".to_string()); + base.post_link_args.insert( + LinkerFlavor::Gcc, + vec![ + "-llccrt_s".to_string(), + "-llcc".to_string(), + "-lm".to_string(), + ], + ); + + Target { + llvm_target: "e2k64-unknown-linux-gnu".to_string(), + pointer_width: 64, + arch: "e2k64".to_string(), + data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-f128:128:128-v128:128:128-n32:64".to_string(), + + options: base, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index c9fffd213d7..2e84c9a3703 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -816,6 +816,8 @@ supported_targets! { ("aarch64_be-unknown-linux-gnu", aarch64_be_unknown_linux_gnu), ("aarch64-unknown-linux-gnu_ilp32", aarch64_unknown_linux_gnu_ilp32), ("aarch64_be-unknown-linux-gnu_ilp32", aarch64_be_unknown_linux_gnu_ilp32), + + ("e2k64-unknown-linux-gnu", e2k64_unknown_linux_gnu), } /// Everything `rustc` knows about how to compile for a specific target. diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs index 14f49bbf483..e5699d2f52c 100644 --- a/library/panic_unwind/src/gcc.rs +++ b/library/panic_unwind/src/gcc.rs @@ -123,6 +123,9 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 #[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))] const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11 +#[cfg(target_arch = "e2k64")] +const UNWIND_DATA_REG: (i32, i32) = (64, 65); + // The following code is based on GCC's C and C++ personality routines. For reference, see: // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 9763a2da341..3df2fbffa2f 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -865,6 +865,7 @@ pub mod consts { /// - riscv64 /// - s390x /// - sparc64 + /// - e2k64 #[stable(feature = "env", since = "1.0.0")] pub const ARCH: &str = env!("STD_ENV_ARCH"); diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs index 525102212c4..543fde37931 100644 --- a/library/std/src/os/linux/raw.rs +++ b/library/std/src/os/linux/raw.rs @@ -304,7 +304,7 @@ mod arch { } } -#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))] +#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", target_arch = "e2k64"))] mod arch { use crate::os::raw::{c_int, c_long}; diff --git a/library/std/src/sys/unix/args.rs b/library/std/src/sys/unix/args.rs index 69676472493..67ffc89347b 100644 --- a/library/std/src/sys/unix/args.rs +++ b/library/std/src/sys/unix/args.rs @@ -100,13 +100,14 @@ mod imp { // On Linux-GNU, we rely on `ARGV_INIT_ARRAY` below to initialize // `ARGC` and `ARGV`. But in Miri that does not actually happen so we // still initialize here. - #[cfg(any(miri, not(all(target_os = "linux", target_env = "gnu"))))] + #[cfg(any(miri, not(all(target_os = "linux", target_env = "gnu")), target_arch = "e2k64"))] really_init(_argc, _argv); } /// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension. /// This allows `std::env::args` to work even in a `cdylib`, as it does on macOS and Windows. - #[cfg(all(target_os = "linux", target_env = "gnu"))] + // FIXME: workaround: e2k assembler generates a warning and lccrt fails to compile + #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "e2k64")))] #[used] #[link_section = ".init_array.00099"] static ARGV_INIT_ARRAY: extern "C" fn( diff --git a/library/std/src/sys_common/alloc.rs b/library/std/src/sys_common/alloc.rs index 6c1bc0d839a..218c81e129e 100644 --- a/library/std/src/sys_common/alloc.rs +++ b/library/std/src/sys_common/alloc.rs @@ -25,7 +25,8 @@ pub const MIN_ALIGN: usize = 8; target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64", - target_arch = "riscv64" + target_arch = "riscv64", + target_arch = "e2k64" )))] pub const MIN_ALIGN: usize = 16; diff --git a/library/unwind/src/libunwind.rs b/library/unwind/src/libunwind.rs index faf554d285a..58ceadb0f66 100644 --- a/library/unwind/src/libunwind.rs +++ b/library/unwind/src/libunwind.rs @@ -66,6 +66,9 @@ pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "hexagon", target_os = "linux"))] pub const unwinder_private_data_size: usize = 35; +#[cfg(target_arch = "e2k64")] +pub const unwinder_private_data_size: usize = 6; + #[repr(C)] pub struct _Unwind_Exception { pub exception_class: _Unwind_Exception_Class, diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3e7d1d54f12..ace34fd2a2c 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -284,6 +284,7 @@ def default_build_triple(verbose): 'aarch64': 'aarch64', 'amd64': 'x86_64', 'arm64': 'aarch64', + 'e2k': 'e2k64', 'i386': 'i686', 'i486': 'i686', 'i686': 'i686', diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs index e750c2963dd..d2d7b7ef729 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -48,6 +48,8 @@ fn cc2ar(cc: &Path, target: TargetSelection) -> Option { Some(PathBuf::from("ar")) } else if target.contains("vxworks") { Some(PathBuf::from("wr-ar")) + } else if target.starts_with("e2k") { + Some(PathBuf::from("ar")) } else { let parent = cc.parent().unwrap(); let file = cc.file_name().unwrap().to_str().unwrap(); diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 9398f211721..3ecdcd40043 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -310,7 +310,9 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car // // But we don't bother for the stage 0 compiler because it's never used // with LTO. - if stage >= 1 { + // + // FIXME: currently e2k llvm backend does not support asm parser + if stage >= 1 && !target.starts_with("e2k") { cargo.rustflag("-Cembed-bitcode=yes"); } diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 86d940cd733..7245f7cc9b2 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1054,6 +1054,11 @@ note: if you're sure you want to do this, please open an issue as to why. In the } if suite == "debuginfo" { + // Skip debuginfo tests for e2k, see bug 105287, dwarf NIY + if builder.config.build.starts_with("e2k") { + return; + } + builder .ensure(dist::DebuggerScripts { sysroot: builder.sysroot(compiler), host: target }); } diff --git a/src/test/ui/abi/stack-probes-lto.rs b/src/test/ui/abi/stack-probes-lto.rs index 90df1f3f53e..a104efcef8f 100644 --- a/src/test/ui/abi/stack-probes-lto.rs +++ b/src/test/ui/abi/stack-probes-lto.rs @@ -12,6 +12,7 @@ // ignore-sgx no processes // ignore-musl FIXME #31506 // ignore-pretty +// ignore-e2k64 // compile-flags: -C lto // no-prefer-dynamic diff --git a/src/test/ui/abi/stack-probes.rs b/src/test/ui/abi/stack-probes.rs index e998dd0f83e..f6547fa6c89 100644 --- a/src/test/ui/abi/stack-probes.rs +++ b/src/test/ui/abi/stack-probes.rs @@ -1,6 +1,7 @@ // run-pass // ignore-arm // ignore-aarch64 +// ignore-e2k64 // ignore-mips // ignore-mips64 // ignore-powerpc diff --git a/src/test/ui/asm/inline-syntax.rs b/src/test/ui/asm/inline-syntax.rs index 9e9c7badfca..941169b2763 100644 --- a/src/test/ui/asm/inline-syntax.rs +++ b/src/test/ui/asm/inline-syntax.rs @@ -1,4 +1,5 @@ // revisions: x86_64 arm +// ignore-e2k64 //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu //[arm] compile-flags: --target armv7-unknown-linux-gnueabihf diff --git a/src/test/ui/asm/naked-invalid-attr.rs b/src/test/ui/asm/naked-invalid-attr.rs index cdb6c17454b..9d14bdaa9a4 100644 --- a/src/test/ui/asm/naked-invalid-attr.rs +++ b/src/test/ui/asm/naked-invalid-attr.rs @@ -1,6 +1,7 @@ // Checks that #[naked] attribute can be placed on function definitions only. // // ignore-wasm32 asm unsupported +// ignore-e2k64 #![feature(asm)] #![feature(naked_functions)] #![naked] //~ ERROR should be applied to a function definition diff --git a/src/test/ui/borrowck/borrowck-asm.rs b/src/test/ui/borrowck/borrowck-asm.rs index a3f64524771..6fea47ed676 100644 --- a/src/test/ui/borrowck/borrowck-asm.rs +++ b/src/test/ui/borrowck/borrowck-asm.rs @@ -6,6 +6,7 @@ // ignore-riscv64 // ignore-sparc // ignore-sparc64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/cfg/conditional-compile-arch.rs b/src/test/ui/cfg/conditional-compile-arch.rs index 7de561df136..564faf788e7 100644 --- a/src/test/ui/cfg/conditional-compile-arch.rs +++ b/src/test/ui/cfg/conditional-compile-arch.rs @@ -39,3 +39,6 @@ pub fn main() { } #[cfg(target_arch = "riscv64")] pub fn main() { } + +#[cfg(target_arch = "e2k64")] +pub fn main() { } diff --git a/src/test/ui/debuginfo-lto.rs b/src/test/ui/debuginfo-lto.rs index 43f75b0344b..b16ea5f277e 100644 --- a/src/test/ui/debuginfo-lto.rs +++ b/src/test/ui/debuginfo-lto.rs @@ -8,6 +8,7 @@ // compile-flags: -C lto -g // no-prefer-dynamic // ignore-asmjs wasm2js does not support source maps yet +// ignore-e2k64 extern crate debuginfo_lto_aux; diff --git a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs index 74c6e501c91..07b58de1f23 100644 --- a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs +++ b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs @@ -1,6 +1,7 @@ // run-pass // ignore-wasm32-bare compiled with panic=abort by default // ignore-emscripten no threads support +// ignore-e2k64 asmparser // rust-lang/rust#64655: with panic=unwind, a panic from a subroutine // should still run destructors as it unwinds the stack. However, diff --git a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs index bc15fcb0e39..fb350aa8f4b 100644 --- a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs +++ b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs @@ -1,6 +1,7 @@ // run-pass // ignore-wasm32-bare compiled with panic=abort by default // ignore-emscripten no threads support +// ignore-e2k64 asmparser // rust-lang/rust#64655: with panic=unwind, a panic from a subroutine // should still run destructors as it unwinds the stack. However, diff --git a/src/test/ui/fat-lto.rs b/src/test/ui/fat-lto.rs index c8d8095a265..88f013db604 100644 --- a/src/test/ui/fat-lto.rs +++ b/src/test/ui/fat-lto.rs @@ -1,6 +1,7 @@ // run-pass // compile-flags: -Clto=fat // no-prefer-dynamic +// ignore-e2k64 asmparser fn main() { println!("hello!"); diff --git a/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs b/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs index 387822d00f6..c24d53aff31 100644 --- a/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs +++ b/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs @@ -2,6 +2,7 @@ // dont-check-compiler-stderr // compile-flags: -C codegen-units=2 // ignore-emscripten +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/asm-src-loc.rs b/src/test/ui/llvm-asm/asm-src-loc.rs index 063066df11c..2ec93b32efe 100644 --- a/src/test/ui/llvm-asm/asm-src-loc.rs +++ b/src/test/ui/llvm-asm/asm-src-loc.rs @@ -1,6 +1,7 @@ // build-fail // dont-check-compiler-stderr // ignore-emscripten +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/issue-69092.rs b/src/test/ui/llvm-asm/issue-69092.rs index 96c019b760e..f4a81ff7421 100644 --- a/src/test/ui/llvm-asm/issue-69092.rs +++ b/src/test/ui/llvm-asm/issue-69092.rs @@ -1,6 +1,7 @@ // build-fail // ignore-emscripten no asm! support // Regression test for #69092 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs index 2868d3d396d..a49403ad604 100644 --- a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs +++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs @@ -11,6 +11,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs index e3bc7d29941..1b798fd1afe 100644 --- a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs +++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs @@ -8,6 +8,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs index daae0c8147a..32ce03336b7 100644 --- a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs +++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs @@ -12,6 +12,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs index 9c62532c824..9e37888e3c3 100644 --- a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs +++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs @@ -8,6 +8,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs index 72edb339b19..5cac9a8ab3b 100644 --- a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs +++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs @@ -8,6 +8,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs index acf4cf9ff95..f3fcebad2c6 100644 --- a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs +++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs @@ -8,6 +8,7 @@ // ignore-sparc64 // ignore-mips // ignore-mips64 +// ignore-e2k64 #![feature(llvm_asm)] diff --git a/src/test/ui/lto-duplicate-symbols.rs b/src/test/ui/lto-duplicate-symbols.rs index 268cf261219..a70bf8d06a9 100644 --- a/src/test/ui/lto-duplicate-symbols.rs +++ b/src/test/ui/lto-duplicate-symbols.rs @@ -4,6 +4,7 @@ // error-pattern:Linking globals named 'foo': symbol multiply defined! // compile-flags: -C lto // no-prefer-dynamic +// ignore-e2k64 asmparser extern crate lto_duplicate_symbols1; extern crate lto_duplicate_symbols2; diff --git a/src/test/ui/lto-many-codegen-units.rs b/src/test/ui/lto-many-codegen-units.rs index f0f461ffec8..2e6ddb251c1 100644 --- a/src/test/ui/lto-many-codegen-units.rs +++ b/src/test/ui/lto-many-codegen-units.rs @@ -1,6 +1,7 @@ // run-pass // compile-flags: -C lto -C codegen-units=8 // no-prefer-dynamic +// ignore-e2k64 asmparser fn main() { } diff --git a/src/test/ui/lto-rustc-loads-linker-plugin.rs b/src/test/ui/lto-rustc-loads-linker-plugin.rs index 6ef1d4540b8..d1ca9f11f0a 100644 --- a/src/test/ui/lto-rustc-loads-linker-plugin.rs +++ b/src/test/ui/lto-rustc-loads-linker-plugin.rs @@ -2,6 +2,7 @@ // aux-build:lto-rustc-loads-linker-plugin.rs // run-pass // no-prefer-dynamic +// ignore-e2k64 asmparser // This test ensures that if a dependency was compiled with // `-Clinker-plugin-lto` then we can compile with `-Clto` and still link against diff --git a/src/test/ui/lto-still-runs-thread-dtors.rs b/src/test/ui/lto-still-runs-thread-dtors.rs index 635ad783b31..423f418f1eb 100644 --- a/src/test/ui/lto-still-runs-thread-dtors.rs +++ b/src/test/ui/lto-still-runs-thread-dtors.rs @@ -2,6 +2,7 @@ // compile-flags: -C lto // no-prefer-dynamic // ignore-emscripten no threads support +// ignore-e2k64 asmparser use std::thread; diff --git a/src/test/ui/lto-thin-rustc-loads-linker-plugin.rs b/src/test/ui/lto-thin-rustc-loads-linker-plugin.rs index 4d54ce32fb5..38423767ea1 100644 --- a/src/test/ui/lto-thin-rustc-loads-linker-plugin.rs +++ b/src/test/ui/lto-thin-rustc-loads-linker-plugin.rs @@ -2,6 +2,7 @@ // aux-build:lto-rustc-loads-linker-plugin.rs // run-pass // no-prefer-dynamic +// ignore-e2k64 asmparser // Same as the adjacent `lto-thin-rustc-loads-linker-plugin.rs` test, only with // ThinLTO. diff --git a/src/test/ui/macros/macro-expanded-include/test.rs b/src/test/ui/macros/macro-expanded-include/test.rs index f1a71059a89..66abcd3e5f6 100644 --- a/src/test/ui/macros/macro-expanded-include/test.rs +++ b/src/test/ui/macros/macro-expanded-include/test.rs @@ -1,4 +1,5 @@ // ignore-emscripten no llvm_asm! support +// ignore-e2k64 // build-pass (FIXME(62277): could be check-pass?) #![feature(asm)] #![allow(unused)] diff --git a/src/test/ui/panic-runtime/lto-abort.rs b/src/test/ui/panic-runtime/lto-abort.rs index 5cc4c013235..a228e62a165 100644 --- a/src/test/ui/panic-runtime/lto-abort.rs +++ b/src/test/ui/panic-runtime/lto-abort.rs @@ -4,6 +4,7 @@ // no-prefer-dynamic // ignore-emscripten no processes // ignore-sgx no processes +// ignore-e2k64 asmparser use std::process::Command; use std::env; diff --git a/src/test/ui/panic-runtime/lto-unwind.rs b/src/test/ui/panic-runtime/lto-unwind.rs index 6f39b76526b..341137e6831 100644 --- a/src/test/ui/panic-runtime/lto-unwind.rs +++ b/src/test/ui/panic-runtime/lto-unwind.rs @@ -5,6 +5,7 @@ // no-prefer-dynamic // ignore-emscripten no processes // ignore-sgx no processes +// ignore-e2k64 asmparser use std::process::Command; use std::env; diff --git a/src/test/ui/sepcomp/sepcomp-lib-lto.rs b/src/test/ui/sepcomp/sepcomp-lib-lto.rs index 51a572899f8..d6c87e87b2f 100644 --- a/src/test/ui/sepcomp/sepcomp-lib-lto.rs +++ b/src/test/ui/sepcomp/sepcomp-lib-lto.rs @@ -5,6 +5,7 @@ // aux-build:sepcomp_lib.rs // compile-flags: -C lto -g // ignore-asmjs wasm2js does not support source maps yet +// ignore-e2k64 asmparser // no-prefer-dynamic extern crate sepcomp_lib; diff --git a/src/test/ui/thinlto/all-crates.rs b/src/test/ui/thinlto/all-crates.rs index e910b2a9f96..4861974e871 100644 --- a/src/test/ui/thinlto/all-crates.rs +++ b/src/test/ui/thinlto/all-crates.rs @@ -1,4 +1,5 @@ // run-pass +// ignore-e2k64 asmparser // compile-flags: -Clto=thin // no-prefer-dynamic diff --git a/src/test/ui/thinlto/msvc-imp-present.rs b/src/test/ui/thinlto/msvc-imp-present.rs index 5498afb2937..e1f7fc263f6 100644 --- a/src/test/ui/thinlto/msvc-imp-present.rs +++ b/src/test/ui/thinlto/msvc-imp-present.rs @@ -2,6 +2,7 @@ // aux-build:msvc-imp-present.rs // compile-flags: -Z thinlto -C codegen-units=8 +// ignore-e2k64 asmparser // no-prefer-dynamic // On MSVC we have a "hack" where we emit symbols that look like `_imp_$name` diff --git a/src/test/ui/thinlto/thin-lto-inlines2.rs b/src/test/ui/thinlto/thin-lto-inlines2.rs index 1eb29657c70..3dd34802440 100644 --- a/src/test/ui/thinlto/thin-lto-inlines2.rs +++ b/src/test/ui/thinlto/thin-lto-inlines2.rs @@ -4,6 +4,7 @@ // aux-build:thin-lto-inlines-aux.rs // no-prefer-dynamic // ignore-emscripten can't inspect instructions on emscripten +// ignore-e2k64 asmparser // We want to assert here that ThinLTO will inline across codegen units. There's // not really a great way to do that in general so we sort of hack around it by diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index b302953708c..b065392bcec 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -48,6 +48,7 @@ const ARCH_TABLE: &[(&str, &str)] = &[ ("armv7s", "arm"), ("asmjs", "asmjs"), ("avr", "avr"), + ("e2k64", "e2k64"), ("hexagon", "hexagon"), ("i386", "x86"), ("i586", "x86"), @@ -166,7 +167,7 @@ pub fn matches_env(triple: &str, name: &str) -> bool { pub fn get_pointer_width(triple: &str) -> &'static str { if (triple.contains("64") && !triple.ends_with("gnux32") && !triple.ends_with("gnu_ilp32")) - || triple.starts_with("s390x") + || triple.starts_with("s390x") || triple.starts_with("e2k") { "64bit" } else if triple.starts_with("avr") {