xref: /aosp_15_r20/external/compiler-rt/test/profile/Inputs/instrprof-icall-promo_2.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot #include "instrprof-icall-promo.h"
2*7c3d14c8STreehugger Robot extern int ref(A *);
3*7c3d14c8STreehugger Robot 
bar()4*7c3d14c8STreehugger Robot int A::bar() { return 2; }
5*7c3d14c8STreehugger Robot 
6*7c3d14c8STreehugger Robot extern A *ap;
test()7*7c3d14c8STreehugger Robot int test() {
8*7c3d14c8STreehugger Robot   for (int i = 0; i < 10000; i++) ap->foo();
9*7c3d14c8STreehugger Robot   return ref(ap);
10*7c3d14c8STreehugger Robot }
11*7c3d14c8STreehugger Robot 
main()12*7c3d14c8STreehugger Robot int main() {
13*7c3d14c8STreehugger Robot   test();
14*7c3d14c8STreehugger Robot   return 0;
15*7c3d14c8STreehugger Robot }
16