summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBetul Buyukkurt <betulb@codeaurora.org>2016-04-13 20:02:07 +0000
committerBetul Buyukkurt <betulb@codeaurora.org>2016-04-13 20:02:07 +0000
commit06fe915a208477335050b6832f3e6765e1410706 (patch)
treea6218651d596203bee1eb78e6ed26fd1ebaacaf4 /test
parent47d4145a51976c80f94b4c1add764ddc7ef21a57 (diff)
[PGO] Fix the buildbots for r266229.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/profile/instrprof-value-prof-2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/profile/instrprof-value-prof-2.c b/test/profile/instrprof-value-prof-2.c
index 81ca14121..a5939fe5c 100644
--- a/test/profile/instrprof-value-prof-2.c
+++ b/test/profile/instrprof-value-prof-2.c
@@ -33,10 +33,19 @@ void caller_with_value_site_never_called2() {}
void caller_without_value_site2() {}
void caller_with_vp2() {}
+void (*callee1Ptr)();
+void (*callee2Ptr)();
+
+void __attribute__ ((noinline)) setFunctionPointers () {
+ callee1Ptr = callee1;
+ callee2Ptr = callee2;
+}
+
int main(int argc, const char *argv[]) {
unsigned S, NS = 10, V;
const __llvm_profile_data *Data, *DataEnd;
+ setFunctionPointers();
Data = __llvm_profile_begin_data();
DataEnd = __llvm_profile_end_data();
for (; Data < DataEnd; Data = __llvm_profile_iterate_data(Data)) {
@@ -55,9 +64,9 @@ int main(int argc, const char *argv[]) {
for (S = 0; S < NS; S++) {
unsigned C;
for (C = 0; C < S + 1; C++) {
- __llvm_profile_instrument_target((uint64_t)&callee1, (void *)Data, S);
+ __llvm_profile_instrument_target((uint64_t)callee1Ptr, (void *)Data, S);
if (C % 2 == 0)
- __llvm_profile_instrument_target((uint64_t)&callee2, (void *)Data, S);
+ __llvm_profile_instrument_target((uint64_t)callee2Ptr, (void *)Data, S);
}
}
}