[compiler-rt] r260050 - Test update : tighten up checks

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 7 12:05:07 PST 2016


Author: davidxl
Date: Sun Feb  7 14:05:06 2016
New Revision: 260050

URL: http://llvm.org/viewvc/llvm-project?rev=260050&view=rev
Log:
Test update : tighten up checks

Added:
    compiler-rt/trunk/test/profile/Linux/coverage_assignop.cpp
Modified:
    compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp
    compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp

Added: compiler-rt/trunk/test/profile/Linux/coverage_assignop.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_assignop.cpp?rev=260050&view=auto
==============================================================================
--- compiler-rt/trunk/test/profile/Linux/coverage_assignop.cpp (added)
+++ compiler-rt/trunk/test/profile/Linux/coverage_assignop.cpp Sun Feb  7 14:05:06 2016
@@ -0,0 +1,42 @@
+// RUN: %clang_profgen -x c++  -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata merge -o %t.profdata %t.profraw
+// RUN: llvm-cov show %t -instr-profile %t.profdata -filename-equivalence 2>&1 | FileCheck %s
+struct Base1 {
+  int B;
+  Base1(int b) : B(b) {}
+  void operator=(const struct Base1 &b) { B = b.B + 1; }
+};
+
+struct Base2 {
+  int B;
+  Base2(int b) : B(b) {}
+  void operator=(const struct Base2 &b) { B = b.B; }
+};
+
+struct Derived1 : public Base1 {
+  Derived1() : Base1(10) {}
+  Derived1(int B) : Base1(B) {}
+  Derived1 &operator=(const Derived1 &) = default; // CHECK: 2| [[@LINE]]|  Derived1 &operator=(const Derived1 &) = default;
+};
+
+struct Derived2 : public Derived1, public Base2 {
+  Derived2() : Derived1(20), Base2(30) {}
+  Derived2(int B1, int B2) : Derived1(B1), Base2(B2) {}
+  Derived2 &operator=(const Derived2 &) = default; // CHECK: 1| [[@LINE]]|  Derived2 &operator=(const Derived2 &) = default;
+};
+
+Derived1 d1(1);
+Derived2 d2(2, 3);
+
+int main() {
+  Derived1 ld1;
+  Derived2 ld2;
+  Derived2 ld22;
+  ld1 = d1;
+  ld2 = d2;
+  if (ld1.B != 2 || ld2.Base1::B != 3 || ld2.Base2::B != 3 ||
+      ld22.Base1::B != 20 || ld22.Base2::B != 30)
+    return 1;
+  return 0;
+}

Modified: compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp?rev=260050&r1=260049&r2=260050&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp (original)
+++ compiler-rt/trunk/test/profile/Linux/coverage_ctors.cpp Sun Feb  7 14:05:06 2016
@@ -15,10 +15,9 @@ struct Base {
 };
 
 struct Derived : public Base {
-  Derived(const Derived &) = default; // CHECK:  2| [[@LINE]]|  Derived
-  Derived() = default;                // CHECK:  1| [[@LINE]]|  Derived
+  Derived(const Derived &) = default; // CHECK:  2| [[@LINE]]|  Derived(const Derived &) = default;
+  Derived() = default;                // CHECK:  1| [[@LINE]]|  Derived() = default
   int I;
-  int J;
   int getI() { return I; }
 };
 

Modified: compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp?rev=260050&r1=260049&r2=260050&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp (original)
+++ compiler-rt/trunk/test/profile/Linux/coverage_dtor.cpp Sun Feb  7 14:05:06 2016
@@ -10,10 +10,9 @@ struct Base {
 };
 
 struct Derived : public Base {
-  Derived(int K) : Base(K), I(K), J(K) {}
-  ~Derived() = default; // CHECK:  2| [[@LINE]]|  ~Derived
+  Derived(int K) : Base(K), I(K) {}
+  ~Derived() = default; // CHECK:  2| [[@LINE]]|  ~Derived() = default;
   int I;
-  int J;
   int getI() { return I; }
 };
 




More information about the llvm-commits mailing list