From 64581393cf4cdd6f031d6d92800156860c661a73 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Mon, 8 Feb 2016 19:14:14 +0000 Subject: [PATCH] Simplify test cases llvm-svn: 260126 --- clang/test/Profile/def-ctors.cpp | 15 +++------------ clang/test/Profile/def-dtors.cpp | 15 +++++---------- 2 files changed, 8 insertions(+), 22 deletions(-) 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; }