Created
October 13, 2011 01:38
-
-
Save springmeyer/1283119 to your computer and use it in GitHub Desktop.
test clang++ and gold ld with LTO
This file contains hidden or 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
echo '#include <string>' > lib.hpp | |
echo 'std::string hello();' >> lib.hpp | |
echo '#include "lib.hpp"' > lib.cpp | |
echo 'std::string hello() { return "hello world\n"; }' >> lib.cpp | |
echo '#include <iostream>' > test.cpp | |
echo '#include "lib.hpp"' >> test.cpp | |
echo 'int main(void) { std::cout << hello();return 0; }' >> test.cpp | |
clang++ -o test -O4 test.cpp lib.cpp -use-gold-plugin | |
./test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment