[PATCH] D14468: Add zero size dummy data to ensure section symbol is always created

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 10:14:02 PST 2015


vsk added a comment.

Nice!


================
Comment at: test/profile/instrprof-shared.test:4
@@ +3,3 @@
+RUN: %clang -o %t.d/libt-no-instr1.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c
+RUN: %clang -c -o %t.d/instrprof-shared-lib.o -fPIC  %S/Inputs/instrprof-shared-lib.c
+RUN: %clang_profgen -o %t.d/libt-no-instr2.so -fPIC -shared %t.d/instrprof-shared-lib.o
----------------
Could you rename `instrprof-shared-lib.o` to `instrprof-shared-lib-noinstr.o`?

================
Comment at: test/profile/instrprof-shared.test:7
@@ +6,3 @@
+
+
+RUN: %clang_profgen -o %t-instr-instr -L%t.d -rpath %t.d -lt-instr  %S/Inputs/instrprof-shared-main.c
----------------
Could you add a comment explaining your approach? Something like:

'''
This test produces three shared objects.
- libt-instr.so is instrumented
- libt-no-instr1.so is not instrumented
- libt-no-instr2.so is compiled with instrumentation enabled, but is formed out of an uninstrumented object

Verify that compiling against these shared objects with and without instrumentation enabled behaves as expected.
'''

================
Comment at: test/profile/instrprof-shared.test:9
@@ +8,3 @@
+RUN: %clang_profgen -o %t-instr-instr -L%t.d -rpath %t.d -lt-instr  %S/Inputs/instrprof-shared-main.c
+RUN: %clang_profgen -o %t-instr-no-instr -L%t.d -rpath %t.d -lt-no-instr1  %S/Inputs/instrprof-shared-main.c
+RUN: %clang_profgen -o %t-instr-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2  %S/Inputs/instrprof-shared-main.c
----------------
`%t-instr-no-instr` -> `%t-instr-no-instr1`?

================
Comment at: test/profile/instrprof-shared.test:12
@@ +11,3 @@
+RUN: %clang -o %t-no-instr-instr -L%t.d -rpath %t.d -lt-instr  %S/Inputs/instrprof-shared-main.c
+RUN: %clang -o %t-no-instr-no-instr -L%t.d -rpath %t.d -lt-no-instr1  %S/Inputs/instrprof-shared-main.c
+RUN: %clang -o %t-no-instr-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2  %S/Inputs/instrprof-shared-main.c
----------------
`%t-no-instr-no-instr` -> `%t-no-instr-no-instr1`?

================
Comment at: test/profile/instrprof-shared.test:30
@@ +29,3 @@
+RUN: llvm-profdata merge -o %t-no-instr2-instr.profdata %t-no-instr2-instr.profraw
+
+RUN: llvm-profdata show -counts --function main %t-instr-instr.profdata | grep -v 'Total\|Maximum' > %t-main-1
----------------
Can you add negative tests (`not RUN`?) showing that the uninstrumented binaries produce no profraw files?


http://reviews.llvm.org/D14468





More information about the llvm-commits mailing list