Fix global_asm macro pretty printing

This commit is contained in:
Michael Goulet 2022-09-03 08:05:48 +00:00
parent 0209485578
commit e9b01c745d
3 changed files with 14 additions and 0 deletions

View File

@ -218,6 +218,8 @@ pub(crate) fn print_item(&mut self, item: &ast::Item) {
ast::ItemKind::GlobalAsm(ref asm) => {
self.head(visibility_qualified(&item.vis, "global_asm!"));
self.print_inline_asm(asm);
self.word(";");
self.end();
self.end();
}
ast::ItemKind::TyAlias(box ast::TyAlias {

View File

@ -0,0 +1,3 @@
// check-pass
// compile-flags: -Zunpretty=expanded
core::arch::global_asm!("x: .byte 42");

View File

@ -0,0 +1,9 @@
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// check-pass
// compile-flags: -Zunpretty=expanded
global_asm! ("x: .byte 42");