From 785b5a895081325aaa574477c132f33ef03ed9e0 Mon Sep 17 00:00:00 2001 From: Betul Buyukkurt Date: Wed, 13 Apr 2016 20:02:07 +0000 Subject: [PATCH] [PGO] Fix the buildbots for r266229. llvm-svn: 266240 --- compiler-rt/test/profile/instrprof-value-prof-2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler-rt/test/profile/instrprof-value-prof-2.c b/compiler-rt/test/profile/instrprof-value-prof-2.c index 81ca141..a5939fe 100644 --- a/compiler-rt/test/profile/instrprof-value-prof-2.c +++ b/compiler-rt/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); } } } -- 2.7.4