r260126 - Simplify test cases
Xinliang David Li via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 8 11:14:14 PST 2016
Author: davidxl
Date: Mon Feb 8 13:14:14 2016
New Revision: 260126
URL: http://llvm.org/viewvc/llvm-project?rev=260126&view=rev
Log:
Simplify test cases
Modified:
cfe/trunk/test/Profile/def-ctors.cpp
cfe/trunk/test/Profile/def-dtors.cpp
Modified: cfe/trunk/test/Profile/def-ctors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/def-ctors.cpp?rev=260126&r1=260125&r2=260126&view=diff
==============================================================================
--- cfe/trunk/test/Profile/def-ctors.cpp (original)
+++ cfe/trunk/test/Profile/def-ctors.cpp Mon Feb 8 13:14:14 2016
@@ -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;
}
Modified: cfe/trunk/test/Profile/def-dtors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/def-dtors.cpp?rev=260126&r1=260125&r2=260126&view=diff
==============================================================================
--- cfe/trunk/test/Profile/def-dtors.cpp (original)
+++ cfe/trunk/test/Profile/def-dtors.cpp Mon Feb 8 13:14:14 2016
@@ -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;
}
More information about the cfe-commits
mailing list