From: Xinliang David Li Date: Mon, 8 Feb 2016 19:14:14 +0000 (+0000) Subject: Simplify test cases X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5976a00f2e9fc928164132ca1157eafec34e030;p=clang Simplify test cases git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260126 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Profile/def-ctors.cpp b/test/Profile/def-ctors.cpp index 06eab85a85..1b52d559e0 100644 --- a/test/Profile/def-ctors.cpp +++ b/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/test/Profile/def-dtors.cpp b/test/Profile/def-dtors.cpp index ad0434571c..bfa535634d 100644 --- a/test/Profile/def-dtors.cpp +++ b/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; }