[compiler-rt] r209099 - profile: explicitly initialize file name in the test

Saleem Abdulrasool compnerd at compnerd.org
Sun May 18 13:05:35 PDT 2014

Author: compnerd
Date: Sun May 18 15:05:35 2014
New Revision: 209099

URL: http://llvm.org/viewvc/llvm-project?rev=209099&view=rev
profile: explicitly initialize file name in the test

The instrprofile-write-file-only test was failing on the builtbots.  The runtime
library initialization is explicitly being discarded to avoid the atexit hook.
However, this would also prevent the filename from being initialized.  Thus,
when the write file was invoked, the filename would not be setup, and the test
would fail as the profiling data would never be written out.  Explicitly
initialize the filename to ensure that the data is written out when requested.
This should hopefully finally get the build bots all green again.


Modified: compiler-rt/trunk/test/profile/instrprof-write-file-only.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-write-file-only.c?rev=209099&r1=209098&r2=209099&view=diff
--- compiler-rt/trunk/test/profile/instrprof-write-file-only.c (original)
+++ compiler-rt/trunk/test/profile/instrprof-write-file-only.c Sun May 18 15:05:35 2014
@@ -4,6 +4,7 @@
 // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
 int __llvm_profile_runtime = 0;
+void __llvm_profile_initialize_file(void);
 int __llvm_profile_write_file(void);
 void __llvm_profile_set_filename(const char *);
 int foo(int);
@@ -13,6 +14,10 @@ int main(int argc, const char *argv[]) {
   if (argc > 1)
     return 1;
+  // Since the runtime has been suppressed, initialize the file name, as the
+  // writing will fail below as the file name has not been specified.
+  __llvm_profile_initialize_file();
   // Write out the profile.

More information about the llvm-commits mailing list