diff options
author | Betul Buyukkurt <betulb@codeaurora.org> | 2016-01-23 22:50:44 +0000 |
---|---|---|
committer | Betul Buyukkurt <betulb@codeaurora.org> | 2016-01-23 22:50:44 +0000 |
commit | 518276a5fec86b3dfc84635fc0a0ec77ab21e04a (patch) | |
tree | 9c098331fe5c86da7720a571b67e46571f7a85be /clang/test/Profile/c-indirect-call.c | |
parent | 0af37b21c8ed7381315edbf3658fc451185a6708 (diff) | |
download | bcm5719-llvm-518276a5fec86b3dfc84635fc0a0ec77ab21e04a.tar.gz bcm5719-llvm-518276a5fec86b3dfc84635fc0a0ec77ab21e04a.zip |
Clang changes for value profiling
Differential Revision: http://reviews.llvm.org/D8940
llvm-svn: 258650
Diffstat (limited to 'clang/test/Profile/c-indirect-call.c')
-rw-r--r-- | clang/test/Profile/c-indirect-call.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Profile/c-indirect-call.c b/clang/test/Profile/c-indirect-call.c new file mode 100644 index 00000000000..0d8f3babdbd --- /dev/null +++ b/clang/test/Profile/c-indirect-call.c @@ -0,0 +1,15 @@ +// Check the data structures emitted by instrumentation. +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-indirect-call.c %s -o - -emit-llvm -fprofile-instr-generate -mllvm -enable-value-profiling | FileCheck %s + +void (*foo)(void); + +int main(void) { +// CHECK: [[REG1:%[0-9]+]] = load void ()*, void ()** @foo, align 8 +// CHECK-NEXT: call void [[REG1]]() +// CHECK-NEXT: [[REG2:%[0-9]+]] = ptrtoint void ()* [[REG1]] to i64 +// CHECK-NEXT: call void @__llvm_profile_instrument_target(i64 [[REG2]], i8* bitcast ({ i32, i32, i64, i8*, i64*, i8*, i8*, [1 x i16] }* @__profd_main to i8*), i32 0) + foo(); + return 0; +} + +// CHECK: declare void @__llvm_profile_instrument_target(i64, i8*, i32) |