repo.or.cz
/
NixPkgs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
python313Packages.traits: fix build (#373698)
[NixPkgs.git]
/
pkgs
/
by-name
/
ca
/
cargo-show-asm
/
test-basic-x86_64.nix
blob
f332c5e0f4354d8c45e15d004e4c5628fc4213db
1
{
2
runCommand,
3
cargo,
4
rustc,
5
cargo-show-asm,
6
}:
7
runCommand "test-basic"
8
{
9
nativeBuildInputs = [
10
cargo
11
rustc
12
cargo-show-asm
13
];
14
}
15
''
16
mkdir -p src
17
cat >Cargo.toml <<EOF
18
[package]
19
name = "add"
20
version = "0.0.0"
21
EOF
22
cat >src/lib.rs <<EOF
23
#[inline(never)] pub fn add(a: u32, b: u32) -> u32 { a + b }
24
EOF
25
26
[[ "$(cargo asm add::add | tee /dev/stderr)" == *"lea eax, "* ]]
27
[[ "$(cargo asm --mir add | tee /dev/stderr)" == *"= Add("* ]]
28
touch $out
29
''