diff options
| author | bors <bors@rust-lang.org> | 2021-07-11 01:06:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-11 01:06:58 +0000 |
| commit | 99f8efec46c72cb11418f858ae142baa5f3582a9 (patch) | |
| tree | 33c0ce548315db5319b01858f9878e474456edee /src/test/codegen | |
| parent | dfd7b8d03fb93d0e03147d28b3be6d93260fa94d (diff) | |
| parent | d2a1d048d9af6caca48ebd883d082f3657465d06 (diff) | |
| download | rust-99f8efec46c72cb11418f858ae142baa5f3582a9.tar.gz rust-99f8efec46c72cb11418f858ae142baa5f3582a9.zip | |
Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisa
Add clobber-only register classes for asm! These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/asm-clobbers.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/codegen/asm-clobbers.rs b/src/test/codegen/asm-clobbers.rs new file mode 100644 index 00000000000..9d7c8b5f155 --- /dev/null +++ b/src/test/codegen/asm-clobbers.rs @@ -0,0 +1,19 @@ +// compile-flags: -O +// only-x86_64 + +#![crate_type = "rlib"] +#![feature(asm)] + +// CHECK-LABEL: @x87_clobber +// CHECK: ~{st},~{st(1)},~{st(2)},~{st(3)},~{st(4)},~{st(5)},~{st(6)},~{st(7)} +#[no_mangle] +pub unsafe fn x87_clobber() { + asm!("foo", out("st") _); +} + +// CHECK-LABEL: @mmx_clobber +// CHECK: ~{st},~{st(1)},~{st(2)},~{st(3)},~{st(4)},~{st(5)},~{st(6)},~{st(7)} +#[no_mangle] +pub unsafe fn mmx_clobber() { + asm!("bar", out("mm0") _, out("mm1") _); +} |
