diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:48 +0000 |
commit | 371b477836f289f2e9caaab58530f187b51bc86d (patch) | |
tree | bbdf1f13383329ac98762238b1e0f1bd36c84dcf /test | |
parent | 56e9b0d28ed8d496a0cbd7fd0f22fbcf2f64acfa (diff) |
Fix subtle bug in AnalysisConsumer where we would not analyze functions whose parent
in the call graph had been inlined but for whatever reason we did not inline some
of its callees.
Also, fix a related traversal bug where we meant to do a BFS of the callgraph but
instead were doing a DFS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m | 4 | ||||
-rw-r--r-- | test/Analysis/traversal-algorithm.mm | 208 |
2 files changed, 164 insertions, 48 deletions
diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m index 7cf2aee35f..e4d5aaf82b 100644 --- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m +++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m @@ -80,11 +80,11 @@ int handleVoidInComma() { int marker(void) { // control reaches end of non-void function } -// CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type 'long double' that will be garbage // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage -// CHECK-darwin8: warning: The receiver of message 'doubleM' is nil and returns a value of type 'double' that will be garbage // CHECK-darwin8: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value of type 'unsigned long long' that will be garbage +// CHECK-darwin8: warning: The receiver of message 'doubleM' is nil and returns a value of type 'double' that will be garbage // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage +// CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type 'long double' that will be garbage // CHECK-darwin9-NOT: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage // CHECK-darwin9-NOT: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value of type 'unsigned long long' that will be garbage diff --git a/test/Analysis/traversal-algorithm.mm b/test/Analysis/traversal-algorithm.mm index 49e72249e0..e8a36eafc7 100644 --- a/test/Analysis/traversal-algorithm.mm +++ b/test/Analysis/traversal-algorithm.mm @@ -23,43 +23,6 @@ void test(id input) { work(); } -// This ordering assumes that true cases happen before the false cases. - -// BFS: 10 IfStmt -// BFS-NEXT: 11 IfStmt -// BFS-NEXT: 16 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: 22 IfStmt -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- -// BFS-NEXT: --END PATH-- - -// And this ordering assumes that false cases happen before the true cases. - -// DFS: 10 IfStmt -// DFS-NEXT: 16 IfStmt -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 11 IfStmt -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- -// DFS-NEXT: 22 IfStmt -// DFS-NEXT: --END PATH-- -// DFS-NEXT: --END PATH-- - - void testLoops(id input) { while (a()) { work(); @@ -85,13 +48,166 @@ void testLoops(id input) { } } -// BFS: 64 WhileStmt -// BFS: 70 ForStmt -// BFS-NOT-NEXT: ObjCForCollectionStmt -// BFS: 74 ObjCForCollectionStmt -// BFS: 81 CXXForRangeStmt +// This ordering assumes that false cases happen before the true cases. + +// DFS:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:27 WhileStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:33 ForStmt +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:44 CXXForRangeStmt +// DFS-next:--END PATH-- +// DFS-next:37 ObjCForCollectionStmt +// DFS-next:10 IfStmt +// DFS-next:16 IfStmt +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:11 IfStmt +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- +// DFS-next:22 IfStmt +// DFS-next:--END PATH-- +// DFS-next:--END PATH-- -// DFS: 64 While -// DFS-NEXT: 70 ForStmt -// DFS-NEXT: 74 ObjCForCollectionStmt -// DFS-NEXT: 81 CXXForRangeStmt |