diff --git a/clang/test/Profile/def-ctors.cpp b/clang/test/Profile/def-ctors.cpp index 06eab85a8561..1b52d559e011 100644 --- a/clang/test/Profile/def-ctors.cpp +++ b/clang/test/Profile/def-ctors.cpp @@ -5,12 +5,7 @@ struct Base { int B; Base() : B(2) {} - Base(const struct Base &b2) { - if (b2.B == 0) { - B = b2.B + 1; - } else - B = b2.B; - } + Base(const struct Base &b2) {} }; struct Derived : public Base { @@ -28,18 +23,14 @@ struct Derived : public Base { // Check that coverage mapping has 6 function records including // the defaulted Derived::Derived(const Derived), and Derived::Derived() // methds. - // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [6 x + // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [5 x // <{{.*}}>], - int I; - int J; - int getI() { return I; } }; Derived dd; int g; int main() { Derived dd2(dd); - - g = dd2.getI(); + g = dd2.B; return 0; } diff --git a/clang/test/Profile/def-dtors.cpp b/clang/test/Profile/def-dtors.cpp index ad0434571c17..bfa535634d1e 100644 --- a/clang/test/Profile/def-dtors.cpp +++ b/clang/test/Profile/def-dtors.cpp @@ -9,7 +9,7 @@ struct Base { }; struct Derived : public Base { - Derived(int K) : Base(K), I(K), J(K) {} + Derived(int K) : Base(K) {} ~Derived() = default; // PGOGEN-LABEL: define {{.*}}@_ZN7DerivedD2Ev // PGOGEN: %pgocount = load {{.*}} @__profc__ZN7DerivedD2Ev @@ -18,18 +18,13 @@ struct Derived : public Base { // Check that coverage mapping has 6 function records including // the default destructor in the derived class. - // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [6 x + // COVMAP: @__llvm_coverage_mapping = {{.*}} { { i32, i32, i32, i32 }, [5 x // <{{.*}}>], - - int I; - int J; - int getI() { return I; } }; -Derived dd(100); -int g; int main() { - Derived dd2(dd.getI()); - g = dd2.getI(); + Derived dd2(10); + if (dd2.B != 10) + return 1; return 0; }