- name: mingw-check
os: ubuntu-20.04-xl
env: {}
- - name: x86_64-gnu-llvm-12
+ - name: x86_64-gnu-llvm-13
os: ubuntu-20.04-xl
env: {}
- name: x86_64-gnu-tools
- name: x86_64-gnu-distcheck
os: ubuntu-20.04-xl
env: {}
- - name: x86_64-gnu-llvm-12
+ - name: x86_64-gnu-llvm-13
env:
RUST_BACKTRACE: 1
os: ubuntu-20.04-xl
- - name: x86_64-gnu-llvm-12-stage1
+ - name: x86_64-gnu-llvm-13-stage1
env:
RUST_BACKTRACE: 1
os: ubuntu-20.04-xl
use crate::common::Funclet;
use crate::context::CodegenCx;
use crate::llvm;
-use crate::llvm_util;
use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
let constraints_ok = llvm::LLVMRustInlineAsmVerify(fty, cons.as_ptr().cast(), cons.len());
debug!("constraint verification result: {:?}", constraints_ok);
if constraints_ok {
- if unwind && llvm_util::get_version() < (13, 0, 0) {
- bx.cx.sess().span_fatal(
- line_spans[0],
- "unwinding from inline assembly is only supported on llvm >= 13.",
- );
- }
-
let v = llvm::LLVMRustInlineAsm(
fty,
asm.as_ptr().cast(),
use crate::base;
use crate::common;
use crate::consts;
-use crate::llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
+use crate::llvm::{self, DiagnosticInfo, PassManager};
use crate::llvm_util;
use crate::type_::Type;
use crate::LlvmCodegenBackend;
remark_passes.as_ptr(),
remark_passes.len(),
);
- llvm::LLVMRustSetInlineAsmDiagnosticHandler(llcx, inline_asm_handler, data.cast());
DiagnosticHandlers { data, llcx, old_handler }
}
}
impl<'a> Drop for DiagnosticHandlers<'a> {
fn drop(&mut self) {
- use std::ptr::null_mut;
unsafe {
- llvm::LLVMRustSetInlineAsmDiagnosticHandler(self.llcx, inline_asm_handler, null_mut());
llvm::LLVMRustContextSetDiagnosticHandler(self.llcx, self.old_handler);
drop(Box::from_raw(self.data));
}
cgcx.diag_emitter.inline_asm_error(cookie as u32, msg, level, source);
}
-unsafe extern "C" fn inline_asm_handler(diag: &SMDiagnostic, user: *const c_void, cookie: c_uint) {
- if user.is_null() {
- return;
- }
- let (cgcx, _) = *(user as *const (&CodegenContext<LlvmCodegenBackend>, &Handler));
-
- let smdiag = llvm::diagnostic::SrcMgrDiagnostic::unpack(diag);
- report_inline_asm(cgcx, smdiag.message, smdiag.level, cookie, smdiag.source);
-}
-
unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void) {
if user.is_null() {
return;
use crate::context::CodegenCx;
use crate::llvm::{self, BasicBlock, False};
use crate::llvm::{AtomicOrdering, AtomicRmwBinOp, SynchronizationScope};
-use crate::llvm_util;
use crate::type_::Type;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
dst: &'ll Value,
cmp: &'ll Value,
src: &'ll Value,
- mut order: rustc_codegen_ssa::common::AtomicOrdering,
+ order: rustc_codegen_ssa::common::AtomicOrdering,
failure_order: rustc_codegen_ssa::common::AtomicOrdering,
weak: bool,
) -> &'ll Value {
let weak = if weak { llvm::True } else { llvm::False };
- if llvm_util::get_version() < (13, 0, 0) {
- use rustc_codegen_ssa::common::AtomicOrdering::*;
- // Older llvm has the pre-C++17 restriction on
- // success and failure memory ordering,
- // requiring the former to be at least as strong as the latter.
- // So, for llvm 12, we upgrade the success ordering to a stronger
- // one if necessary.
- match (order, failure_order) {
- (Relaxed, Acquire) => order = Acquire,
- (Release, Acquire) => order = AcquireRelease,
- (_, SequentiallyConsistent) => order = SequentiallyConsistent,
- _ => {}
- }
- }
unsafe {
llvm::LLVMRustBuildAtomicCmpXchg(
self.llbuilder,
}
}
- fn fptoint_sat_broken_in_llvm(&self) -> bool {
- match self.tcx.sess.target.arch.as_ref() {
- // FIXME - https://bugs.llvm.org/show_bug.cgi?id=50083
- "riscv64" => llvm_util::get_version() < (13, 0, 0),
- _ => false,
- }
- }
-
fn fptoint_sat(
&mut self,
signed: bool,
val: &'ll Value,
dest_ty: &'ll Type,
) -> Option<&'ll Value> {
- if !self.fptoint_sat_broken_in_llvm() {
- let src_ty = self.cx.val_ty(val);
- let (float_ty, int_ty, vector_length) = if self.cx.type_kind(src_ty) == TypeKind::Vector
- {
- assert_eq!(self.cx.vector_length(src_ty), self.cx.vector_length(dest_ty));
- (
- self.cx.element_type(src_ty),
- self.cx.element_type(dest_ty),
- Some(self.cx.vector_length(src_ty)),
- )
- } else {
- (src_ty, dest_ty, None)
- };
- let float_width = self.cx.float_width(float_ty);
- let int_width = self.cx.int_width(int_ty);
-
- let instr = if signed { "fptosi" } else { "fptoui" };
- let name = if let Some(vector_length) = vector_length {
- format!(
- "llvm.{}.sat.v{}i{}.v{}f{}",
- instr, vector_length, int_width, vector_length, float_width
- )
- } else {
- format!("llvm.{}.sat.i{}.f{}", instr, int_width, float_width)
- };
- let f =
- self.declare_cfn(&name, llvm::UnnamedAddr::No, self.type_func(&[src_ty], dest_ty));
- Some(self.call(self.type_func(&[src_ty], dest_ty), f, &[val], None))
+ let src_ty = self.cx.val_ty(val);
+ let (float_ty, int_ty, vector_length) = if self.cx.type_kind(src_ty) == TypeKind::Vector {
+ assert_eq!(self.cx.vector_length(src_ty), self.cx.vector_length(dest_ty));
+ (
+ self.cx.element_type(src_ty),
+ self.cx.element_type(dest_ty),
+ Some(self.cx.vector_length(src_ty)),
+ )
} else {
- None
- }
+ (src_ty, dest_ty, None)
+ };
+ let float_width = self.cx.float_width(float_ty);
+ let int_width = self.cx.int_width(int_ty);
+
+ let instr = if signed { "fptosi" } else { "fptoui" };
+ let name = if let Some(vector_length) = vector_length {
+ format!(
+ "llvm.{}.sat.v{}i{}.v{}f{}",
+ instr, vector_length, int_width, vector_length, float_width
+ )
+ } else {
+ format!("llvm.{}.sat.i{}.f{}", instr, int_width, float_width)
+ };
+ let f = self.declare_cfn(&name, llvm::UnnamedAddr::No, self.type_func(&[src_ty], dest_ty));
+ Some(self.call(self.type_func(&[src_ty], dest_ty), f, &[val], None))
}
pub(crate) fn landing_pad(
let mut target_data_layout = sess.target.data_layout.to_string();
let llvm_version = llvm_util::get_version();
- if llvm_version < (13, 0, 0) {
- if sess.target.arch == "powerpc64" {
- target_data_layout = target_data_layout.replace("-S128", "");
- }
- if sess.target.arch == "wasm32" {
- target_data_layout = "e-m:e-p:32:32-i64:64-n32:64-S128".to_string();
- }
- if sess.target.arch == "wasm64" {
- target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128".to_string();
- }
- }
if llvm_version < (14, 0, 0) {
if sess.target.llvm_target == "i686-pc-windows-msvc"
|| sess.target.llvm_target == "i586-pc-windows-msvc"
cookie_out: &mut c_uint,
) -> &'a SMDiagnostic;
- pub fn LLVMRustSetInlineAsmDiagnosticHandler(
- C: &Context,
- H: InlineAsmDiagHandlerTy,
- CX: *mut c_void,
- );
-
#[allow(improper_ctypes)]
pub fn LLVMRustUnpackSMDiagnostic(
d: &SMDiagnostic,
add("-generate-arange-section", false);
}
- // Disable the machine outliner by default in LLVM versions 11 and LLVM
- // version 12, where it leads to miscompilation.
- //
- // Ref:
- // - https://github.com/rust-lang/rust/issues/85351
- // - https://reviews.llvm.org/D103167
- if llvm_util::get_version() < (13, 0, 0) {
- add("-enable-machine-outliner=never", false);
- }
-
match sess.opts.unstable_opts.merge_functions.unwrap_or(sess.target.merge_functions) {
MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
MergeFunctions::Aliases => {
const char* const Filenames[],
size_t FilenamesLen,
RustStringRef BufferOut) {
-#if LLVM_VERSION_GE(13,0)
SmallVector<std::string,32> FilenameRefs;
for (size_t i = 0; i < FilenamesLen; i++) {
FilenameRefs.push_back(std::string(Filenames[i]));
}
-#else
- SmallVector<StringRef,32> FilenameRefs;
- for (size_t i = 0; i < FilenamesLen; i++) {
- FilenameRefs.push_back(StringRef(Filenames[i]));
- }
-#endif
auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
makeArrayRef(FilenameRefs));
RawRustStringOstream OS(BufferOut);
}
extern "C" uint32_t LLVMRustCoverageMappingVersion() {
-#if LLVM_VERSION_GE(13, 0)
return coverage::CovMapVersion::Version6;
-#else
- return coverage::CovMapVersion::Version5;
-#endif
}
PGOOptions::NoCSAction, DebugInfoForProfiling);
}
-#if LLVM_VERSION_GE(13, 0)
PassBuilder PB(TM, PTO, PGOOpt, &PIC);
LoopAnalysisManager LAM;
FunctionAnalysisManager FAM;
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;
-#else
- PassBuilder PB(DebugPassManager, TM, PTO, PGOOpt, &PIC);
- LoopAnalysisManager LAM(DebugPassManager);
- FunctionAnalysisManager FAM(DebugPassManager);
- CGSCCAnalysisManager CGAM(DebugPassManager);
- ModuleAnalysisManager MAM(DebugPassManager);
-#endif
FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });
}
}
-#if LLVM_VERSION_GE(13, 0)
ModulePassManager MPM;
-#else
- ModulePassManager MPM(DebugPassManager);
-#endif
bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
if (!NoPrepopulatePasses) {
// The pre-link pipelines don't support O0 and require using budilO0DefaultPipeline() instead.
Ret->ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
};
-#if LLVM_VERSION_GE(13,0)
// Uses FromPrevailing visibility scheme which works for many binary
// formats. We probably could and should use ELF visibility scheme for many of
// our targets, however.
lto::Config conf;
thinLTOResolvePrevailingInIndex(conf, Ret->Index, isPrevailing, recordNewLinkage,
Ret->GUIDPreservedSymbols);
-#else
- thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage,
- Ret->GUIDPreservedSymbols);
-#endif
+
// Here we calculate an `ExportedGUIDs` set for use in the `isExported`
// callback below. This callback below will dictate the linkage for all
// summaries in the index, and we basically just only want to ensure that dead
LLVMValueRef Old, LLVMValueRef Source,
LLVMAtomicOrdering Order,
LLVMAtomicOrdering FailureOrder, LLVMBool Weak) {
-#if LLVM_VERSION_GE(13,0)
// Rust probably knows the alignment of the target value and should be able to
// specify something more precise than MaybeAlign here. See also
// https://reviews.llvm.org/D97224 which may be a useful reference.
AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
unwrap(Target), unwrap(Old), unwrap(Source), llvm::MaybeAlign(), fromRust(Order),
fromRust(FailureOrder));
-#else
- AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
- unwrap(Target), unwrap(Old), unwrap(Source), fromRust(Order),
- fromRust(FailureOrder));
-#endif
ACXI->setWeak(Weak);
return wrap(ACXI);
}
char *Constraints, size_t ConstraintsLen,
LLVMBool HasSideEffects, LLVMBool IsAlignStack,
LLVMRustAsmDialect Dialect, LLVMBool CanThrow) {
-#if LLVM_VERSION_GE(13, 0)
return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
StringRef(AsmString, AsmStringLen),
StringRef(Constraints, ConstraintsLen),
HasSideEffects, IsAlignStack,
fromRust(Dialect), CanThrow));
-#else
- return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
- StringRef(AsmString, AsmStringLen),
- StringRef(Constraints, ConstraintsLen),
- HasSideEffects, IsAlignStack,
- fromRust(Dialect)));
-#endif
}
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
return LLVMRustDiagnosticKind::Linker;
case DK_Unsupported:
return LLVMRustDiagnosticKind::Unsupported;
-#if LLVM_VERSION_GE(13, 0)
case DK_SrcMgr:
return LLVMRustDiagnosticKind::SrcMgr;
-#endif
default:
return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
? LLVMRustDiagnosticKind::OptimizationRemarkOther
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)
-#if LLVM_VERSION_LT(13, 0)
-using LLVMInlineAsmDiagHandlerTy = LLVMContext::InlineAsmDiagHandlerTy;
-#else
-using LLVMInlineAsmDiagHandlerTy = void*;
-#endif
-
-extern "C" void LLVMRustSetInlineAsmDiagnosticHandler(
- LLVMContextRef C, LLVMInlineAsmDiagHandlerTy H, void *CX) {
- // Diagnostic handlers were unified in LLVM change 5de2d189e6ad, so starting
- // with LLVM 13 this function is gone.
-#if LLVM_VERSION_LT(13, 0)
- unwrap(C)->setInlineAsmDiagnosticHandler(H, CX);
-#endif
-}
-
extern "C" LLVMSMDiagnosticRef LLVMRustGetSMDiagnostic(
LLVMDiagnosticInfoRef DI, unsigned *Cookie) {
-#if LLVM_VERSION_GE(13, 0)
llvm::DiagnosticInfoSrcMgr *SM = static_cast<llvm::DiagnosticInfoSrcMgr *>(unwrap(DI));
*Cookie = SM->getLocCookie();
return wrap(&SM->getSMDiag());
-#else
- report_fatal_error("Shouldn't get called on older versions");
-#endif
}
extern "C" bool LLVMRustUnpackSMDiagnostic(LLVMSMDiagnosticRef DRef,
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn le(&self, other: &Rhs) -> bool {
- // Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
- // FIXME: The root cause was fixed upstream in LLVM with:
- // https://github.com/llvm/llvm-project/commit/9bad7de9a3fb844f1ca2965f35d0c2a3d1e11775
- // Revert this workaround once support for LLVM 12 gets dropped.
- !matches!(self.partial_cmp(other), None | Some(Greater))
+ matches!(self.partial_cmp(other), Some(Less | Equal))
}
/// This method tests greater than (for `self` and `other`) and is used by the `>` operator.
let version = output(cmd.arg("--version"));
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
- if major >= 12 {
+ if major >= 13 {
return;
}
}
- panic!("\n\nbad LLVM version: {}, need >=12.0\n\n", version)
+ panic!("\n\nbad LLVM version: {}, need >=13.0\n\n", version)
}
fn configure_cmake(
+++ /dev/null
-FROM ubuntu:20.04
-
-ARG DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && apt-get install -y --no-install-recommends \
- g++ \
- gcc-multilib \
- make \
- ninja-build \
- file \
- curl \
- ca-certificates \
- python2.7 \
- git \
- cmake \
- sudo \
- gdb \
- llvm-12-tools \
- llvm-12-dev \
- libedit-dev \
- libssl-dev \
- pkg-config \
- zlib1g-dev \
- xz-utils \
- nodejs
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# using llvm-link-shared due to libffi issues -- see #34486
-ENV RUST_CONFIGURE_ARGS \
- --build=x86_64-unknown-linux-gnu \
- --llvm-root=/usr/lib/llvm-12 \
- --enable-llvm-link-shared \
- --set rust.thin-lto-import-instr-limit=10
-
-ENV SCRIPT python2.7 ../x.py --stage 1 test --exclude src/tools/tidy && \
- # Run the `mir-opt` tests again but this time for a 32-bit target.
- # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
- # both 32-bit and 64-bit outputs updated by the PR author, before
- # the PR is approved and tested for merging.
- # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
- # despite having different output on 32-bit vs 64-bit targets.
- python2.7 ../x.py --stage 1 test src/test/mir-opt \
- --host='' --target=i686-unknown-linux-gnu
\ No newline at end of file
+++ /dev/null
-FROM ubuntu:20.04
-
-ARG DEBIAN_FRONTEND=noninteractive
-
-# NOTE: intentionally installs both python2 and python3 so we can test support for both.
-RUN apt-get update && apt-get install -y --no-install-recommends \
- g++ \
- gcc-multilib \
- make \
- ninja-build \
- file \
- curl \
- ca-certificates \
- python2.7 \
- python3.9 \
- git \
- cmake \
- sudo \
- gdb \
- llvm-12-tools \
- llvm-12-dev \
- libedit-dev \
- libssl-dev \
- pkg-config \
- zlib1g-dev \
- xz-utils \
- nodejs
-
-# Install powershell so we can test x.ps1 on Linux
-RUN apt-get update && \
- apt-get install -y apt-transport-https software-properties-common && \
- curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb && \
- dpkg -i packages-microsoft-prod.deb && \
- apt-get update && \
- apt-get install -y powershell
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# using llvm-link-shared due to libffi issues -- see #34486
-ENV RUST_CONFIGURE_ARGS \
- --build=x86_64-unknown-linux-gnu \
- --llvm-root=/usr/lib/llvm-12 \
- --enable-llvm-link-shared \
- --set rust.thin-lto-import-instr-limit=10
-
-# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
-ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
- # Run the `mir-opt` tests again but this time for a 32-bit target.
- # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
- # both 32-bit and 64-bit outputs updated by the PR author, before
- # the PR is approved and tested for merging.
- # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
- # despite having different output on 32-bit vs 64-bit targets.
- ../x --stage 2 test src/test/mir-opt \
- --host='' --target=i686-unknown-linux-gnu && \
- # Run the UI test suite again, but in `--pass=check` mode
- #
- # This is intended to make sure that both `--pass=check` continues to
- # work.
- #
- ../x.ps1 --stage 2 test src/test/ui --pass=check \
- --host='' --target=i686-unknown-linux-gnu && \
- # Run tidy at the very end, after all the other tests.
- python2.7 ../x.py --stage 2 test src/tools/tidy
--- /dev/null
+FROM ubuntu:22.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ g++ \
+ gcc-multilib \
+ make \
+ ninja-build \
+ file \
+ curl \
+ ca-certificates \
+ python2.7 \
+ git \
+ cmake \
+ sudo \
+ gdb \
+ llvm-13-tools \
+ llvm-13-dev \
+ libedit-dev \
+ libssl-dev \
+ pkg-config \
+ zlib1g-dev \
+ xz-utils \
+ nodejs
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+# using llvm-link-shared due to libffi issues -- see #34486
+ENV RUST_CONFIGURE_ARGS \
+ --build=x86_64-unknown-linux-gnu \
+ --llvm-root=/usr/lib/llvm-13 \
+ --enable-llvm-link-shared \
+ --set rust.thin-lto-import-instr-limit=10
+
+ENV SCRIPT python2.7 ../x.py --stage 1 test --exclude src/tools/tidy && \
+ # Run the `mir-opt` tests again but this time for a 32-bit target.
+ # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
+ # both 32-bit and 64-bit outputs updated by the PR author, before
+ # the PR is approved and tested for merging.
+ # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
+ # despite having different output on 32-bit vs 64-bit targets.
+ python2.7 ../x.py --stage 1 test src/test/mir-opt \
+ --host='' --target=i686-unknown-linux-gnu
--- /dev/null
+FROM ubuntu:22.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+# NOTE: intentionally installs both python2 and python3 so we can test support for both.
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ g++ \
+ gcc-multilib \
+ make \
+ ninja-build \
+ file \
+ curl \
+ ca-certificates \
+ python2.7 \
+ python3.9 \
+ git \
+ cmake \
+ sudo \
+ gdb \
+ llvm-13-tools \
+ llvm-13-dev \
+ libedit-dev \
+ libssl-dev \
+ pkg-config \
+ zlib1g-dev \
+ xz-utils \
+ nodejs
+
+# Install powershell so we can test x.ps1 on Linux
+RUN apt-get update && \
+ apt-get install -y apt-transport-https software-properties-common && \
+ curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb && \
+ dpkg -i packages-microsoft-prod.deb && \
+ apt-get update && \
+ apt-get install -y powershell
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+# using llvm-link-shared due to libffi issues -- see #34486
+ENV RUST_CONFIGURE_ARGS \
+ --build=x86_64-unknown-linux-gnu \
+ --llvm-root=/usr/lib/llvm-13 \
+ --enable-llvm-link-shared \
+ --set rust.thin-lto-import-instr-limit=10
+
+# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
+ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
+ # Run the `mir-opt` tests again but this time for a 32-bit target.
+ # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
+ # both 32-bit and 64-bit outputs updated by the PR author, before
+ # the PR is approved and tested for merging.
+ # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
+ # despite having different output on 32-bit vs 64-bit targets.
+ ../x --stage 2 test src/test/mir-opt \
+ --host='' --target=i686-unknown-linux-gnu && \
+ # Run the UI test suite again, but in `--pass=check` mode
+ #
+ # This is intended to make sure that both `--pass=check` continues to
+ # work.
+ #
+ ../x.ps1 --stage 2 test src/test/ui --pass=check \
+ --host='' --target=i686-unknown-linux-gnu && \
+ # Run tidy at the very end, after all the other tests.
+ python2.7 ../x.py --stage 2 test src/tools/tidy
- name: mingw-check
<<: *job-linux-xl
- - name: x86_64-gnu-llvm-12
+ - name: x86_64-gnu-llvm-13
<<: *job-linux-xl
- name: x86_64-gnu-tools
- name: x86_64-gnu-distcheck
<<: *job-linux-xl
- - name: x86_64-gnu-llvm-12
+ - name: x86_64-gnu-llvm-13
env:
RUST_BACKTRACE: 1
<<: *job-linux-xl
- - name: x86_64-gnu-llvm-12-stage1
+ - name: x86_64-gnu-llvm-13-stage1
env:
RUST_BACKTRACE: 1
<<: *job-linux-xl
// Test that PAC instructions are emitted when branch-protection is specified.
-// min-llvm-version: 10.0.1
// assembly-output: emit-asm
// compile-flags: --target aarch64-unknown-linux-gnu
// compile-flags: -Z branch-protection=pac-ret,leaf
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target avr-unknown-gnu-atmega328
// needs-llvm-components: avr
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target avr-unknown-gnu-atmega328
// needs-llvm-components: avr
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
// needs-llvm-components: bpf
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target msp430-none-elf
// needs-llvm-components: msp430
-// min-llvm-version: 12.0.1
// revisions: powerpc powerpc64
// assembly-output: emit-asm
//[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
// [r74] needs-llvm-components: x86
// [r75] compile-flags:--target x86_64-fortanix-unknown-sgx
// [r75] needs-llvm-components: x86
-// [r75] min-llvm-version: 11.0.0
// [r76] compile-flags:--target x86_64-fuchsia
// [r76] needs-llvm-components: x86
// [r77] compile-flags:--target x86_64-linux-android
-// min-llvm-version: 13.0.0
// compile-flags: -O
// only-x86_64
+++ /dev/null
-// Code generation of atomic operations for LLVM 12
-// ignore-llvm-version: 13 - 99
-// compile-flags: -O
-#![crate_type = "lib"]
-
-use std::sync::atomic::{AtomicI32, Ordering::*};
-
-// CHECK-LABEL: @compare_exchange
-#[no_mangle]
-pub fn compare_exchange(a: &AtomicI32) {
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 10 monotonic monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 11 acquire acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 12 seq_cst seq_cst
- let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
- let _ = a.compare_exchange(0, 11, Relaxed, Acquire);
- let _ = a.compare_exchange(0, 12, Relaxed, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 20 release monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 21 acq_rel acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 22 seq_cst seq_cst
- let _ = a.compare_exchange(0, 20, Release, Relaxed);
- let _ = a.compare_exchange(0, 21, Release, Acquire);
- let _ = a.compare_exchange(0, 22, Release, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 30 acquire monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 31 acquire acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 32 seq_cst seq_cst
- let _ = a.compare_exchange(0, 30, Acquire, Relaxed);
- let _ = a.compare_exchange(0, 31, Acquire, Acquire);
- let _ = a.compare_exchange(0, 32, Acquire, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 40 acq_rel monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 41 acq_rel acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 42 seq_cst seq_cst
- let _ = a.compare_exchange(0, 40, AcqRel, Relaxed);
- let _ = a.compare_exchange(0, 41, AcqRel, Acquire);
- let _ = a.compare_exchange(0, 42, AcqRel, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 50 seq_cst monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 51 seq_cst acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 52 seq_cst seq_cst
- let _ = a.compare_exchange(0, 50, SeqCst, Relaxed);
- let _ = a.compare_exchange(0, 51, SeqCst, Acquire);
- let _ = a.compare_exchange(0, 52, SeqCst, SeqCst);
-}
-
-// CHECK-LABEL: @compare_exchange_weak
-#[no_mangle]
-pub fn compare_exchange_weak(w: &AtomicI32) {
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 10 monotonic monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 11 acquire acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 12 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 10, Relaxed, Relaxed);
- let _ = w.compare_exchange_weak(1, 11, Relaxed, Acquire);
- let _ = w.compare_exchange_weak(1, 12, Relaxed, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 20 release monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 21 acq_rel acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 22 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 20, Release, Relaxed);
- let _ = w.compare_exchange_weak(1, 21, Release, Acquire);
- let _ = w.compare_exchange_weak(1, 22, Release, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 30 acquire monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 31 acquire acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 32 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 30, Acquire, Relaxed);
- let _ = w.compare_exchange_weak(1, 31, Acquire, Acquire);
- let _ = w.compare_exchange_weak(1, 32, Acquire, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 40 acq_rel monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 41 acq_rel acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 42 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 40, AcqRel, Relaxed);
- let _ = w.compare_exchange_weak(1, 41, AcqRel, Acquire);
- let _ = w.compare_exchange_weak(1, 42, AcqRel, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 50 seq_cst monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 51 seq_cst acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 52 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 50, SeqCst, Relaxed);
- let _ = w.compare_exchange_weak(1, 51, SeqCst, Acquire);
- let _ = w.compare_exchange_weak(1, 52, SeqCst, SeqCst);
-}
// Code generation of atomic operations.
-// min-llvm-version: 13.0
// compile-flags: -O
#![crate_type = "lib"]
// Test that the correct module flags are emitted with different branch protection flags.
// revisions: BTI PACRET LEAF BKEY NONE
-// min-llvm-version: 12.0.0
// needs-llvm-components: aarch64
// [BTI] compile-flags: -Z branch-protection=bti
// [PACRET] compile-flags: -Z branch-protection=pac-ret
+// min-llvm-version: 14.0
// revisions: O Os
//[Os] compile-flags: -Copt-level=s
//[O] compile-flags: -O
//! Tests that unwinding from an asm block is caught and forced to abort
//! when `-C panic=abort`.
-// min-llvm-version: 13.0.0
// only-x86_64
// compile-flags: -C panic=abort
// no-prefer-dynamic
-// min-llvm-version: 13.0.0
// only-aarch64
// run-pass
// needs-asm-support
-// min-llvm-version: 13.0.0
// run-pass
// needs-asm-support
-// min-llvm-version: 13.0.0
// only-x86_64
// run-pass
// needs-asm-support
-// min-llvm-version: 12.0.1
// only-x86_64
// only-linux
// needs-asm-support
// run-pass
-// min-llvm-version: 13.0
// compile-flags: -O
// Regression test for issue #80309
// run-pass
-// min-llvm-version: 13.0
// compile-flags: -O
// Regression test for issue #80309