//! A target tuple for NetBSD/mips64

use rustc_abi::Endian;

use crate::spec::{Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions, base};

pub(crate) fn target() -> Target {
    let mut base = base::netbsd::opts();
    base.max_atomic_width = Some(32);
    base.cpu = "mips32".into();

    Target {
        llvm_target: "mipsel-unknown-netbsd".into(),
        metadata: TargetMetadata {
            description: Some("NetBSD/mips64 with n32 ABI".into()),
            tier: Some(3),
            host_tools: Some(false),
            std: Some(false),
        },
        pointer_width: 32,
        data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
        arch: Arch::Mips64,
        options: TargetOptions {
            cfg_abi: CfgAbi::AbiV2,
            endian: Endian::Little,
            features: "+soft-float,+abi=n32".into(),
            llvm_abiname: LlvmAbi::N32,
            mcount: "__mcount".into(),
            ..base
        },
    }
}
