1 // Ensure that implicit methods aren't instrumented.
3 // RUN: %clang_cc1 -x c++ -std=c++11 %s -triple %itanium_abi_triple -main-file-name cxx-implicit.cpp -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s
5 // Implicit constructors are generated for Base. We should not emit counters
7 // CHECK-DAG: define {{.*}}_ZN4BaseC2Ev
8 // CHECK-DAG: define {{.*}}_ZN4BaseC2ERKS_
9 // CHECK-DAG: define {{.*}}_ZN4BaseC2EOS_
10 // CHECK-DAG: __profc__ZN7DerivedC2Ev,
11 // CHECK-DAG: __profc__ZN7DerivedC2ERKS_
12 // CHECK-DAG: __profc__ZN7DerivedC2EOS_
13 // CHECK-NOT: @__profc__ZN4BaseC2Ev =
14 // CHECK-NOT: @__profc__ZN4BaseC2ERKS_
15 // CHECK-NOT: @__profc__ZN4BaseC2EOS_
17 // Implicit assignment operators are generated for Base. We should not emit counters
19 // CHECK-NOT: @__profc__ZN4BaseaSEOS_
20 // CHECK-NOT: @__profc__ZN4BaseaSERKS_
24 BaseBase(const BaseBase
&);
25 BaseBase
&operator=(const BaseBase
&);
26 BaseBase
&operator=(BaseBase
&&);
29 struct Base
: public BaseBase
{
33 struct Derived
: public Base
{
35 Derived(const Derived
&);
37 Derived
&operator=(const Derived
&);
38 Derived
&operator=(Derived
&&);
42 Derived::Derived(const Derived
&d
) : Base(d
) {}
43 Derived::Derived(Derived
&&d
) : Base(static_cast<Base
&&>(d
)) {}
44 Derived
& Derived::operator=(const Derived
&d
) {
48 Derived
& Derived::operator=(Derived
&&d
) {
49 Base::operator=(static_cast<Base
&&>(d
));