File tree Expand file tree Collapse file tree 2 files changed +44
-5
lines changed Expand file tree Collapse file tree 2 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -1787,11 +1787,7 @@ impl<'a> State<'a> {
1787
1787
}
1788
1788
}
1789
1789
ast:: ExprInlineAsm ( ref a) => {
1790
- if a. volatile {
1791
- try!( word ( & mut self . s , "__volatile__ asm!" ) ) ;
1792
- } else {
1793
- try!( word ( & mut self . s , "asm!" ) ) ;
1794
- }
1790
+ try!( word ( & mut self . s , "asm!" ) ) ;
1795
1791
try!( self . popen ( ) ) ;
1796
1792
try!( self . print_string ( a. asm . get ( ) , a. asm_str_style ) ) ;
1797
1793
try!( self . word_space ( ":" ) ) ;
@@ -1829,6 +1825,28 @@ impl<'a> State<'a> {
1829
1825
try!( s. print_string ( co. get ( ) , ast:: CookedStr ) ) ;
1830
1826
Ok ( ( ) )
1831
1827
} ) ) ;
1828
+
1829
+ let mut options = vec ! ( ) ;
1830
+ if a. volatile {
1831
+ options. push ( "volatile" ) ;
1832
+ }
1833
+ if a. alignstack {
1834
+ options. push ( "alignstack" ) ;
1835
+ }
1836
+ if a. dialect == ast:: AsmDialect :: AsmIntel {
1837
+ options. push ( "intel" ) ;
1838
+ }
1839
+
1840
+ if options. len ( ) > 0 {
1841
+ try!( space ( & mut self . s ) ) ;
1842
+ try!( self . word_space ( ":" ) ) ;
1843
+ try!( self . commasep ( Inconsistent , & * options,
1844
+ |s, & co| {
1845
+ try!( s. print_string ( co, ast:: CookedStr ) ) ;
1846
+ Ok ( ( ) )
1847
+ } ) ) ;
1848
+ }
1849
+
1832
1850
try!( self . pclose ( ) ) ;
1833
1851
}
1834
1852
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