Created
September 9, 2015 19:51
-
-
Save ruslo/05989fd4f807ae79671e to your computer and use it in GitHub Desktop.
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 reference test | |
> cat a.cpp | |
int foo(int a) { | |
return a + 3; | |
} | |
> g++ -O3 a.cpp -c -o a.o | |
> objdump -d a.o | |
0000000000000000 <_Z3fooi>: | |
0: 8d 47 03 lea 0x3(%rdi),%eax | |
3: c3 retq | |
### Test with reference | |
> cat a.cpp | |
int foo(const int& a) { | |
return a + 3; | |
} | |
> g++ -O3 a.cpp -c -o a.o | |
> objdump -d a.o | |
0000000000000000 <_Z3fooRKi>: | |
0: 8b 07 mov (%rdi),%eax | |
2: 83 c0 03 add $0x3,%eax | |
5: c3 retq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment