[package]
name = "builtins-test"
version = "0.1.0"
edition = "2024"
publish = false
license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)"

[dependencies]
compiler_builtins = { workspace = true, default-features = false, features = ["unstable-public-internals"] }

# For fuzzing tests we want a deterministic seedable RNG. We also eliminate potential
# problems with system RNGs on the variety of platforms this crate is tested on.
# `xoshiro128**` is used for its quality, size, and speed at generating `u32` shift amounts.
rand_xoshiro.workspace = true

# To compare float builtins against
rustc_apfloat.workspace = true

# Really dev dependencies, but those can't be optional
criterion = { workspace = true, optional = true }
gungraun = { workspace = true, optional = true }

[dev-dependencies]
paste.workspace = true

[features]
# Defaults should match the defaults in compiler-builtins since we have that
# dependency with `default-features=false`.
default = ["compiler_builtins/arch"]
c = ["compiler_builtins/c"]

# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
icount = ["dep:gungraun"]

# Config for wall time benchmarks. Plotters and html_reports bring in extra
# deps so are off by default for CI.
benchmarking-reports = ["walltime", "criterion/plotters", "criterion/html_reports"]
walltime = ["dep:criterion"]

[[bench]]
name = "float_add"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_sub"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_mul"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_div"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_cmp"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_conv"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_extend"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_trunc"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_pow"
harness = false
required-features = ["walltime"]

[[bench]]
name = "mem_icount"
harness = false
required-features = ["icount"]
