Last active
July 22, 2018 05:12
-
-
Save mtn/903444debb80bba70a2de6dd4a21cfba to your computer and use it in GitHub Desktop.
rustc optimization check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[no_mangle] | |
pub fn a_function(arg_1: &mut u32, arg_2: &mut u32) -> u32 { | |
// pub fn a_function(arg_1: &mut u32) { | |
*arg_1 = 10; | |
*arg_2 = 11; | |
*arg_2 | |
} | |
fn main() { | |
let mut a: u32 = 0; | |
let mut b: u32 = 0; | |
a_function(&mut a, &mut b); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build: | |
rustc main.rs -O --emit=obj | |
objdump -D main.o | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment