diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-06-17 21:00:52 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-07-10 17:29:00 +0200 |
| commit | e1c3f5e017ef93f88158361d06560c8fa7412ac1 (patch) | |
| tree | 1c91fe243e19740a9fb398d6e6fe81bad290a134 /src/test/codegen | |
| parent | 1e13a9bb33debb931d603278b7f1a706b0d11660 (diff) | |
| download | rust-e1c3f5e017ef93f88158361d06560c8fa7412ac1.tar.gz rust-e1c3f5e017ef93f88158361d06560c8fa7412ac1.zip | |
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") _); +} |
