summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-11-13 22:33:07 +0000
committerXinliang David Li <davidxl@google.com>2015-11-13 22:33:07 +0000
commitb6c81d2b924c1759a90651a0d41e5a505752548c (patch)
tree5835326c9f44a8eda2314ffcc87d9cc5effc46f2 /compiler-rt/test/profile/Inputs/instrprof-shared-lib.c
parente6edd48d69dbe8107301b82fe98be05e9baf4504 (diff)
downloadbcm5719-llvm-b6c81d2b924c1759a90651a0d41e5a505752548c.tar.gz
bcm5719-llvm-b6c81d2b924c1759a90651a0d41e5a505752548c.zip
[PGO] Ensure profile section symbols are created (linux)
- This is to handle a corner case where profile lib is linked in but non of the modules are instrumented (On linux, since we avoided the overhead to emit runtime hook use functions so this is the side effect of that size optimization). - Added a profile runtime test case to cover all scenarios of shared library builds. Differential Revision: http://reviews.llvm.org/D14468 llvm-svn: 253098
Diffstat (limited to 'compiler-rt/test/profile/Inputs/instrprof-shared-lib.c')
-rw-r--r--compiler-rt/test/profile/Inputs/instrprof-shared-lib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c
new file mode 100644
index 00000000000..d22b0a54a01
--- /dev/null
+++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c
@@ -0,0 +1,9 @@
+int g1 = 0;
+int g2 = 1;
+
+void foo(int n) {
+ if (n % 5 == 0)
+ g1++;
+ else
+ g2++;
+}
OpenPOWER on IntegriCloud