File tree 2 files changed +44
-5
lines changed 2 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -1786,11 +1786,7 @@ impl<'a> State<'a> {
1786
1786
}
1787
1787
}
1788
1788
ast:: ExprInlineAsm ( ref a) => {
1789
- if a. volatile {
1790
- try!( word ( & mut self . s , "__volatile__ asm!" ) ) ;
1791
- } else {
1792
- try!( word ( & mut self . s , "asm!" ) ) ;
1793
- }
1789
+ try!( word ( & mut self . s , "asm!" ) ) ;
1794
1790
try!( self . popen ( ) ) ;
1795
1791
try!( self . print_string ( a. asm . get ( ) , a. asm_str_style ) ) ;
1796
1792
try!( self . word_space ( ":" ) ) ;
@@ -1828,6 +1824,28 @@ impl<'a> State<'a> {
1828
1824
try!( s. print_string ( co. get ( ) , ast:: CookedStr ) ) ;
1829
1825
Ok ( ( ) )
1830
1826
} ) ) ;
1827
+
1828
+ let mut options = vec ! ( ) ;
1829
+ if a. volatile {
1830
+ options. push ( "volatile" ) ;
1831
+ }
1832
+ if a. alignstack {
1833
+ options. push ( "alignstack" ) ;
1834
+ }
1835
+ if a. dialect == ast:: AsmDialect :: AsmIntel {
1836
+ options. push ( "intel" ) ;
1837
+ }
1838
+
1839
+ if options. len ( ) > 0 {
1840
+ try!( space ( & mut self . s ) ) ;
1841
+ try!( self . word_space ( ":" ) ) ;
1842
+ try!( self . commasep ( Inconsistent , & * options,
1843
+ |s, & co| {
1844
+ try!( s. print_string ( co, ast:: CookedStr ) ) ;
1845
+ Ok ( ( ) )
1846
+ } ) ) ;
1847
+ }
1848
+
1831
1849
try!( self . pclose ( ) ) ;
1832
1850
}
1833
1851
ast:: ExprMac ( ref m) => try!( self . print_mac ( m, token:: Paren ) ) ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ feature( asm) ]
12
+
13
+ // pp-exact
14
+
15
+ pub fn main ( ) {
16
+ unsafe {
17
+ asm ! ( "" : : : : "volatile" ) ;
18
+ asm ! ( "" : : : : "alignstack" ) ;
19
+ asm ! ( "" : : : : "intel" ) ;
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments