3 // RUN: rm -rf %t.dir && mkdir -p %t.dir
4 // RUN: %clang_pgogen -o %t.exe %s
6 // Note: %%p is needed here, not %p, because of lit's path substitution.
7 // RUN: env LLVM_PROFILE_FILE="%t.dir/%c-%%p" %run %t.exe
12 extern int __llvm_profile_is_continuous_mode_enabled(void);
13 extern const char *__llvm_profile_get_filename(void);
14 extern int getpid(void);
17 // Check that continuous mode is enabled.
18 if (!__llvm_profile_is_continuous_mode_enabled())
21 // Check that the PID is actually in the filename.
22 const char *Filename
= __llvm_profile_get_filename();
24 int Len
= strlen(Filename
);
26 while (Filename
[Len
] != '-')
29 const char *PidStr
= Filename
+ Len
+ 1;
30 int Pid
= atoi(PidStr
);