]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/llvm-asm/issue-14936.rs
2 #![allow(unused_macros)]
4 #![allow(deprecated)] // llvm_asm!
7 type History
= Vec
<&'
static str>;
9 fn wrap
<A
>(x
:A
, which
: &'
static str, history
: &mut History
) -> A
{
15 ( $output_constraint
:tt
) => {
20 let mut history
: History
= vec
![];
22 llvm_asm
!("mov ($1), $0"
23 : $
output_constraint (*wrap(&mut x
, "out", &mut history
))
24 : "r"(&wrap(y
, "in", &mut history
))
27 assert_eq
!((x
,y
), (1,1));
28 let b
: &[_
] = &["out", "in"];
29 assert_eq
!(history
, b
);
34 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
36 fn out_write_only_expr_then_in_expr() {
40 fn out_read_write_expr_then_in_expr() {
44 out_write_only_expr_then_in_expr();
45 out_read_write_expr_then_in_expr();
48 #[cfg(all(not(target_arch = "x86"), not(target_arch = "x86_64")))]