forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// only-aarch64 | ||
// Make sure rustdoc accepts options(att_syntax) asm! on non-x86 targets. | ||
|
||
#![feature(asm)] | ||
|
||
// @has asm_foreign2/fn.x86.html | ||
pub unsafe fn x86(x: i64) -> i64 { | ||
let y; | ||
asm!("movq {}, {}", in(reg) x, out(reg) y, options(att_syntax)); | ||
y | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// only-x86_64 | ||
// Make sure rustc doesn't ICE on asm! for a foreign architecture. | ||
|
||
#![feature(asm)] | ||
#![crate_type = "rlib"] | ||
|
||
pub unsafe fn aarch64(a: f64, b: f64) -> f64 { | ||
let c; | ||
asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { | ||
|| {}; | ||
b | ||
}); | ||
//~^^^^ invalid register class | ||
//~^^^^^ invalid register class | ||
//~^^^^^^ invalid register | ||
c | ||
} | ||
|
||
pub unsafe fn x86(a: f64, b: f64) -> f64 { | ||
let c; | ||
asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b); | ||
c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
error: invalid register class `vreg`: unknown register class | ||
--> $DIR/issue-82869.rs:9:32 | ||
| | ||
LL | asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { | ||
| ^^^^^^^^^^^ | ||
|
||
error: invalid register class `vreg`: unknown register class | ||
--> $DIR/issue-82869.rs:9:45 | ||
| | ||
LL | asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { | ||
| ^^^^^^^^^^ | ||
|
||
error: invalid register `d0`: unknown register | ||
--> $DIR/issue-82869.rs:9:57 | ||
| | ||
LL | asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { | ||
| _________________________________________________________^ | ||
LL | | || {}; | ||
LL | | b | ||
LL | | }); | ||
| |_____^ | ||
|
||
error: aborting due to 3 previous errors | ||
|