1 // Check that instrprof does not introduce references to discarded sections when
4 // Occasionally, it is possible that the same function can be compiled in
5 // different TUs with slightly different linkages, e.g., due to different
6 // compiler options. However, if these are comdat functions, a single
7 // implementation will be chosen at link time. we want to ensure that the
8 // profiling data does not contain a reference to the discarded section.
10 // UNSUPPORTED: target={{.*windows.*}}
13 // RUN: %clangxx_pgogen -O2 -fPIC -ffunction-sections -fdata-sections -c %s -o %t.d/a1.o -DOBJECT_1 -mllvm -disable-preinline
14 // RUN: %clangxx_pgogen -O2 -fPIC -ffunction-sections -fdata-sections -c %s -o %t.d/a2.o
15 // RUN: %clangxx_pgogen -fPIC -shared -o %t.d/liba.so %t.d/a1.o %t.d/a2.o 2>&1 | FileCheck %s --allow-empty
17 // Ensure that we don't get an error when linking
18 // CHECK-NOT: relocation refers to a discarded section: .text._ZN1CIiE1fEi
20 template <typename T
> struct C
{
33 __attribute__((noinline
))