InstrProf: Support for setting profile output from command line
This change is the third of 3 patches to add support for specifying
the profile output from the command line via -fprofile-instr-generate=<path>,
where the specified output path/file will be overridden by the
LLVM_PROFILE_FILE environment variable.
This patch adds the necessary support to the clang frontend, and adds a
new test.
The compiler-rt and llvm parts are r236055 and r236288, respectively.
Patch by Teresa Johnson. Thanks!
llvm-svn: 236289
diff --git a/clang/test/Profile/c-generate.c b/clang/test/Profile/c-generate.c
new file mode 100644
index 0000000..8b979d6
--- /dev/null
+++ b/clang/test/Profile/c-generate.c
@@ -0,0 +1,10 @@
+// Check that the -fprofile-instr-generate= form works.
+// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instr-generate=c-generate-test.profraw | FileCheck %s
+
+// CHECK: private constant [24 x i8] c"c-generate-test.profraw\00"
+// CHECK: call void @__llvm_profile_set_filename_env_override(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @0, i32 0, i32 0))
+// CHECK: declare void @__llvm_profile_set_filename_env_override(i8*)
+
+int main(void) {
+ return 0;
+}