[poolalloc] r238374 - DSTest: Fail test if any, not all, specified callees are reported.

Will Dietz wdietz2 at illinois.edu
Wed May 27 16:02:30 PDT 2015


Author: wdietz2
Date: Wed May 27 18:02:30 2015
New Revision: 238374

URL: http://llvm.org/viewvc/llvm-project?rev=238374&view=rev
Log:
DSTest: Fail test if any, not all, specified callees are reported.

Test included.

Added:
    poolalloc/trunk/test/dsa/callgraph/dstest_anynotall.ll
Modified:
    poolalloc/trunk/lib/DSA/DSTest.cpp

Modified: poolalloc/trunk/lib/DSA/DSTest.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=238374&r1=238373&r2=238374&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSTest.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSTest.cpp Wed May 27 18:02:30 2015
@@ -621,12 +621,11 @@ static bool checkNotCallees(llvm::raw_os
   const DSCallGraph callgraph = DS->getCallGraph();
   FuncSetTy analysisCallees = getCalleesFor(caller, callgraph);
 
-  if (std::includes(analysisCallees.begin(), analysisCallees.end(),
-                    notCallees.begin(), notCallees.end())) {
-    FuncSetTy invalid;
-    std::set_intersection(analysisCallees.begin(), analysisCallees.end(),
-                          notCallees.begin(), notCallees.end(),
-                          std::inserter(invalid, invalid.begin()));
+  FuncSetTy invalid;
+  std::set_intersection(analysisCallees.begin(), analysisCallees.end(),
+                        notCallees.begin(), notCallees.end(),
+                        std::inserter(invalid, invalid.begin()));
+  if (!invalid.empty()) {
     errs() << "ERROR: Callgraph check failed for: \t" << caller->getName() << "\n";
     errs() << "              Analysis says calls: \t";
     printCallees(analysisCallees, errs()); errs() << "\n";

Added: poolalloc/trunk/test/dsa/callgraph/dstest_anynotall.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/dstest_anynotall.ll?rev=238374&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/dstest_anynotall.ll (added)
+++ poolalloc/trunk/test/dsa/callgraph/dstest_anynotall.ll Wed May 27 18:02:30 2015
@@ -0,0 +1,25 @@
+;RUN: dsaopt %s -dsa-td -analyze -check-callees=main,A
+;RUN: dsaopt %s -dsa-td -analyze -check-not-callees=main
+; Verify -check-not-callee behavior as error if any not all
+; specified callees are reported by the callgraph.
+; Test this using an empty set of callees.
+; ModuleID = 'calltargets.o'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+define internal void @A() nounwind {
+entry:
+	ret void
+}
+
+define internal void @B() nounwind {
+entry:
+	ret void
+}
+
+define void @main() nounwind {
+entry:
+	call void @A() nounwind
+	ret void
+}
+





More information about the llvm-commits mailing list