Mark function as 'used' so that LTO doesn't try to get rid of it.
authorBill Wendling <isanbard@gmail.com>
Fri, 12 Oct 2012 01:15:17 +0000 (01:15 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 12 Oct 2012 01:15:17 +0000 (01:15 +0000)
llvm-svn: 165777

llvm/unittests/ExecutionEngine/JIT/JITTest.cpp

index 5e2af03..1eff4d6 100644 (file)
@@ -633,7 +633,7 @@ TEST_F(JITTest, AvailableExternallyGlobalIsntEmitted) {
 // This function is intentionally defined differently in the statically-compiled
 // program from the IR input to the JIT to assert that the JIT doesn't use its
 // definition.
-extern "C" int32_t JITTest_AvailableExternallyFunction() {
+extern "C" int32_t JITTest_AvailableExternallyFunction() __attribute__((used)) {
   return 42;
 }
 namespace {