//# publish module 0x1.A { import 0x1.signer; struct T has key {v: u64} struct U has key {v: u64} // tests valid acquires of global resources with borrow_global public A0(account: &signer) acquires T { let sender: address; let t_ref: &mut Self.T; label b0: sender = signer.address_of(move(account)); t_ref = borrow_global_mut(copy(sender)); _ = move(t_ref); t_ref = borrow_global_mut(copy(sender)); _ = move(t_ref); return; } public A1(account: &signer) acquires T, U { let sender: address; let t_ref: &mut Self.T; let u_ref: &mut Self.U; label b0: sender = signer.address_of(move(account)); t_ref = borrow_global_mut(copy(sender)); u_ref = borrow_global_mut(copy(sender)); _ = move(t_ref); _ = move(u_ref); return; } public A2(account: &signer, b: bool) acquires T { let sender: address; let t_ref: &mut Self.T; label b0: sender = signer.address_of(move(account)); jump_if (move(b)) b2; label b1: t_ref = borrow_global_mut(copy(sender)); jump b3; label b2: t_ref = borrow_global_mut(copy(sender)); jump b3; label b3: _ = move(t_ref); return; } public A3(account: &signer, b: bool) acquires T { let sender: address; let t_ref: &mut Self.T; label b0: sender = signer.address_of(move(account)); jump_if (move(b)) b2; label b1: return; label b2: t_ref = borrow_global_mut(copy(sender)); _ = move(t_ref); return; } public A4(account: &signer, b: bool) acquires T { let sender: address; let x: Self.T; let y: &mut Self.T; label b0: sender = signer.address_of(copy(account)); x = move_from(copy(sender)); y = borrow_global_mut(move(sender)); _ = move(y); move_to(move(account), move(x)); return; } public A5(account: &signer) acquires T { let t_ref: &Self.T; let sender: address; label b0: sender = signer.address_of(move(account)); t_ref = borrow_global(move(sender)); return; } }